Home CentMinMod GlusterFS Replication on CentOS 7

GlusterFS Replication on CentOS 7

GlusterFS is a scalable network filesystem suitable for data-intensive tasks such as cloud storage and media streaming. GlusterFS is free and open source software and can utilize common off-the-shelf hardware.

Prerequisite

We will take 3 centminmod servers

server1.domain.com (Centminmod Installed)
server2.domain.com (Centminmod Installed)
server3.domain.com (Centminmod Installed)

How to Install

First open ports 111,24007,38465:38469,49152 in your firewall.

Now on all 3 Servers server1.domain.com, server2.domain.com, server3.domain.com install GlusterFS

yum -y install centos-release-gluster
yum -y install glusterfs-server --disableplugin=priorities

Start and enable GlusterFS

systemctl enable glusterd.service
systemctl start glusterd.service
glusterfsd --version

Now on server1.domain.com initiate peer

gluster peer probe server2.domain.com
gluster peer probe server3.domain.com

Get Gluster peer status

gluster peer status

Now create a gluster volume named bullten for data replication between 3 server with the path /srv/data. The should only be ran on server1.domain.com. You can change bullten to something else.

gluster volume create bullten replica 3 transport tcp mail.bullten.work:/srv/data mail1.bullten.work:/srv/data mail2.bullten.work:/srv/data force

Now start the volume

 gluster volume start bullten

to check gluster volume status

gluster volume status bullten

To get the detailed information of a volume

gluster volume info

If you want to stop or delete a volume you can use

gluster volume stop bullten

gluster volume delete bullten

Now on all three server server1.domain.com, server2.domain.com, server3.domain.com create a mount point directory

mkdir -p /var/www/html

For each server enter the below data in /etc/fstab to mount volume to a directory

For server1.domain.com

server1.domain.com:/bullten /var/www/html glusterfs defaults,_netdev,log-level=WARNING,log-file=/var/log/gluster.log 0 0

For server2.domain.com

server2.domain.com:/bullten /var/www/html glusterfs defaults,_netdev,log-level=WARNING,log-file=/var/log/gluster.log 0 0

For server3.domain.com

server3.domain.com:/bullten /var/www/html glusterfs defaults,_netdev,log-level=WARNING,log-file=/var/log/gluster.log 0 0

Now run mount -a on all three servers server1.domain.com, server2.domain.com, server3.domain.com

mount -a

Now add any file in /var/www/html on any one of the server it will be visible on all 3 server.

Must Read

Routing Domain Name in Haproxy

I hope you are following the below guide. Now suppose you want to route domain name to open specific backend that have...

Enable Logging in Haproxy

HAProxy can emit log message for processing by a syslog server. This is compatible with familiar syslog tools like Rsyslog, as well...

Getting real IP in Nginx when behind cloudflare Haproxy

Create a file named cloudflare_ips.ls and in that add all the cloudflare IP's vi /etc/haproxy/cloudflare_ips.ls 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 198.41.128.0/17 162.158.0.0/15 104.16.0.0/12 172.64.0.0/13 131.0.72.0/22 2400:cb00::/32 2606:4700::/32 2803:f800::/32 2405:b500::/32 2405:8100::/32 2a06:98c0::/29 2c0f:f248::/32

Getting Real IP in HaproxyNginx configuration

Well its a little configuration can get real to nginx when haproxy is set as reverse proxy. Follow this...

Haproxy as Single Point to Failure Node With Glusterfs and MariaDB Maxscale Cluster

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It...