GlusterFS をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
「呑めば呑むほど強くなる」な感じを率直に思えた「分散ファ...
本家様 [[http://www.gluster.org/>+http://www.gluster.org/]]
github [[https://github.com/gluster/glusterfs>+https://gi...
複数のマシンで分散してデータを保持する。データ保持の方法...
Lustreのような中央監視なマシンは不要。
&ref(2015y01m24d_215554084.png,nolink,noborder);
ここでは4台(n1、n2、n3、n4)のノードを使って各種検証を行...
&color(red){*};&size(10){速度調査、パフォーマンステストは...
単一マシンでGlusterFSを作ってみる [[GlusterFS/single]]
***&color(green){''Brick''};の作成 [#g5b1be08]
参照先 [[http://www.gluster.org/community/documentation/i...
OS領域な部分と、&color(magenta){GlusterFS};構成員として拠...
拠出する&color(green){''Brick''};部分は&color(magenta){Gl...
もちろん1台のノードに複数の&color(green){''Brick''};があ...
ここでは、
|BGCOLOR(YELLOW):デバイス|BGCOLOR(YELLOW):領域|BGCOLOR(YE...
|/dev/sda|OS領域|8GB|最小インストールでntp導入|
|/dev/sdb|&color(magenta){GlusterFS};|16GB|&color(green){...
と簡単に1ノードに1&color(green){''Brick''};の構成とした。
#code(nonumber){{
[root@n1 ~]# cat /proc/partitions
major minor #blocks name
2 0 4 fd0
8 16 16777216 sdb
8 0 8388608 sda
8 1 524288 sda1
8 2 524288 sda2
8 3 2097152 sda3
8 4 5240832 sda4
11 0 470528 sr0
[root@n1 ~]#
[root@n1 ~]# mkfs.xfs -i size=512 /dev/sdb *「-i s...
[root@n1 ~]# mkdir /brick
[root@n1 ~]# echo "/dev/sdb /brick xfs defaults 1 2" >> /...
[root@n1 ~]# mount -a
[root@n1 ~]# df -lTh /brick
ファイルシス タイプ サイズ 使用 残り 使用% マウント位置
/dev/sdb xfs 16G 33M 16G 1% /brick
[root@n1 ~]#
}}
n2、n3、n4でも同じように構築する
***&color(magenta){GlusterFS};のインストール [#b0784d2f]
&color(lightseagreen){''CentOS 7''};の標準リポジトリで一...
なので、glusterのサイトでRed Hat/CentOS向けのパッケージを...
[[http://www.gluster.org/community/documentation/index.ph...
開発元がRed Hat/CentOS向けの最新版を提供している。すばら...
#code(nonumber){{
[root@n1 ~]# mkdir glusterfs && cd glusterfs
[root@n1 glusterfs]# wget -l1 -nd -nc -r -A rpm \
http://download.gluster.org/pub/gluster/glusterfs/L...
[root@n1 glusterfs]# ls -l
合計 14324
-rw-r--r-- 1 root root 458032 4月 18 22:50 glusterfs-3...
-rw-r--r-- 1 root root 83380 4月 18 22:50 glusterfs-a...
-rw-r--r-- 1 root root 38336 4月 18 22:50 glusterfs-a...
-rw-r--r-- 1 root root 181952 4月 18 22:50 glusterfs-c...
-rw-r--r-- 1 root root 805172 4月 18 22:50 glusterfs-c...
-rw-r--r-- 1 root root 10625972 4月 18 22:50 glusterfs-d...
-rw-r--r-- 1 root root 168412 4月 18 22:50 glusterfs-d...
-rw-r--r-- 1 root root 92620 4月 18 22:50 glusterfs-e...
-rw-r--r-- 1 root root 131764 4月 18 22:50 glusterfs-f...
-rw-r--r-- 1 root root 42956 4月 18 22:50 glusterfs-g...
-rw-r--r-- 1 root root 206952 4月 18 22:50 glusterfs-g...
-rw-r--r-- 1 root root 348936 4月 18 22:50 glusterfs-l...
-rw-r--r-- 1 root root 60896 4月 18 22:50 glusterfs-r...
-rw-r--r-- 1 root root 1392340 4月 18 22:50 glusterfs-s...
[root@n1 glusterfs]#
}}
取得したパッケージをn2、n3、n4にコピーします。
#code(nonumber){{
[root@n1 glusterfs]# ssh -l root n2 mkdir glusterfs && sc...
[root@n1 glusterfs]# ssh -l root n3 mkdir glusterfs && sc...
[root@n1 glusterfs]# ssh -l root n4 mkdir glusterfs && sc...
}}
インストールするパッケージは &color(magenta){glusterfs-se...
#code(nonumber){{
[root@n1 glusterfs]# yum localinstall ./glusterfs-server-...
./glusterfs-3.7.11-1.el7.x86_64.rpm \
./glusterfs-api-3.7.11-1.el7.x86_64.rpm \
./glusterfs-cli-3.7.11-1.el7.x86_64.rpm \
./glusterfs-client-xlators-3.7.11-1.el7.x86_64.rpm \
./glusterfs-fuse-3.7.11-1.el7.x86_64.rpm \
./glusterfs-libs-3.7.11-1.el7.x86_64.rpm
[root@n1 glusterfs]#
}}
とします。インストールが完了すると下記の様にサービスが定...
#code(nonumber){{
[root@n1 glusterfs]# systemctl list-unit-files |grep glus...
glusterd.service disabled
glusterfsd.service disabled
[root@n1 glusterfs]#
[root@n1 glusterfs]# systemctl enable glusterd
}}
&color(white,blue){留意}; glusterd と glusterfsd があるが...
***信頼されたストレージプールを作る [#k36569be]
本家では「Configure the trusted pool」と称されている。ま...
ここではn1ノードでのみ操作を行います。
&color(white,blue){留意}; n1ノードで操作をしたからといっ...
#code(nonumber){{
[root@n1 ~]# gluster peer status *状況確認
Number of Peers: 0 *仲間はおりません
[root@n1 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
[root@n1 ~]# gluster peer probe n2 *n2ノードを追加
peer probe: success.
[root@n1 ~]#
[root@n1 ~]# gluster peer status
Number of Peers: 1
Hostname: n2 *n2ノード追加成功
Uuid: 80f808eb-8afc-424b-a40d-e0370c609cd8
State: Peer in Cluster (Connected)
[root@n1 ~]#
[root@n1 ~]# gluster pool list
UUID Hostname S...
80f808eb-8afc-424b-a40d-e0370c609cd8 n2 C...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
}}
このn1ノードでの作業後、n2ノード側は何もしなくても
#code(nonumber){{
[root@n2 ~]# gluster peer status
Number of Peers: 1
Hostname: 192.168.0.52
Uuid: 3175c53c-aeff-49ae-bce9-af8a0314aedf
State: Peer in Cluster (Connected)
[root@n2 ~]#
[root@n2 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf 192.168.0.52 C...
80f808eb-8afc-424b-a40d-e0370c609cd8 localhost C...
[root@n2 ~]#
}}
と自動的に連携される。
上記の様に操作して、n3ノードとn4ノードも追加します。
ちなみにノードを削除するには、下記のようにします。
#code(nonumber){{
[root@n1 ~]# gluster peer detach n2
peer detach: success
[root@n1 ~]# gluster peer status
Number of Peers: 0
[root@n1 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
}}
この時のn2ノードでも自動的に削除されます。
***&color(magenta){GlusterFS};のボリュームを作成する [#ud...
ここが胆なのかな。コマンド様式は
#code(nonumber){{
[root@n1 ~]# gluster volume create ボリューム名 \
[stripe <COUNT>] \
[replica <COUNT>] \
[disperse [<COUNT>]] \
[redundancy <COUNT>] \
[transport <tcp|rdma|tcp,rdma>] \
n1:/brick/gv0 n2:/brick/gv0 n3:/brick/gv0 n4:/brick/g...
[force]
}}
となる。
[[stripe(分割)>GlusterFS/stripe]] 複数のノードに分割し...
[[replica(複製)>GlusterFS/replica]] 複数のノードに同じ...
[[disperse(分散)>GlusterFS/disperse]] RAID5っぽくファ...
***mount操作 [#hbdbe2df]
[[GlusterFS/client]]
***初期化 [#h5effb27]
コマンドでなかったことにもできるが、簡単には
#code(nonumber){{
[root@n1 ~]# /etc/init.d/glusterd stop
[root@n1 ~]# rm -rf /var/lib/glusterd/*
[root@n1 ~]# /etc/init.d/glusterd start
}}
でいいみたい。
終了行:
「呑めば呑むほど強くなる」な感じを率直に思えた「分散ファ...
本家様 [[http://www.gluster.org/>+http://www.gluster.org/]]
github [[https://github.com/gluster/glusterfs>+https://gi...
複数のマシンで分散してデータを保持する。データ保持の方法...
Lustreのような中央監視なマシンは不要。
&ref(2015y01m24d_215554084.png,nolink,noborder);
ここでは4台(n1、n2、n3、n4)のノードを使って各種検証を行...
&color(red){*};&size(10){速度調査、パフォーマンステストは...
単一マシンでGlusterFSを作ってみる [[GlusterFS/single]]
***&color(green){''Brick''};の作成 [#g5b1be08]
参照先 [[http://www.gluster.org/community/documentation/i...
OS領域な部分と、&color(magenta){GlusterFS};構成員として拠...
拠出する&color(green){''Brick''};部分は&color(magenta){Gl...
もちろん1台のノードに複数の&color(green){''Brick''};があ...
ここでは、
|BGCOLOR(YELLOW):デバイス|BGCOLOR(YELLOW):領域|BGCOLOR(YE...
|/dev/sda|OS領域|8GB|最小インストールでntp導入|
|/dev/sdb|&color(magenta){GlusterFS};|16GB|&color(green){...
と簡単に1ノードに1&color(green){''Brick''};の構成とした。
#code(nonumber){{
[root@n1 ~]# cat /proc/partitions
major minor #blocks name
2 0 4 fd0
8 16 16777216 sdb
8 0 8388608 sda
8 1 524288 sda1
8 2 524288 sda2
8 3 2097152 sda3
8 4 5240832 sda4
11 0 470528 sr0
[root@n1 ~]#
[root@n1 ~]# mkfs.xfs -i size=512 /dev/sdb *「-i s...
[root@n1 ~]# mkdir /brick
[root@n1 ~]# echo "/dev/sdb /brick xfs defaults 1 2" >> /...
[root@n1 ~]# mount -a
[root@n1 ~]# df -lTh /brick
ファイルシス タイプ サイズ 使用 残り 使用% マウント位置
/dev/sdb xfs 16G 33M 16G 1% /brick
[root@n1 ~]#
}}
n2、n3、n4でも同じように構築する
***&color(magenta){GlusterFS};のインストール [#b0784d2f]
&color(lightseagreen){''CentOS 7''};の標準リポジトリで一...
なので、glusterのサイトでRed Hat/CentOS向けのパッケージを...
[[http://www.gluster.org/community/documentation/index.ph...
開発元がRed Hat/CentOS向けの最新版を提供している。すばら...
#code(nonumber){{
[root@n1 ~]# mkdir glusterfs && cd glusterfs
[root@n1 glusterfs]# wget -l1 -nd -nc -r -A rpm \
http://download.gluster.org/pub/gluster/glusterfs/L...
[root@n1 glusterfs]# ls -l
合計 14324
-rw-r--r-- 1 root root 458032 4月 18 22:50 glusterfs-3...
-rw-r--r-- 1 root root 83380 4月 18 22:50 glusterfs-a...
-rw-r--r-- 1 root root 38336 4月 18 22:50 glusterfs-a...
-rw-r--r-- 1 root root 181952 4月 18 22:50 glusterfs-c...
-rw-r--r-- 1 root root 805172 4月 18 22:50 glusterfs-c...
-rw-r--r-- 1 root root 10625972 4月 18 22:50 glusterfs-d...
-rw-r--r-- 1 root root 168412 4月 18 22:50 glusterfs-d...
-rw-r--r-- 1 root root 92620 4月 18 22:50 glusterfs-e...
-rw-r--r-- 1 root root 131764 4月 18 22:50 glusterfs-f...
-rw-r--r-- 1 root root 42956 4月 18 22:50 glusterfs-g...
-rw-r--r-- 1 root root 206952 4月 18 22:50 glusterfs-g...
-rw-r--r-- 1 root root 348936 4月 18 22:50 glusterfs-l...
-rw-r--r-- 1 root root 60896 4月 18 22:50 glusterfs-r...
-rw-r--r-- 1 root root 1392340 4月 18 22:50 glusterfs-s...
[root@n1 glusterfs]#
}}
取得したパッケージをn2、n3、n4にコピーします。
#code(nonumber){{
[root@n1 glusterfs]# ssh -l root n2 mkdir glusterfs && sc...
[root@n1 glusterfs]# ssh -l root n3 mkdir glusterfs && sc...
[root@n1 glusterfs]# ssh -l root n4 mkdir glusterfs && sc...
}}
インストールするパッケージは &color(magenta){glusterfs-se...
#code(nonumber){{
[root@n1 glusterfs]# yum localinstall ./glusterfs-server-...
./glusterfs-3.7.11-1.el7.x86_64.rpm \
./glusterfs-api-3.7.11-1.el7.x86_64.rpm \
./glusterfs-cli-3.7.11-1.el7.x86_64.rpm \
./glusterfs-client-xlators-3.7.11-1.el7.x86_64.rpm \
./glusterfs-fuse-3.7.11-1.el7.x86_64.rpm \
./glusterfs-libs-3.7.11-1.el7.x86_64.rpm
[root@n1 glusterfs]#
}}
とします。インストールが完了すると下記の様にサービスが定...
#code(nonumber){{
[root@n1 glusterfs]# systemctl list-unit-files |grep glus...
glusterd.service disabled
glusterfsd.service disabled
[root@n1 glusterfs]#
[root@n1 glusterfs]# systemctl enable glusterd
}}
&color(white,blue){留意}; glusterd と glusterfsd があるが...
***信頼されたストレージプールを作る [#k36569be]
本家では「Configure the trusted pool」と称されている。ま...
ここではn1ノードでのみ操作を行います。
&color(white,blue){留意}; n1ノードで操作をしたからといっ...
#code(nonumber){{
[root@n1 ~]# gluster peer status *状況確認
Number of Peers: 0 *仲間はおりません
[root@n1 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
[root@n1 ~]# gluster peer probe n2 *n2ノードを追加
peer probe: success.
[root@n1 ~]#
[root@n1 ~]# gluster peer status
Number of Peers: 1
Hostname: n2 *n2ノード追加成功
Uuid: 80f808eb-8afc-424b-a40d-e0370c609cd8
State: Peer in Cluster (Connected)
[root@n1 ~]#
[root@n1 ~]# gluster pool list
UUID Hostname S...
80f808eb-8afc-424b-a40d-e0370c609cd8 n2 C...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
}}
このn1ノードでの作業後、n2ノード側は何もしなくても
#code(nonumber){{
[root@n2 ~]# gluster peer status
Number of Peers: 1
Hostname: 192.168.0.52
Uuid: 3175c53c-aeff-49ae-bce9-af8a0314aedf
State: Peer in Cluster (Connected)
[root@n2 ~]#
[root@n2 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf 192.168.0.52 C...
80f808eb-8afc-424b-a40d-e0370c609cd8 localhost C...
[root@n2 ~]#
}}
と自動的に連携される。
上記の様に操作して、n3ノードとn4ノードも追加します。
ちなみにノードを削除するには、下記のようにします。
#code(nonumber){{
[root@n1 ~]# gluster peer detach n2
peer detach: success
[root@n1 ~]# gluster peer status
Number of Peers: 0
[root@n1 ~]# gluster pool list
UUID Hostname S...
3175c53c-aeff-49ae-bce9-af8a0314aedf localhost C...
[root@n1 ~]#
}}
この時のn2ノードでも自動的に削除されます。
***&color(magenta){GlusterFS};のボリュームを作成する [#ud...
ここが胆なのかな。コマンド様式は
#code(nonumber){{
[root@n1 ~]# gluster volume create ボリューム名 \
[stripe <COUNT>] \
[replica <COUNT>] \
[disperse [<COUNT>]] \
[redundancy <COUNT>] \
[transport <tcp|rdma|tcp,rdma>] \
n1:/brick/gv0 n2:/brick/gv0 n3:/brick/gv0 n4:/brick/g...
[force]
}}
となる。
[[stripe(分割)>GlusterFS/stripe]] 複数のノードに分割し...
[[replica(複製)>GlusterFS/replica]] 複数のノードに同じ...
[[disperse(分散)>GlusterFS/disperse]] RAID5っぽくファ...
***mount操作 [#hbdbe2df]
[[GlusterFS/client]]
***初期化 [#h5effb27]
コマンドでなかったことにもできるが、簡単には
#code(nonumber){{
[root@n1 ~]# /etc/init.d/glusterd stop
[root@n1 ~]# rm -rf /var/lib/glusterd/*
[root@n1 ~]# /etc/init.d/glusterd start
}}
でいいみたい。
ページ名:
1