He Gluster File System, Gluster File System either GlusterFS, is a multiscalable file system for NAS initially developed by Gluster Inc. This allows you to add multiple file servers on ethernet or interconnections Infiniband RDMA in a large parallel network file environment. The design of GlusterFS is based on the use of user space and this way it does not compromise performance. They can be found being used in a wide variety of environments and applications such as cloud computing, biomedical sciences and file storage. GlusterFS is licensed under the license GNU General Public License version 3.
To set up highly available distributed storage using GlusterFS we need a minimum of four servers.
IP Addressing:
serverGlusterFS01: IP 192.168.1.200
serverGlusterFS02: IP 192.168.1.201
serverGlusterFS03: IP 192.168.1.202
serverGlusterFS04: IP 192.168.1.203It is necessary that the servers be able to resolve the names, for this we add it to our DNS server, if we do not have a DNS server we will add it to the file /etc/hosts.
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 serverglusterfs01.redorbita.com serverglusterfs01
192.168.1.200 serverglusterfs01.redorbita.com serverglusterfs01
192.168.1.201 serverglusterfs02.redorbita.com serverglusterfs02
192.168.1.202 serverglusterfs03.redorbita.com serverglusterfs03
192.168.1.203 serverglusterfs04.redorbita.com serverglusterfs04We install the necessary packages
apt-get install glusterfs-serverWe add the servers serverglusterfs02, serverglusterfs03 and serverglusterfs04 to the trusted repository
gluster peer probe serverglusterfs02
gluster peer probe serverglusterfs03
gluster peer probe serverglusterfs04We check the status of the repository
gluster peer status
Number of Peers: 3
Hostname: serverglusterfs02
Uuid: fb033ef6-45e6-4c9e-96e9-6d8feff32e9e
State: Peer in Cluster (Connected)
Hostname: serverglusterfs03
Uuid: 4b7c555b-deae-4a45-9d18-76029e239ca3
State: Peer in Cluster (Connected)
Hostname: serverglusterfs04
Uuid: 4076610d-4a26-49f3-bbe0-63e044d777c7
State: Peer in Cluster (Connected)Next we create a volume and share it on all four nodes
gluster volume create voldata transport tcp serverglusterfs01:/data/app serverglusterfs02:/data/app serverglusterfs03:/data/app serverglusterfs04:/data/appWe start the created volume
gluster volume start voldataConfigure the client:
We install the glusterfs client
apt-get install glusterfs-clientWe set the volume
mount.glusterfs serverglusterfs01:/voldata /mnt/Once mounted we check that it replicates correctly, to do this we access /mnt and create some files.
cd /mnt
touch prueba1 prueba2 prueba3 prueba4 prueba5Now we must connect to the servers and check if the replication is performed correctly:
serverglusterfs01
root@serverglusterfs01:/data/app# ls -lsrth
total 0
0 -rwxrwxr-x 2 root root 0 nov 9 18:34 prueba3
0 -rwxrwxr-x 2 root root 0 nov 9 18:34 prueba4serverglusterfs02
root@serverglusterfs02:/data/app# ls -lsrth
total 0
0 -rwxrwxr-x 2 root root 0 nov 9 18:34 prueba1
0 -rwxrwxr-x 2 root root 0 nov 9 18:34 prueba5serverglusterfs03
root@serverglusterfs03:/data/app# ls -lsrth
total 0serverglusterfs04
root@serverglusterfs04:/data/app# ls -lsrth
total 0
0 -rwxrwxr-x 2 root root 0 nov 9 18:34 prueba2All the best.
Comments