Setup GlusterFS

A step by step guide of how to set up GlusterFS on two servers (nodes)

Note

Do all the steps on every server you have.

Configure Hosts file

We use hosts to use names instead of IP addresses.

Edit the /etc/hosts with something like this:

/etc/hosts
10.0.15.10 gfs01
10.0.15.11 gfs02

Install GlusterFS

apt install glusterfs-server

Start the service and enable it.

service glusterd start
systemctl enable glusterd

service glusterd status

Make a partition

BUT create a xfs file system. And follow this setup for this file system.

Configure the firewall

The Gluster processes on the nodes need to be able to communicate with each other. To simplify this setup, configure the firewall on each node to accept all traffic from the other node.

We will add only the interface as well, where the Glusters communicate, the interface is wg0 for example.

Connect the peers

Check status:

Set up a GlusterFS volume

Create a directory gv0 on the partition created for GlusterFS.

Do this next two commands only on one node.

If you only using 2 nodes make sure of the split brain problem

Start the volume

You can check if it's working on both nodes with the command:

Mounting the GlusterFS Volume

If you want to use the GlusterFS volume, mount the volume to any client.

List of sources

Last updated

Was this helpful?