ノートPC上のVMware使ってglusterFSを入れてみたので備忘録。
とりあえずシンプルに。
・サーバ :glusterfs11 / 192.168.80.131 (RedHat5.5)
→共有ディレクトリ:/glusterfs
・クライアント:yaeyama / 192.168.80.129 (CentOS5.5)
→マウントポイント:/mnt/vol01
として試す。
rpmだとなんかつかめなさそうなので今回はsourceから。
■インストール
0.クライアント側/サーバ側共通
cd /usr/local/src
wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-(ver).tar.gz
tar zxvf glusterfs-(ver).tar.gz
cd glusterfs-(ver)
./configure --prefix=/usr/local/glusterfs
make
make install
cd /usr/local
mv glusterfs glusterfs-3.0.7
ln -s glusterfs-3.0.7 glusterfs
■設定
1.glusterfsサーバ側
cd /usr/local/glusterfs/etc/glusterfs
vi glusterfsd.vol
-----(以下設定例)-----
#
# glusterFS サーバ側設定ファイル
#
### ボリューム定義
volume vol01
type storage/posix
option directory /glusterfs
end-volume
### サーバ定義
volume server
type protocol/server
option transport-type tcp/server
subvolumes vol01 # server内のvolume定義
option auth.ip.vol01.allow 192.168.80.* # volumeに対するアクセス制限
end-volume
-----
glusterfsdの起動
service glusterfsd start
※/etc/init.d/glusterfsd の中身を必要に応じて書き換えておこう。
2.glusterfsクライアント側
cd /usr/local/glusterfs/etc/glusterfs
vi glusterfs.vol
-----(以下設定例)-----
#
# glusterFS クライアント側設定ファイル
#
### ボリューム定義 #クライアント側は定義不要!
### クライアント定義
volume glusterfs11
type protocol/client
option transport-type tcp
option remote-host glusterfs11 # 接続先Server
option remote-subvolume vol01 # 接続先Serverのvolume
end-volume
-----
/etc/fstab に追記
-----(以下設定例)-----
/usr/local/glusterfs/etc/glusterfs/glusterfs.vol /mnt/vol01 glusterfs defaults 0 0
マウントする
mount -a
クライアント側の /mnt/vol01上でファイルを作成して、
サーバ側の /glusterfs 配下にファイルができていれば良し。
今日はここまでー。
とりあえずシンプルに。
・サーバ :glusterfs11 / 192.168.80.131 (RedHat5.5)
→共有ディレクトリ:/glusterfs
・クライアント:yaeyama / 192.168.80.129 (CentOS5.5)
→マウントポイント:/mnt/vol01
として試す。
rpmだとなんかつかめなさそうなので今回はsourceから。
■インストール
0.クライアント側/サーバ側共通
cd /usr/local/src
wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-(ver).tar.gz
tar zxvf glusterfs-(ver).tar.gz
cd glusterfs-(ver)
./configure --prefix=/usr/local/glusterfs
make
make install
cd /usr/local
mv glusterfs glusterfs-3.0.7
ln -s glusterfs-3.0.7 glusterfs
■設定
1.glusterfsサーバ側
cd /usr/local/glusterfs/etc/glusterfs
vi glusterfsd.vol
-----(以下設定例)-----
#
# glusterFS サーバ側設定ファイル
#
### ボリューム定義
volume vol01
type storage/posix
option directory /glusterfs
end-volume
### サーバ定義
volume server
type protocol/server
option transport-type tcp/server
subvolumes vol01 # server内のvolume定義
option auth.ip.vol01.allow 192.168.80.* # volumeに対するアクセス制限
end-volume
-----
glusterfsdの起動
service glusterfsd start
※/etc/init.d/glusterfsd の中身を必要に応じて書き換えておこう。
2.glusterfsクライアント側
cd /usr/local/glusterfs/etc/glusterfs
vi glusterfs.vol
-----(以下設定例)-----
#
# glusterFS クライアント側設定ファイル
#
### ボリューム定義 #クライアント側は定義不要!
### クライアント定義
volume glusterfs11
type protocol/client
option transport-type tcp
option remote-host glusterfs11 # 接続先Server
option remote-subvolume vol01 # 接続先Serverのvolume
end-volume
-----
/etc/fstab に追記
-----(以下設定例)-----
/usr/local/glusterfs/etc/glusterfs/glusterfs.vol /mnt/vol01 glusterfs defaults 0 0
マウントする
mount -a
クライアント側の /mnt/vol01上でファイルを作成して、
サーバ側の /glusterfs 配下にファイルができていれば良し。
今日はここまでー。