Jan 31, 2014

How to install GlusterFS 3.4.x server and client on Debian Wheezy 7.3

1. Install glusterFS 3.4.x

Add the GPG key to apt
wget -O - http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.2/Debian/pubkey.gpg | apt-key add - Add the source and update package list
echo deb http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.2/Debian/apt wheezy main > /etc/apt/sources.list.d/gluster.list

apt-get update
Install gluster server and client apt-get install glusterfs-server glusterfs-client Ref: http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.2/Debian/README

2. Dealing with mounting issue at boot time

With GlusterFS 3.4.2, we may get in trouble trying to mount the gluster volume via /etc/fstab
<server-ip>:/gluster_volume /var/mount glusterfs defaults,_netdev 0 0 This may not mount the volume as we expect in previous version of glusterFS. Therefore, we have to use a script to mount our glusterFS volume at boot time.

Create a script to mount our volume
cd /etc/init.d
nano /etc/init.d/mount-glusterfs
Paste below lines to the file, then save it
### BEGIN INIT INFO
# Provides:          mount-glusterfs
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

#! /bin/sh
# /etc/init.d/mount-glusterfs
#

# Some things that run always at boot
mount -t glusterfs <server-ip>:/gluster_volume /var/mount

# Uncomment this line if you need to start Apache after mount glusterFS volume
# service apache2 start

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    echo "Mounting glusterfs volumes "
    mount -t glusterfs <server-ip>:/gluster_volume /var/mount
    ;;
  stop)
    echo "Unmount glusterfs volumes"
    umount /var/mount
    ;;
  *)
    echo "Usage: /etc/init.d/mount-glusterfs {start|stop}"
    exit 1
    ;;
esac

exit 0

Just remember to edit <server-ip>, /gluster_volume, and /var/mount to match our configuration.
Make the script executable
chmod +x /etc/init.d/mount-glusterfs Enable the script at boot time
update-rc.d mount-glusterfs defaults Reboot server
reboot Check if the glusterFS volume has been mounted with
df -h or
mount

No comments:

Post a Comment