GlusterFS 3: replicated volumes

download and install latest glusterfs package from http://download.gluster.org/pub/gluster/glusterfs/LATEST/

I'll create two replicated machines and one follower machine:

machine1 # /etc/init.d/glusterd start
machine2 # /etc/init.d/glusterd start

machine1 # gluster peer probe machine2
Probe successful

machine2 # gluster peer probe machine1
Probe successful

machine1 # mkdir -p /etc/glusterfs/data/storage
machine2 # mkdir -p /etc/glusterfs/data/storage
machine1 # gluster volume create storage replica 2 transport tcp\
machine1:/etc/glusterfs/data/storage machine2:/etc/glusterfs/data/storage

machine2 # gluster volume start storage

machine1 # showmount -e machine1
Export list for machine1:
/storage *

machine2 # showmount -e machine2
Export list for machine1:
/storage *

machine1 # mkdir -p /mnt/glusterfs/storage
machine2 # mkdir -p /mnt/glusterfs/storage
machine1 # mount.glusterfs machine1:/storage /mnt/glusterfs/storage
machine2 # mount.glusterfs machine2:/storage /mnt/glusterfs/storage

machine1 # ls /mnt/glusterfs/storage/
empty

machine2 # ls /mnt/glusterfs/storage/
empty

machine1 # touch /mnt/glusterfs/storage/testfile
machine2 # ls -la /mnt/glusterfs/storage/testfile
-rw-r--r-- 1 root root 0 2012-07-26 17:09 /mnt/glusterfs/storage/testfile

machine2 # echo «It's a simple test» > /mnt/glusterfs/storage/testfile
machine1 # cat /mnt/glusterfs/storage/testfile
It's a simple test

Other machines can mount folders via network
machine3 # mount.glusterfs machine1:/storage /mnt/glusterfs/storage
machine4 # mount.glusterfs machine2:/storage /mnt/glusterfs/storage