[Gluster-users] File replication

Vikas Gorur vikas at zresearch.com
Wed Nov 12 07:49:38 UTC 2008

2008/11/12 Aleynikov, Serge <Serge.Aleynikov at gs.com>:
> Thanks for your suggestion.  The setup works as described.  This brought two
> more questions:
> 1. Is it possible to run the gclusterfs client not as a root user?  I see in
> tcp-client.c that it's trying to open a priviledged port, which means that
> it requires root rights, but I didn't find in docs a statement that it has
> to run as root.

Yes, you can run the GlusterFS client as a non-root user, if you ensure
the following things:

* that you have write permission on /dev/fuse
* that you own the mount point directory
* that you use user/password authentication, not IP-based authentication.

> 2. Is it possible to have a setup where on N participating hosts (named one,
> two, three in the example below) would have their local directory
> (/local/data) available to all glusterfs clients (as
> /mnt/data/{one,two,three}) so that by default no data would be copied from
> host to host:
> Host   LocalResource  SharedResource
> one    /local/data    /mnt/data/one
> two    /local/data    /mnt/data/two
> three  /local/data    /mnt/data/three
> In this setup if I am on the host 'one' and do:
> $ cd /mnt/data
> $ grep "Test" /mnt/data/*/test.txt
> that this would actually go to corresponding hosts, fetch the local file
> /local/data/test.txt and send it to the host executing the grep command, so
> that it can be processed there.
> This setup could be described as a mount of Host:/local/data to
> /mnt/data/Host.
> Is this setup achievable through glusterfs?

Yes, this is fairly simple to do.

On each of your nodes {one, two, three}, run a GlusterFS server
that exports /local/data.

For example, on node 'one' have the following spec file:

volume one
 type storage/posix
 option directory /local/data

volume server
 type protocol/server
 option transport-type tcp/server
# authentication options, see sample config in doc/examples
 subvolumes one

Then on each of your nodes mount the other two exported volumes.
So on node 'one' run a GlusterFS client with a spec file like:

volume two
 type protocol/client
# options to connect to 'two'

volume three
 type protocol/client
# options to connect to 'three'

volume two-fuse
 type mount/fuse
 option mount-point /mnt/data/two
 subvolumes two

volume three-fuse
 type mount/fuse
 option mount-point /mnt/data/three
 subvolumes three

Engineer - Z Research

More information about the Gluster-users mailing list