- 3 Ubuntu Nodes running docker
- DNS Entries for all three nodes
- Create partition on the data drive:
fdisk /dev/xvdb(New, primary, defaults, defaults) - Create XFS file system on the data drive:
mkfs.xfs -i size=512 /dev/xvdb1 - Add disk to /etc/fstab:
/dev/xvdb1 /data/brick1 xfs defaults 1 2 - Mount the drive:
mount -a
-
Create directory /data/brick1 on all three nodes:
mkdir -p /data/brick1 -
Start the GlusterFS Docker container on the three hosts, making sure to mount the /data/brick1 directory:
docker run --restart unless-stopped -v /etc/glusterfs:/etc/glusterfs:z -v /var/lib/glusterd:/var/lib/glusterd:z -v /var/log/glusterfs:/var/log/glusterfs:z -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d --privileged=true --net=host --name gluster_cluster -v /data/brick1:/data/brick1 -v /dev/:/dev gluster/gluster-centos
- Exec into the container and create cluster:
gluster peer probe server2
gluster peer probe server3
gluster peer status
- Create and Start Volume:
gluster volume create gv0 replica 3 server1:/data/brick1/gv0 server2:/data/brick1/gv0 server3:/data/brick1/gv0
gluster volume start gv0
-
Install the glusterfs-client package on all clients:
sudo apt install glusterfs-client -
Mount volume on client:
sudo mount -t glusterfs gluster.fqdn.dns.name:/gv0 /mnt/glustervolume1