Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

High Availability Distributed Storage Server with GlusterFS

Leer en espanol
High Availability Distributed Storage Server with GlusterFS

Table of contents

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:

text
serverGlusterFS01: IP 192.168.1.200

serverGlusterFS02: IP 192.168.1.201

serverGlusterFS03: IP 192.168.1.202

serverGlusterFS04: IP 192.168.1.203

It 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.

Bash
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     serverglusterfs04

We install the necessary packages

Bash
apt-get install glusterfs-server

We add the servers serverglusterfs02, serverglusterfs03 and serverglusterfs04 to the trusted repository

text
gluster peer probe     serverglusterfs02

gluster peer probe     serverglusterfs03

gluster peer probe     serverglusterfs04

We check the status of the repository

text
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

text
gluster volume create voldata transport tcp serverglusterfs01:/data/app serverglusterfs02:/data/app serverglusterfs03:/data/app serverglusterfs04:/data/app

We start the created volume

text
gluster volume start voldata

Configure the client:

We install the glusterfs client

Bash
apt-get install glusterfs-client

We set the volume

text
mount.glusterfs serverglusterfs01:/voldata /mnt/

Once mounted we check that it replicates correctly, to do this we access /mnt and create some files.

text
cd /mnt
touch prueba1 prueba2 prueba3 prueba4 prueba5

Now we must connect to the servers and check if the replication is performed correctly:

serverglusterfs01

Bash
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 prueba4

serverglusterfs02

Bash
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 prueba5

serverglusterfs03

Bash
root@serverglusterfs03:/data/app# ls -lsrth

total 0

serverglusterfs04

Bash
root@serverglusterfs04:/data/app# ls -lsrth

total 0

0 -rwxrwxr-x 2 root root 0 nov  9 18:34 prueba2

All the best.

Comments