A little about the setup before I begin with the actual setup. I created 3 Centos 7 servers with 1 20gb hard disk and 1 200gb hard disk. Since these 3 machines are virtual, it just seemed easier to do this to keep the data separate from the OS disk. Then I installed Centos and set a static IP for each. The following set of commands needs to be run on all 3 servers.
Install the gluster repo:curl http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo -o /etc/yum.repos.d/glusterfs-epel.repo
Install the epel repo:yum install epel-release
Delete repo cache:yum clean all
Install the glusterfs serveryum -y install glusterfs-server
Create partition on data disk:fdisk /dev/vdb
n
p
Extend the main volume group to cover the new diskvgextend centos /dev/vdb1
Add logical volume to volume group named data and assign it all the space availablelvcreate -l100%FREE -n data centos
Format the new volume groupmkfs.ext4 /dev/mapper/centos-data
Add firewall rules to allow the 3 servers to talkfirewall-cmd --permanent --zone=trusted --add-source=10.10.10.10/32
firewall-cmd --permanent --zone=trusted --add-source=10.10.10.11/32
firewall-cmd --permanent --zone=trusted --add-source=10.10.10.12/32
firewall-cmd --reload
Start and enable the gluster serversystemctl start glusterd
systemctl enable glusterd
Make directory for glustermkdir -p /data/glusterfs
Add host entries so each node knows where the other isecho "10.10.10.11 gfs01" >> /etc/hosts
echo "10.10.10.12 gfs02" >> /etc/hosts
echo "10.10.10.13 gfs03" >> /etc/hosts
Probe each server to make sure it respondsgluster peer probe gfs01
gluster peer probe gfs02
gluster peer probe gfs03
Check peer statusgluster peer status
Create the glusterfs volume to share. The following command creates 3 copies of all data so each node has a copy of the filegluster volume create data replica 3 \
gfs01:/data/glusterfs \
gfs02:/data/glusterfs \
gfs03:/data/glusterfs
Start the data volumegluster volume start data
Check the glusterfs statusgluster volume info
The following is for the client install and mounting of the share:
curl http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo -o /etc/yum.repos.d/glusterfs-epel.repo
yum -y install glusterfs glusterfs-fuse
mount -t glusterfs gfs03.pingnattack.com:/data1 /mnt
df -hT