Install GlusterFS

How to install and setup GlusterFS on Debian Wheezy

Setup a firewall so that all servers can communicate with each other over a secure VPN.

Add the gpg key for the GlusterFS repository:

wget -O - http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.1/Debian/gpg.key | apt-key add -

Add the repositoriy to your system by adding this line:

deb http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.1/Debian/wheezy.repo wheezy main

Now we can install the GlusterFS server:

apt-get update
apt-get install glusterfs-server

Configure to use the appropriate IP address in /etc/glusterfs/glusterd.vol:

volume management
    type mgmt/glusterd
    option working-directory /etc/glusterd
    option transport-type socket
    option transport.socket.keepalive-time 10
    option transport.socket.keepalive-interval 2
    option transport.rdma.bind-address 10.0.0.1
    option transport.socket.bind-address 10.0.0.1
    option transport.tcp.bind-address 10.0.0.1
end-volume

Restart the service:

/etc/init.d/glusterfs-server restart

Take a look at the current cluster:

gluster --remote-host=10.0.0.1 peer status

There are not peers present yet, so let’s add one:

gluster --remote-host=10.0.0.1 peer probe
gluster --remote-host=10.0.0.1 peer status

Here are some more peers:

Number of Peers: 2

Hostname: 10.0.0.2
Uuid: ffeaccb6-00ad-488c-9f53-7b215a059d81
State: Peer in Cluster (Connected)

Hostname: 10.0.0.3
Uuid: 46b50830-03b9-4040-934a-a9da78708543
State: Peer in Cluster (Connected)

Ready to mount the file system:

mount -t glusterfs 10.0.0.1:/vol /mnt/vol

Take a look at the status:

gluster --remote-host=10.0.0.1 volume info
gluster --remote-host=10.0.0.1 peer status