GlusterFS installation and configuration – first steps


Hello guys, does someone wants to have a little cloud place between two or more computers? It can be done very successfully with GlusterFS. I will show you how to config it between two systems runs with Debian Squeeze.

So let’s begin.
First computer, will be server: IP:
Second one – to be client: IP:

First of all we have to add at both systems those lines in /etc/hosts:

cat > /etc/hosts   GlusterServer     GlusterServer   GlusterClient     GlusterClient

In that way we resolve the other system’s hostname.

When we are done with that we can proceed with installation of needed software:
For the Server Computer:

aptitude install glusterfs-server

Create some needed directories:

mkdir -p /glusterfs/export

Now we have to do configuration of server. File for that is : /etc/glusterfs/glusterfsd.vol , where we define which directory will be exported, and what client is allowed to connect.
It is strongly recommended always to make backup for files:

cp -p /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol-bkup

And now we can do changes:

cat > /etc/glusterfs/glusterfsd.vol

volume posix
type storage/posix
option directory /glusterfs/export # directory which will be exported

volume locks
type features/locks
option mandatory-locks on
subvolumes posix

volume brick
type performance/io-threads
option thread-count 8
subvolumes locks

volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow # Edit and add list of allowed clients comma separated IP addrs(names) here (e.g.,
subvolumes brick

It is possible to define allowed IPs with wildcards (192.168.1.*).
Now we need just to start glusterfs-server:

/etc/init.d/glusterfs-server start

So it is time to config and client system. We can start it with install the software that we need it:

aptitude install glusterfs-client

and create following directory:

mkdir -p /mnt/glusterfs/

Now we have to create file that it is needed for GlusterFS and add some configuration on it:

cat > /etc/glusterfs/glusterfs.vol

volume remote
type protocol/client
option transport-type tcp
option remote-host GlusterServer #can it be IP of server (
option remote-subvolume brick

volume writebehind
type performance/write-behind
option window-size 4MB
subvolumes remote

volume cache
type performance/io-cache
option cache-size 512MB
subvolumes writebehind

There is a two way to mount GlusterFS server:

glusterfs -f /etc/glusterfs/glusterfs.vol /mnt/glusterfs


mount -t glusterfs /etc/glusterfs/glusterfs.vol /mnt/glusterfs

And if everything it’s ok, you can see it with


should be appear bellow:

/etc/glusterfs/glusterfs.vol on /mnt/glusterfs type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)

The easiest way to mount it on boot is to add it at rc.local:

nano /etc/rc.local
glusterfs -f /etc/glusterfs/glusterfs.vol /mnt/glusterfs

Don’t forget, that it should be on top of “exit 0” in the file!

Alright, now we are ready 🙂 and we can test it with creating files on client:

touch /mnt/glusterfs/test01 /mnt/glusterfs/test02

and list it at server:

ls -lah /glusterfs/export/
root@GlusterServer:~# ls -lah /glusterfs/export/
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan 25 05:17 .
drwxr-xr-x 3 root root 4.0K Jan 25 05:15 ..
-rw-r--r-- 1 root root    0 Jan 25 05:17 test01
-rw-r--r-- 1 root root    0 Jan 25 05:17 test02

Or opposite: touch files at server, and accept them in client.
We can add more than one client system, so everyone will be able to write in following directory that we export.
Do not forget to add new client’s IP to the /etc/glusterfs/glusterfsd.vol file of the server, and /etc/hosts file too!

Have fun and hope this will be helpful.