glusterfsでコンテンツ同期

epelのglusterfsはバージョン2なのでソースコンパイルに変更する
webサーバを複数台並べるとコンテンツの更新方法に悩む。
安直にNASを使うのは金があるところだけなので、glusterfsを試してみることにした。

glusterfs

http://www.gluster.org/
http://www.gluster.com/community/documentation/index.php/Gluster_3.2_Gluster_Virtual_Storage_Appliance_for_Amazon_Web_Services_Guide
http://www.iredmail.org/wiki/index.php?title=Master-master_high-availability_failover_iRedMail_system_using_GlusterFS

http://www.insaneworks.co.jp/kota/glusterfs%E3%81%A7%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BFfs%E3%82%92%E4%BD%9C%E3%82%8B

glusterfs server setup

install
$ sudo yum -y install glusterfs-server

/etc/glusterfs/glusterfsd.vol
$ diff glusterfsd.vol.org glusterfsd.vol
19c19< volume brick

    • -

> volume nginx
21c21< option directory /home/export # Export this directory

    • -

> option directory /vol/nginx # Export this directory
42c42< subvolumes brick

    • -

> subvolumes nginx
46c46< option auth.addr.brick.allow * # Allow access to "brick" volume

    • -

> option auth.addr.nginx.allow 10.150.107.152

$ mkdir /vol/nginx
$ sudo /etc/init.d/glusterfsd start

glusterfs client setup

install
$ sudo yum -y install glusterfs-client
$ mkdir /etc/glusterfs
$ scp server:glusterfs.vol /etc/glusterfs
$ diff /etc/glusterfs/glusterfs.vol.org /etc/glusterfs/glusterfs.vol
23c23< option remote-host 127.0.0.1 # IP address of the remote brick

    • -

> option remote-host x.x.x.x
35c35< option remote-subvolume brick # name of the remote volume

    • -

> option remote-subvolume nginx