Setting up a GlusterFS Client

In our previous tutorial, we deployed a GlusterFS cluster. This tutorial will extend that by showing you how to mount your GlusterFS volume on a server for storing files.

This tutorial was created using a Debian 8 server, but the steps should also work on Ubuntu without any changes.


Install the client packages:

sudo apt install glusterfs-client

Now create a directory for mounting the GlusterFS volume.

mkdir -p $MOUNT_PATH

Now mount the volume on the mount point we just created.


sudo mount -t glusterfs \

# Give ourselves permission to create files in there.
sudo chown $USER:$USER $MOUNT_PATH

You can specify any of the hosts in your Gluster cluster for the GLUSTER_HOST, but it needs to be a hostname this server can access (which may not necessarily be any of the hostnames we used when setting up the cluster with internal networking).

You have now mounted the GlusterFS volume locally. If you use a tool like pydf you will see something like below:

Filesystem                       Size  Used Avail Use%                         Mounted on  
/dev/sda1                         19G 1375M   16G  7.2 [##...................] /                  19G 1375M   16G  7.2 [##...................] /home/stuart/gluster-mount  

If you are not using the same servers as in the cluster as the client, then writing files to this area will not cost you anything in local storage. Best of all, you can mount the same volume on different servers simultaneously, which can be useful for automatic failover etc.




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

comments powered by Disqus