Client Installation and Configuration

From GlusterDocumentation

Contents

Comparing Your GlusterFS Client Options

This section describes how to install and configure different versions of the GlusterFS client software on your client operating system.

Native methods

  • FUSE-based Client - This is the standard mode of using GlusterFS. GlusterFS has its own native client, which mounts the volumes on the client machines using the FUSE interface. GlusterFS works and performs best when used this way. The FUSE-based mountpoint is POSIX conformant.
  • Booster - This is a user space client that is available as a shared object. Booster is preloaded into the applications address space (with the libc preload mechanisms like LD_PRELOAD environment variable or by listing the library path in /etc/ld.so.preload). This client does not use FUSE support so it can be used on operating systems that do not support it. Note: This method of accessing GlusterFS does not completely conform to POSIX standards.

Protocols

  • NFS - GlusterFS can be re-exported via NFS. This is the recommended protocol for accessing the volumes in a POSIX conformant manner from clients where FUSE/booster-based clients are not an option. Currently, GlusterFS has a custom modified unfs3 for providing NFSv3 support. NFSv4 support is planned in the future.
  • CIFS - For Microsoft Windows clients, the recommended method of accessing volumes is by re-exporting FUSE mountpoints via Samba from a gateway machine. The server machines can be reused for re-exporting.
  • DAV - Volumes can also be accessed via WebDAV by configuring and running Apache with GlusterFS. Though configuring Apache to export FUSE mountpoints as DAV folders works well, loading booster under Apache improves performance.

Note: Some versions of the client are included in the server installation. These clients require additional configuration.

For server installation, see Installing GlusterFS on the Server.

FUSE-based Client

The client has not been tested on Solaris due to lack of FUSE support.

Due to the 32-bit inode limitations of FreeBSD, the FreeBSD version of GlusterFS doesn't function. This problem will be addressed in later releases of GlusterFS.

Before Installing the FUSE-based Client

Before mounting GlusterFS on the client, make sure that libfuse (2.6.5 or higher) is installed and the FUSE kernel module is loaded. GlusterFS requires FUSE on the client side.


To download GlusterFS, go to:

Select the package or tarball for your operating system.

Installing the Client

Installing on GNU/Linux

Depending on your Linux distribution, use one of the following methods.

Red Hat Package Manager (RPM)-based Distributions

To install the GlusterFS package on Fedora, OpenSUSE, Red Hat, or CentOS Linux distributions, run the following commands:

bash# rpm -ivh glusterfs-*-version.rpm
bash# glusterfs --version

The build version information displays, for example:

glusterfs 2.0.7 built on Oct 10 2009 12:22:40
Repository revision: 9ec22fd9fc28684b7e2093b4c67d449c7f021623
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>

If the glusterfs-server-version.rpm file is not available, you can build it on Red Hat Linux by entering the following command:

bash# rpmbuild -ta glusterfs-version.tar.gz

Debian-based Distributions

You can get GlusterFS from www.debian.org in the testing and unstable repositories. Currently, there are few contributors maintaining the GlusterFS Debian package. (You can get the latest package by installing from source.)

bash# apt-get install <glusterfs-*>
bash# glusterfs --version

The build information is displayed, for example:

glusterfs 2.0.7 built on Oct 10 2009 12:22:40
Repository revision: 9ec22fd9fc28684b7e2093b4c67d449c7f021623
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>

Source Installation

You can get the source tarball from the ftp repository of the project. To install the tar file from source, enter the following commands:

bash# tar -xzf glusterfs-version.tar.gz
bash# cd glusterfs-version
bash# ./configure --prefix= > /dev/null
GlusterFS configure summary
===========================
FUSE client        : yes
Infiniband verbs   : yes
epoll IO multiplex : yes
Berkeley-DB        : yes
libglusterfsclient : yes
argp-standalone    : no

bash# make && make install
bash# ldconfig
bash# glusterfs --version

The build information is displayed, for example:

glusterfs 2.0.7 built on Oct 10 2009 12:22:40
Repository revision: 9ec22fd9fc28684b7e2093b4c67d449c7f021623
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>

Mac OS X Installation

Mac OS X users can build from the source tarball without problems, or install the .dmg images available from the GlusterFS ftp site. After downloading, click the .dmg image to get a GlusterFS package.

  • If you are installing the package locally, click to install.
  • If you are installing on a remote machine from a terminal, enter the following commands:
bash# hdiutil attach glusterfs-version.dmg
bash# installer -pkg /Volumes/glusterfs-version/glusterfs-version.pkg -target /
bash# hdiutil detach /Volumes/glusterfs-version/
bash# glusterfs --version

If successful, the build's version information is displayed, for example:

glusterfs 2.0.7 built on Oct 10 2009 12:22:40
Repository revision: 9ec22fd9fc28684b7e2093b4c67d449c7f021623
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>

Note: For complete installation steps for your version of Mac OS X, read the README.MacOS file available with the .dmg image.

Mounting a Volume

After completing the native installation of GlusterFS on the client, you are ready to mount the volume. There are two methods:

  • Manually Mounting a Volume
  • Automounting

Manually Mounting a Volume

To mount using a server supplied client volume file, enter the following command:

bash# mount -t glusterfs  server_IP /mnt/glusterfs

To mount using a local client supplied volume file, enter the following command:

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

To automatically mount on every boot, add a line to the /etc/fstab file.

