Ubuntu 18.04
Sponsored Link

GlusterFS : 分散 + レプリカ構成2018/06/22

 
GlusterFS によるストレージクラスターの設定です。
例として、4台のサーバー中の 2台のサーバー間でそれぞれレプリカ構成をとりつつ、レプリカ構成を設定した 2台のサーバーを 1組とした 2組間でファイル単位で分散保管する 分散 + レプリカ構成を設定します。
                                  |
+----------------------+          |          +----------------------+
| [GlusterFS Server#1] |10.0.0.51 | 10.0.0.52| [GlusterFS Server#2] |
|   node01.srv.world   +----------+----------+   node02.srv.world   |
|                      |          |          |                      |
+----------------------+          |          +----------------------+
                                  |
+----------------------+          |          +----------------------+
| [GlusterFS Server#3] |10.0.0.53 | 10.0.0.54| [GlusterFS Server#4] |
|   node03.srv.world   +----------+----------+   node04.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

 
前提として、クラスターを構成するノード群では GlusterFS に割り当てる領域は / パーティションとは別であることが推奨です。 ( / 配下の任意のディレクトリでも設定は可能だが、非推奨のため、設定の際に強制オプションの付加が必要 )
[1]
[2] 全ノードで、ボリュームに割り当てるディレクトリを作成しておきます。
( 当例では、全ノードで sdb1 を /glusterfs にマウント済み )
root@node01:~#
mkdir /glusterfs/dist-replica

[3] いずれかのノードで以下のように設定します。
# 他のノードを探す

root@node01:~#
gluster peer probe node02

peer probe: success.
root@node01:~#
gluster peer probe node03

peer probe: success.
root@node01:~#
gluster peer probe node04

peer probe: success.
# 状態を表示

root@node01:~#
gluster peer status

Number of Peers: 3

Hostname: node02
Uuid: aac88f72-3cf6-4bf8-a9d5-4347d7a8040c
State: Peer in Cluster (Connected)

Hostname: node03
Uuid: 98463881-f7b9-4b04-8c56-b68cc47f9501
State: Peer in Cluster (Connected)

Hostname: node04
Uuid: 58fd4c09-005f-4b73-835f-2bf4213dfa2d
State: Peer in Cluster (Connected)

# ボリュームを作成

root@node01:~#
gluster volume create vol_dist-replica replica 2 transport tcp \
node01:/glusterfs/dist-replica \
node02:/glusterfs/dist-replica \
node03:/glusterfs/dist-replica \
node04:/glusterfs/dist-replica

volume create: vol_dist-replica: success: please start the volume to access data
# 作成したボリュームを起動

root@node01:~#
gluster volume start vol_dist-replica

volume start: vol_dist-replica: success
# ボリューム情報確認

root@node01:~#
gluster volume info


Volume Name: vol_dist-replica
Type: Distributed-Replicate
Volume ID: 7da2ac9c-f9f0-4a09-a2c3-b3f3c1f2b584
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: node01:/glusterfs/dist-replica
Brick2: node02:/glusterfs/dist-replica
Brick3: node03:/glusterfs/dist-replica
Brick4: node04:/glusterfs/dist-replica
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
[4]
GlusterFS ボリュームをマウントして利用するための クライアント側の設定はこちらを参照ください
関連コンテンツ