How to Install GlusterFS on Ubuntu

A Guide on Installing GlusterFS to to Create a Storage Cluster

The Armchair Geek
GlusterFS is a clustered file-system that is capable of scaling several petabytes. The program combines several storage bricks and interconnects them into one large parallel network file system. These storage bricks can be made of any commodity hardware. This tutorial will show you how to install GlusterFS to create a storage cluster with 2 servers on Ubuntu 8.04.

Step #1
You will need to install some software before being able to use GlusterFS. Open the Terminal by clicking the Applications button located at the top of the screen. After that, click Accessories and then Terminal in the dropdown menu that appears. Enter the following command in the terminal to install software:

sudo su
apt-get install sshfs build-essential flex bison byacc vim wget

Step #2
Now you need to install fuse from the source by entering the following command:

cd /root/
wget http://europe.gluster.org/glusterfs/fuse/fuse-2.7.4glfs11.tar.gz
tar -zxvf fuse-2.7.4glfs11.tar.gz
cd /root/fuse-2.7.4glfs11

After that, you will need to compile fuse by entering the following command into the terminal:

./configure
make && make install

Step #3

You are now ready to install GlusterFS. To do this, enter the following command into the terminal:

cd /root/
wget http://ftp.gluster.com/pub/gluster/glusterfs/2.0/LATEST/glusterfs-2.0.0rc2.tar.gz
tar -zxvf glusterfs-2.0.0rc2.tar.gz
cd /root/glusterfs-2.0.0rc2/

To compile the files, enter the following command:

./configure
make && make install

Step #4

After doing that, enter the following command into the terminal:
cp /usr/local/lib/* -R /usr/lib/

Enter the following command to create folders that will be used later:

mkdir /mnt/glusterfs
mkdir /data/
mkdir /data/export
mkdir /data/export-ns
mkdir /etc/glusterfs/

Step #5
Now you need to configure the servers for GlusterFS. Enter the following command:
vi /etc/glusterfs/glusterfs-server.vol

Step #6
Modify the file to look like this:

# file: /etc/glusterfs/glusterfs-server.vol
volume posix
type storage/posix
option directory /data/export
end-volume

volume locks
type features/locks
subvolumes posix
end-volume

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

volume posix-ns
type storage/posix
option directory /data/export-ns
end-volume

volume locks-ns
type features/locks
subvolumes posix-ns
end-volume

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

volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow *
option auth.addr.brick-ns.allow *
subvolumes brick brick-ns
end-volume

Step #7
Enter the following command to start the server:
glusterfsd -f /etc/glusterfs/glusterfs-server.vol

Step #8
To edit the client, enter the following command into the terminal:
vi /etc/glusterfs/glusterfs-client.vol

Step #9
Modify the file to look like this:

### Add client feature and attach to remote subvolume of server1
volume brick1
type protocol/client
option transport-type tcp/client
option remote-host 192.168.0.1 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume

### Add client feature and attach to remote subvolume of server2
volume brick2
type protocol/client
option transport-type tcp/client
option remote-host 192.168.0.2 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume

### The file index on server1
volume brick1-ns
type protocol/client
option transport-type tcp/client
option remote-host 192.168.0.1 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume

### The file index on server2
volume brick2-ns
type protocol/client
option transport-type tcp/client
option remote-host 192.168.0.2 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume

#The replicated volume with data
volume afr1
type cluster/afr
subvolumes brick1 brick2
end-volume

#The replicated volume with indexes
volume afr-ns
type cluster/afr
subvolumes brick1-ns brick2-ns
end-volume

#The unification of all afr volumes (used for > 2 servers)
volume unify
type cluster/unify
option scheduler rr # round robin
option namespace afr-ns
subvolumes afr1
end-volume

Step #10
You can now mount GlusterFS on all servers in the cluster by entering the following command:
glusterfs -f /etc/glusterfs/glusterfs-client.vol /mnt/glusterfs

Published by The Armchair Geek

We are a Mid-West PLR Firm specializing in creating powerful web content for clients in a wide array of industries. This is a sampling of some of our IT-focused articles. For more of our work, you can co...  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.