[CentOS] CENTOS and GlusterFS

Mon May 19 01:50:20 UTC 2014
Ted Miller <tedlists at sbcglobal.net>

On 05/15/2014 12:54 PM, Alessandro Baggi wrote:
> Hi list,
> I'm planning to setup a two-node "cluster" with file replication and samba.

A caution--a two-node replicated cluster is a poor choice.  If something 
gets into a split-brain condition (easier to happen than it should be) 
there are only two different nodes, and so there can be no voting.  Using a 
three-node replicated cluster is the minimum that can be recommended at 
this point.  (You don't want to get into a split-brain condition, because 
it will give you a headache that makes it feel like your brain is splitting.)

Gluster is beginning work on a different way of writing the replicated 
data, that will be much less likely to result in split-brain,

> I've used drbd in the  past with success, but now there isn't drbd on
> the official repo but only from elrepo. I want follow centos Line and
> than switch to GlusterFS.
>
> Said that, I'm new to GlusterFS.
>
> I have two hosts with a 2tb disk space for replica.
> I've ridden that glusterfs is not compatible with smb/cifs/nfs and that
> for this purpose I must mount locally the volume and share it with samba
> and the hosts must act as client and server at the same time.

I'm not sure what you're trying to do here, but nfs sharing is built into 
gluster, and turned on by default.  What Operating System will be using the 
gluster volume?

> It is possibile shares a mounted disk on /data with samba, and apply a
> replica volume on /data without using glusterfs export?
>
> Example:
> [Host1]                          [Host2]
> /data -> smb                     /data -> smb
> gluster_replica<---------------->gluster_replica

Be sure to map the gluster file system to /data, NOT the underlying bricks. 
  Mapping the bricks is a common newbie mistake.  Gluster does NOT 
replicate changes to the individual bricks.  Only changes to the mounted 
glusterfs volume itself are replicated reliably.  Be sure that when you 
type "mount", the line that describes /data looks like:
localhost:data   /data  glusterfs
It HAS TO say glusterfs in order to be shared.

There will be a separate line in the output of "mount" that will say 
something like

/dev/sda2   /brick/data  xfs

That is the brick, and your samba share must NOT point to /brick/data.

Ted Miller