Install and run GlusterFS v1.3 in 10mins

From GlusterDocumentation

Jump to: navigation, search

NOTE: Any new users trying out GlusterFS newly, its advised to get these barebone configurations working properly before configuring GlusterFS for higher performance.

Contents

Requirements

NOTE: If you are starting this instruction manual with the timer clock on, I would recommend the following packages to be already installed in your system.

  • 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 (Optional Step But Recommended)

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.
  • It has inode management improvements.

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.

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: 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

On redhat systems (RHEL and CentOS)

$ rpmbuild -ta fuse-2.7.2glfs9.tar.gz
$ rpm -Uvh /usr/src/redhat/RPMS/$(uname -m)/fuse-*rpm
$ rmmod fuse
$ depmod -a
$ modprobe fuse

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.8.tar.gz
$ cd glusterfs-1.3.8
$ ./configure  --prefix= 
$ make install 

On redhat systems (RHEL and CentOS)

$ rpmbuild -ta glusterfs-1.3.8.tar.gz
$ rpm -Uvh /usr/src/redhat/RPMS/$(uname -m)/glusterfs-*rpm

If the directory /etc/glusterfs/ does not already exist then create it now.

$ mkdir /etc/glusterfs

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

Where to go from here

You can now refer to many other detailed volume spec file examples on the different ways that you can configure your GlusterFS cluster.

Refer to GlusterFS Command-line Arguments for a complete list of options.

Refer to Mounting a GlusterFS Volume to see various ways of mounting a volume.

Something isnt working right

GlusterFS Troubleshooting Guide

GlusterFS FAQs

GlusterFS Volume Spec File Examples

When I run the glusterfs command, it exited normally, but I don't see the process running

There is more than one possible reason for what went wrong. Please refer to the glusterfs log file at /var/log/glusterfs/glusterfs*.log.

If you specified a prefix during installation, the log file may not be in /var/log/glusterfs/. Instead try looking in the prefix path you specified during installation for the log files. Otherwise, you can choose to run the glusterfs command with -l /dev/stdout to get the logs to display on screen when you run the command. Hope that was helpful.

Refer

For more extensive documentation/details refer GlusterFS wiki.

Personal tools