Deploying a GlusterFS Cluster

In this tutorial, we are going to configure three Debian 8 servers as a GlusterFS cluster with replication such that we still have access to our data if any of the servers fail.

For this tutorial, as with most tutorials, I will be running commands as a non-root user with sudo privileges. I recommend that you do the same.


The first thing you should do is configure the DNS so that each host can be referred to by a name, such as gluster1-internal which will point to each nodes internal IP address (if there is one). We want to be using internal networking for GlusterFS to improve replication performance. If you don't have an internal DNS server (you can deploy one quickly with docker), then you can just edit the /etc/hosts file which will be tedious but worth it.

Install GlusterFS

On each of the nodes, execute:

sudo apt update
sudo apt install glusterfs-server -y

On Debian 8 this will install version 3.5.2 If you need to make use of heterogeneous bricks, then you need 3.6 or above. Click here to install 3.8 instead.

Start Peering

On one of your nodes, run the command below to peer with each of the other nodes.

sudo gluster peer probe [other node internal hostname]  

For me, I ran the command on so to peer with the other two nodes I ran:

sudo gluster peer probe
sudo gluster peer probe

You can now test that this worked by running the following command on any/each of the nodes:

sudo gluster peer status  

You should get output similar to below:

Number of Peers: 2

Uuid: e2cff423-8cca-4a09-9f77-ef2a9840c84e  
State: Peer in Cluster (Connected)

Uuid: 3660bcb2-dd84-42f0-886e-4f880d3a0d01  
State: Peer in Cluster (Connected)  

Create a Storage Volume

Now we are going to create our storage volume. You need to decide where all the data should go on each server. You can pick a path that is different on each, but I find it simpler to have the same path on each server and went with /gluster/volume1.

Run the following command on each of your servers (changing the path if you wish).

sudo mkdir -p $VOLUME_DIR_PATH

Now run the following script on just one of your servers (any of them). Change the settings as you wish.

# Settings

sudo gluster volume create \
transport tcp \

This should output something like:

volume create: volume1: success: please start the volume to access data  

Start the volume

Now we need to start the volume with the following command:

sudo gluster volume start volume1

This should output something like:

volume start: volume1: success  


You now have a GlusterFS cluster created. Now you probably want to actually use it. For this you will need to set up some GlusterFS clients which may or may not be the same servers in the cluster.




Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites. More info.