Coming Underground
« Finally MythTV is running... sorta mostlyKVM PCI pass through with CX23880 based DVB-T card »

Glusterfs on Gentoo setup notes

Permalink 2010-01-05 21:08, by jaervosz, Categories: Gentoo Tips, Gentoo, Universe/English

For a long time I've been sharing the Portage tree over NFS to my virtual servers. However NFS is not exactly firewall friendly and feels a bit dated. So I've been looking for other alternatives. Today I stumbled across GlusterFS and took it for a spin.

It's quite easy to get a basic configuration going and there is already some Gentoo documentation about GlusterFS over at the Gentoo Wiki - GlusterFS. However they're installing GlusterFS from source and I only want to use ebuilds, so here is a short summary of how I did the setup with one server.

First ensure that you have FUSE enabled in the kernel (CONFIG_FUSE_FS=y)

Since glusterfs is not table yet, we'll add appropriate package keywords:

echo "sys-cluster/glusterfs ~amd64" >>\
/etc/portage/package.keywords/glusterfs

Then install with:

emerge -va glusterfs

We'll do most of the setup on the server so clients will download the configuration from the server. In this setup the server will have IP 192.168.2.1 and allow all connections from all clients in the 192.168.2.0/24 network.

First setup the server by editing /etc/glusterfs/glusterfsd.vol to contain the following:

volume portage
type storage/posix
option directory /usr/portage
end-volume

volume server
type protocol/server
option transport-type tcp
option transport.socket.listen-port 6996
option auth.addr.portage.allow 192.168.2.*
option client-volume-filename /etc/glusterfs/portage.vol
option volume-filename.portage /etc/glusterfs/portage.vol
subvolumes portage
end-volume

Note: that the above might contain wrong line breaks, almost all lines should start with option, and not with a file path.

Then create /etc/glusterfs/portage.vol:

volume portage
type protocol/client
option transport-type tcp
option remote-host 192.168.2.1
option remote-subvolume portage
end-volume

Then we just start the server:

/etc/init.d/glusterfsd start

Now we only need to configure the client:

echo "sys-cluster/glusterfs ~x86" >>\ /etc/portage/package.keywords/glusterfs

Note: Substitute appropriate keywords.

Then install glusterfs on the client:

emerge -va glusterfs

For automounting add the following to /etc/fstab:

192.168.2.1 /usr/portage glusterfs defaults 0 0

You could add the ro to the options, in addition to defaults, if only the server should be able to write to the Portage tree.

Then mount it the first time with:

mount /usr/portage

Also I've tried using the volfile-id=portage option, but it doesn't seem to work from fstab, though it works fine with glusterfs, glusterfs --volfile-server 192.168.2.1 --volfile-id portage /usr/portage/.

Now you should have your Portage tree shared with GlusterFS, if you have any problems consult the GlusterFS Troubleshooting

2 comments »Send a trackback »

Trackback address for this post

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

2 comments

Comment from: GregB [Visitor]
After studying the mount.glusterfs script for a while, I discovered that you have to append the volfile-id to the server-id like this:

192.168.2.1:portage /usr/portage glusterfs defaults 0 0

When I put a line like this in my /etc/fstab it passes the volfile-id parameter to the mount command properly.
2010-01-14 @ 19:12
Comment from: Anand Babu Periasamy [Visitor] · http://unlocksmith.org
Hi Jaervosz,
I recommend using glusterfs-volgen tool to generate optimal volume specification. Even basic performance features are implemented as stackable modules. You need to load them explicitly in the volume specification. Using volgen automates it. Thanks for the post. http://www.gluster.com/community/documentation/index.php/Glusterfs-volgen_Reference_Page
2010-01-27 @ 10:21

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

©2010 by admin

Contact Jaervosz