GlusterFS

I used an extra i386 vserver for build my 32-bit packages; and i somehow needed to share files. As there is no nfs-kernel support in a vserver, and i didn’t want to use the userspace one, i tried glusterfs.

Install

Couldn’t find debian repos anymore, only direct downloads.

Installing GlusterFS on Debian-based Distributions

Server

The debian package searches the default server share in /etc/glusterfs/server.vol:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
volume build
        type storage/posix
        option directory /var/spool/build
end-volume

volume server
        type protocol/server
        subvolumes build
        option transport-type tcp/server # For TCP/IP transport
        option auth.ip.build.allow 10.0.0.x  # internal ip
end-volume

Start the server:

1
$ /etc/init.d/glusterfs-server start

Client

Reference: http://linux-vserver.org/Fuse_GlusterFS

Linux-VServer preparation

Now it gets a little bit difficult for a vserver: we need access to /dev/fuse, so you need to create that file. Per default this is not alled, so you have two options:

  • shutdown the vserver, mount the partition from the master server and copy /dev/fuse.
  • give the vserver the permission to create device nodes (you will need that for pbuilder anyway):
    /etc/vservers/<name>/bcapabilities:
    CAP_MKNOD

And you need to give the vserver mount capabilites:

/etc/vservers//bcapabilities:

1
SYS_ADMIN

/etc/vservers//ccapabilities:

1
2
3
SECURE_MOUNT
SECURE_REMOUNT
BINARY_MOUNT

Config glusterfs

Create a config file for gluserfs-client:
/etc/glusterfs/build.vol:

1
2
3
4
5
6
volume build
        type protocol/client
        option transport-type tcp/client
        option remote-host 10.0.0.y
        option remote-subvolume build
end-volume

Mount it

To have easy mount commands, i put this into /etc/fstab:

1
/etc/glusterfs/build.vol        /mnt/glusterfs/build    glusterfs       defaults 0 0

(Don’t forget to create the mountpoint with mkdir -p /mnt/glusterfs/build)

To make the vserver mount it while starting, i added the mount command in /etc/rc.local before exit 0:

1
mount /mnt/glusterfs/build

Generated using nanoc and bootstrap - Last content change: 2011-06-10 07:41