## Format disk external ```sh $ mkfs.xfs /dev/vdb ``` ## Set path for disk external for on boot mount automatic Execute in all nodes(node1, node2,node3 ....) ```sh $ mkdir /storage/bricks/1 -p $ echo '/dev/vdb /storage/bricks/1 xfs defaults 0 0' >> /etc/fstab $ mount -a $ mkdir /store/bricks/1/brick ``` **Check disks mounted** ```sh $ df -h Filesystem Size Used Avail Use% Mounted on /dev/vda 18G 909M 17G 3% / /dev/vdb 47G 80M 47G 1% /gluster/bricks/1 ``` **Install GlusterFs** ```sh $ apt update && sudo apt upgrade -y $ apt install xfsprogs attr glusterfs-server glusterfs-common glusterfs-client -y $ sudo systemctl start glusterd $ sudo systemctl enable glusterd ``` **Add Nodes in pool gluster** ```sh $ gluster peer probe node2 $ gluster peer probe node3 $ gluster pool list UUID Hostname State a8107633-42fc-4f34-a34a-179591801781 node2 Connected f307bad6-d8f3-40aa-90c1-0643a5a207cd localhost Connected ``` **Create the Replicated GlusterFS Volume** ```sh $ gluster volume create gv0 \ replica 3 \ node1:/storage/bricks/1/brick \ node2:/storage/bricks/2/brick volume create: gv0: success: please start the volume to access data $ gluster volume start gv0 $ gluster vol list dev ```` **List Volumes** ```sh $ gluster volume status gv0 Status of volume: gv0 Gluster process TCP Port RDMA Port Online Pid ------------------------------------------------------------------------------ Brick node1:/storage/bricks/1/brick 49152 0 Y 6450 Brick node2:/storage/bricks/2/brick 49152 0 Y 3460 ``` **Security** ````sh $ gluster volume set gfs auth.allow 10.0.0.2,10.0.0.3,10.0.0.4 ```` **Mount the GlusterFS Volume to the Host** ```sh echo 'localhost:/gv0 /mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' >> /etc/fstab $ mount.glusterfs localhost:/gv0 /mnt ``` **Check** ````sh $ df -h Filesystem Size Used Avail Use% Mounted on /dev/vda 18G 909M 17G 3% / /dev/vdb 47G 80M 47G 1% /storage/bricks/1 localhost:/gv0 47G 80M 47G 1% /mnt ```` **Configure for Suporte Docker** ```sh $ chown -R root:docker /mnt ```