glusterfs – Replicated Glusterfs Volume – centos 8
0. glusterfs – Replicated Glusterfs Volume – on 3 centos nodes
Files are replicated across the bricks in the volume.
It ensures high storage availability and reliability.
1. prepare
# create device
parted -s -a opt /dev/sdb mklabel gpt mkpart primary 0% 100% set 1 lvm on
pvcreate /dev/sdb1
vgcreate vg_gluster /dev/sdb1
lvcreate -n brick0 -l 100%FREE vg_gluster
mkfs.xfs /dev/vg_gluster/brick0
mkdir -p /export/brick0
mount /dev/vg_gluster/brick0 /export/brick0
echo ‘/dev/vg_gluster/brick0 /export/brick0 xfs defaults 1 2’ | tee -a /etc/fstab
reboot
2. install
# repo
yum -y install centos-release-gluster8
# packages
yum -y install glusterfs-server
# enable and start and check
systemctl enable –now glusterd
systemctl status glusterd
# firewall
firewall-cmd –add-service=glusterfs –permanent
firewall-cmd –reload
3. glusterfs
# trusted storage pool
## add nodes
gluster peer probe glusterfs2.fritz.box # from node1
gluster peer probe glusterfs3.fritz.box # from node1
## remove nodes
gluster peer detach NODE
## status
gluster peer status
gluster pool list
4. volume
mkdir /export/brick0/vol01
gluster volume create vol01 replica 3 transport tcp glusterfs1.fritz.box:/export/brick0/vol01 glusterfs2.fritz.box:/export/brick0/vol01 glusterfs3.fritz.box:/export/brick0/vol01
“volume create: vol01: success: please start the volume to access data/”
gluster volume start vol01
gluster volume info all
5. client
yum -y install centos-release-gluster
yum -y install glusterfs glusterfs-fuse
mkdir /project0
mount -t glusterfs glusterfs1.fritz.box:/vol01 /project0
date | tee /project0/test.txt
# check file on each server
6. tests
# reboot first server
echo “test1” | tee /mnt/test.txt
# check on each server
centos 8