For a server supplied client volume file, add the following line:

server_IP  /mnt/glusterfs  glusterfs  defaults,_netdev  0  0

For a local client volume file, add the following line:

/etc/glusterfs/glusterfs.vol  /mnt/glusterfs  glusterfs  defaults,_netdev  0  0
Mounting Options

The following options are valid with -t glusterfs. All options have to be a comma separated values with the mount command or in the /etc/fstab file.

  • log-level=loglevel
  • log-file=logfile
  • transport=transport-type
  • direct-io-mode=[enable|disable]
  • volume-name=volume_name
  • volume-id=volume-ID

If the server's listening port is different than default, enter it similarly to the following example, substituting your port number for 7997:

bash# mount -t glusterfs  192.168.0.1:7997 /mnt/glusterfs

If you are adding the listening port to the /etc/fstab file, see the following example:

server_IP:port  /mnt/glusterfs  glusterfs  defaults,_netdev  0  0

Automounting a Volume

The automount functionality can be used with GlusterFS with the same ease as NFS is used with autofs.

Ensure that you have a system ready with the following:

  • Kernel automounter version 4 support (also supports v3)
  • The autofs user space programs

Also, verify that you can mount manually.

Modify the /etc/autofs/auto.master master configuration file. This file lists one or more directories to control. (It automatically creates and removes directories as you access them.) The autofs daemon controls this directory, which is the mountpoint. Therefore, do not use the mount command to explicitly mount file systems to this directory.

Each line in the master configuration file gives autofs a mountpoint, and the name of another configuration file that contains the file systems to auto-mount there. You can add any number of mount points as you want.

Note: All configuration files must have a new line at the end.


# mount point   config file              options
#/misc          /etc/autofs/auto.misc
#/home          /etc/autofs/auto.home
/export         /etc/autofs/auto.gfs1    --timeout=5 --ghost
/storage        /etc/autofs/auto.gfs2    --timeout=60
  • The --timeout option in auto.master tells the automounter to unmount the file systems after (in this case) 5 and 60 seconds of inactivity.
  • The --ghost option tells the automounter to create "ghost" versions (that is, empty directories) of all the mount points listed in the configuration file (in this case /etc/autofs/auto.gfs1), regardless of whether any of the file systems is actually mounted or not. This method shows the available auto-mountable file systems as existing directories, even when their file systems aren't currently mounted. Without the --ghost option, you have to remember the names of the directories. When you try to access one of them, the directory is created and the file system is mounted. When you unmount the file system again, the directory is destroyed, too, unless you use --ghost.
File: /etc/autofs/auto.gfs1
mysql       -fstype=glusterfs            :/etc/glusterfs/glusterfs-client.vol
apps        -fstype=glusterfs            :grid1.hostname.com

File: /etc/autofs/auto.gfs2
gluster     -fstype=glusterfs            :glusterfs.gluster.com
users       -fstype=glusterfs            :/usr/etc/glusterfs/custom-client.vol

As in the previous example configuration files, you can provide two types of options:

  1. Passing client spec file residing on the client itself.
  2. Passing server information through which client spec file will be fetched from server itself.

Now after adding the following lines, we are good to go with autofs startup.

Create the directory named in master configuration files on the client node.

bash-3.02# mkdir -p {/storage,/export}

Start the autofs daemon by issuing following command under Red Hat Enterprise Linux:

 bash-3.02# /etc/init.d/autofs start

If you want to have this behavior on startup, issue:

 bash-3.02# chkconfig --level 35 autofs on 
Testing

After successfully finishing the autofs start, confirm that the GlusterFS directories are mounting successfully:

 bash-3.02# cd /export/gluster
 bash-3.02# grep glusterfs /proc/mounts
 glusterfs /export/gluster fuse    \
    rw,nosuid,nodev,user_id=0,group_id=0, \
        default_permissions,allow_other,max_read=1048576 0 0

Looks like you have successfully mounted the GlusterFS through autofs.

NFS Client

Minimum Requirements

Mounting a unfs3booster-based NFS server exporting a GlusterFS volume requires that both GlusterFS server and the unfs3booster configuration are already running, according to the instructions provided in Storage_Server_Installation_and_Configuration.

Configuring

Before configuring the NFS client, add unfs3 support to the server. You don't need to install an NFS client; the software is included in every operating system by default.

Mount the GlusterFS volume through NFS on a client machine as in the following example. nfsserver is the machine on which the unfs3booster program is running.

$ mount nfsserver:/testpath/ -o wsize=65536,rsize=65536 /mnt

CIFS Client

The CIFS export of GlusterFS can be accessed by the following clients:

  • Microsoft Windows clients
  • GNU/Linux clients
  • Mac OS clients

Configuring Samba Clients

The configuration is similar to accessing any other standard Samba exports. They can be accessed by the smbclient tool like:

sh# smbclient //SERVER/volume -U user1

Or, if the kernel supports CIFS mounts, can be mounted like:

sh# mount -t cifs -o username=user1 //SERVER/volume /mnt/data

Configuring Microsoft Windows Clients

Refer to the standard documentation available with the operating system for accessing network shares from Microsoft.

Configuring Mac OS Clients

Refer to the standard documentation available with the operating system for accessing network shares from Apple.

 

Copyright © 2009 Gluster, Inc. All Rights Reserved.