Install GlusterFS from Source
From GlusterDocumentation
Contents |
Requirements
- autotools (if you are compiling from tla)
- libtool
- gcc
- flex
- bison
- byacc
- kernerl-source for the $(uname -r) kernel (That means the currently running kernel, this is required if you need to compile fuse, otherwise, we don't need it).
Download
Get GlusterFS
Download GlusterFS from the following links
Or download via tla
$ tla register-archive http://arch.savannah.gnu.org/archives/gluster/ $ tla get -A gluster@sv.gnu.org glusterfs--mainline--2.5 glusterfs
Get Patched Fuse (Completely Optional Step)
Download patched fuse from the following links
The patched version of fuse is well suited for use with GlusterFS, as:
- It supports higher IO buffer size, which gives increased IO performance.
- It provides flock() syscall, which provides you with advisory locks functionality. This is not present in regular fuse tarball.
- Supports O_DIRECT flag handling in open() calls
Please note that if you intend to use the patched fuse module that you *MUST* make sure your kernel does not have one compiled in as this will override the loading of the updated module.
NOTE: Any new kernel (>2.6.25), please use custom fuse only.
Install
NOTE: You need to be logged in as 'root' to run the following commands.
FUSE
This section describes the installation procedure for 'fuse' from source tarball.
On the client machine, install the fuse package. (Make sure that '--prefix' option is set to the earlier fuse installation path).
- NOTE: To compile fuse's kernel module you need to have the kernel source for your already running kernel.
- NOTE: For kernel version greater than or equal to 2.6.25, the fuse kernel module won't compile. You need to use the module comes with kernel.
- NOTE: It is advised to use kernel module and libfuse both from single fuse package. Otherwise, you may get some problems. (Not verified, but a better practice).
$ tar -xzf fuse-2.7.2glfs9.tar.gz $ cd fuse-2.7.2glfs9 $ ./configure --prefix=/usr --enable-kernel-module $ make install $ ldconfig $ depmod -a $ rmmod fuse $ modprobe fuse $ echo modprobe fuse >> /etc/rc.modules $ chmod +x /etc/rc.modules
GlusterFS works with fuse version 2.6.0 and above. But with custom fuse versions, there are some issues seen (Input/Output Errors). Hence it is better to use glusterfs patched fuse or FUSE version >= 2.7.2
GlusterFS
Now, untar and install the glusterfs package.
$ tar -xzf glusterfs-1.3.10.tar.gz $ cd glusterfs-1.3.10 $ ./configure $ make # sudo make install
Congratulations :) You are done with 'glusterfs' installation.
Execution
After installation is complete, the problem that the majority of people are faced with is how to get glusterfs working. To run GlusterFS, you need a volume specification file, or spec file, which defines the behavior and features for glusterfs.
We will start with a barebones spec file (this spec file is very basic and it is just to get the feel of GlusterFS).
NOTE: On many systems, modifying (or turning off) iptables may be required to get GlusterFS working.
$ glusterfs --help
Example
In this basic example, let us assume you have two machines, '192.168.0.1' and '192.168.0.2'. Let 192.168.0.1 be the server and 192.168.2 be the client.
NOTE: you must change the IP address in the spec file according to your network configuration or else to test, you can use the system's localhost IP address (i.e. 127.0.0.1)
Server machine: [192.168.0.1]
NOTE: After editing the file it should have the content as shown by the cat command, and this holds true for all the given examples below.
$ emacs /etc/glusterfs/glusterfs-server.vol $ cat /etc/glusterfs/glusterfs-server.vol volume brick type storage/posix option directory /tmp/export end-volume volume server type protocol/server subvolumes brick option transport-type tcp/server # For TCP/IP transport option auth.ip.brick.allow * end-volume $ glusterfsd -f /etc/glusterfs/glusterfs-server.vol
Client machine: [192.168.0.2]
$ mkdir /mnt/glusterfs $ emacs /etc/glusterfs/glusterfs-client.vol $ cat /etc/glusterfs/glusterfs-client.vol volume client type protocol/client option transport-type tcp/client option remote-host 192.168.0.1 option remote-subvolume brick end-volume $ glusterfs -f /etc/glusterfs/glusterfs-client.vol /mnt/glusterfs
You should now be able to see the exported directory '192.168.0.1:/tmp/export' as /mnt/glusterfs on the client machine :O
Something isnt working right
GlusterFS Troubleshooting Guide
GlusterFS Volume Spec File Examples
Refer
For more extensive documentation/details refer GlusterFS wiki.

