enira.net

We are all living in a technological wasteland.

RSS
people

Slitaz project – Part 3 – Samba client mounting GlusterFS (GlusterFS)

–This article continues from the base.7z made in ‘Slitaz project – Part 1 – Building a base system‘.

Before I like to build the webservers, I like to take some time to build a GlusterFS client and Samba server. This machine is optional but it is a great practise creating a simple glusterfs and show a lot about the client. It’s also fun to test your nodes with.

This machine i’ll call ‘glusterclient’ and I will use the ip 192.168.1 229. Just copy another base machine and change the ip/hostname:

/home/base/ip.sh glusterclient 192.168.1 229 1

As installing GlusterFS is explained in part two, I won’t go over all the details. I’ll just give you the commands:

tazpkg get-install flex 
tazpkg get-install python
tazpkg get-install readline-dev
tazpkg get-install mpc-library
tazpkg get-install elfutils
tazpkg get-install openssl-dev
tazpkg get-install slitaz-toolchain
 
tazpkg clean-cache
 
cd /home/base
wget http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.0/glusterfs-3.3.0.tar.gz
tar xzvf /home/base/glusterfs-3.3.0.tar.gz
cd /home/base/glusterfs-3.3.0
 
./configure
make
make install
 
cd /
rm -rf /home/base/glusterfs-3.3.0
rm /home/base/glusterfs-3.3.0.tar.gz

So once GlusterFS is installed, we make a mount point for the partition:

mkdir /mnt/glusterfs

For some strange reason using the command ‘mount -t glusterfs 192.168.1.221:/slitaz-volume /mnt/glusterfs’ doesn’t works. Also adding the mount point to /etc/fstab seems not to function at all.
The only workaround I have found thus far is adding a call to the glusterfs executable to the startup in ‘local.sh’. (If somebody knows a way to make fstab work: comment or contact me!)

nano /etc/init.d/local.sh

And add these lines at the bottom of the file:

echo "Starting network storage... "
/usr/local/sbin/glusterfs -s 192.168.1.221 --volfile-id slitaz-volume /mnt/glusterfs

When we reboot we should find our glusterfs file system mounted.

root@glusterclient:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               494.8M    264.6M    204.7M  56% /
tmpfs                    28.6M         0     28.6M   0% /dev/shm
192.168.1.221:slitaz-volume
                         31.5G     72.0M     29.8G   0% /mnt/glusterfs

You can also see that the ‘df -h’ command produces a line break after the mounted GlusterFS volume name. This is why I changed the ‘class.parseProgs.inc.php’ file. It would generate errors at http://192.168.1.229:81/

Now let’s continue and install samba. (Samba seems to need cups to work.)

tazpkg get-install cups
tazpkg get-install samba
 
tazpkg clean-cache

For Samba I always like to create different users. (Just a security habit I guess…)

addgroup smb
adduser -G smb smb #and put a smb password
smbpasswd -a smb #and put a smb password

samba comes with a preloaded config file but I prefer to use mine, just replace all.

nano /etc/samba/smb.conf
[global]
workgroup = SLITAZ
security = USER
 
[glusterfs]
comment = GlusterFS
valid users = smb
read only = No
browseable = Yes
path = /mnt/glusterfs

Last step is adding it to the deamons to start.

nano /etc/rcS.conf
RUN_DAEMONS="dbus hald slim firewall dropbear lighttpd samba"

Once you reboot you just need to set the file permissions:

chmod 777 -R /mnt/glusterfs

After this you can go to your samba share at \\192.168.1.229\glusterfs (and login using smb account.) It’s fun to add a few files and watch the cluster nodes. (Tip: try ‘ls -l’ in the ‘/mnt/data’ folder of a node and watch)

And off course: glusterclient.7z (50.9 MB)

Leave a Reply

You must be logged in to post a comment.