CentOS Stream 8
Sponsored Link

GlusterFS 10 : Geo レプリケーション2022/04/14

 
GlusterFS Geo レプリケーションを設定し、GlusterFS ボリュームのレプリケーションボリュームを作成します。
設定したボリュームは、プライマリー/レプリカ (読み取り専用) 型の冗長構成になります。
例として、リンク先の通り構築した [vol_distributed] ボリュームに対して、
レプリカホスト (node03, node04) 側にレプリケーション用ボリュームを作成して、レプリケーションの設定をします。
なお、下例はローカルネットワーク内でのレプリケーションですが、インターネットを介したリモートサイト間でも設定は可能です。
                                  |
+----------------------+          |          +----------------------+
| [GlusterFS Server#1] |10.0.0.51 | 10.0.0.53| [GlusterFS Server#3] |
|   node01.srv.world   +----------+----------+   node03.srv.world   |
|                      |          |          |                      |
+----------------------+          |          +----------------------+
   [vol_distributed]              |         [secondary-vol_distributed]
+----------------------+          |          +----------------------+
| [GlusterFS Server#2] |10.0.0.52 | 10.0.0.54| [GlusterFS Server#4] |
|   node02.srv.world   +----------+----------+   node04.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1]
[2] 全ノードで、Geo レプリケーション用のパッケージをインストールしておきます。
[root@node01 ~]#
dnf --enablerepo=centos-gluster10,powertools -y install glusterfs-geo-replication

[3] 全ノードで、SELinux を有効にしている場合は、ポリシーの変更が必要です。
[root@node01 ~]#
setsebool -P rsync_full_access on

[root@node01 ~]#
setsebool -P rsync_client on

[4] レプリケーションボリュームを構成するいずれかのノードで設定を変更しておきます。
[root@node03 ~]#
gluster volume set secondary-vol_distributed performance.quick-read off

volume set: success
[5] プライマリーボリュームを構成するいずれかのノードで、SSH 鍵ペア認証ができるよう設定しておきます。
当例では [root] ユーザーで、パスフレーズ無の鍵ペアを設定します。
[root@node01 ~]#
ssh-keygen -q -N ""

Enter file in which to save the key (/root/.ssh/id_rsa):

[root@node01 ~]#
ssh-copy-id node01

root@node01's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'node01'"
and check to make sure that only the key(s) you wanted were added.

[root@node01 ~]#
ssh-copy-id node02

[root@node01 ~]#
ssh-copy-id node03

[root@node01 ~]#
ssh-copy-id node04

[6] プライマリーボリュームを構成するいずれかのノードで、Geo レプリケーションセッションを作成します。
[root@node01 ~]#
gluster system:: execute gsec_create

Common secret pub file present at /var/lib/glusterd/geo-replication/common_secret.pem.pub
# gluster volume geo-replication [プライマリーボリューム] [(レプリケーションホスト)::(レプリケーションボリューム)] ***

[root@node01 ~]#
gluster volume geo-replication vol_distributed node03::secondary-vol_distributed create push-pem

Creating geo-replication session between vol_distributed & node03::secondary-vol_distributed has been successful
[7] プライマリーボリュームを構成するいずれかのノード、および、レプリケーションボリュームを構成するいずれかのノードで、それぞれ、共有ストレージを有効にしておきます。
[root@node01 ~]#
gluster volume set all cluster.enable-shared-storage enable

volume set: success
[8] プライマリーボリュームを構成するいずれかのノードで、Geo レプリケーションのメタボリュームを設定して Geo レプリケーションを開始します。 Geo レプリケーション開始後は、プライマリーボリューム側でファイルの書き込み等を実行し、レプリケーションボリューム側で正常にレプリケーションされているか確認しておくとよいでしょう。
# gluster volume geo-replication [プライマリーボリューム] [(レプリケーションホスト)::(レプリケーションボリューム)] ***

[root@node01 ~]#
gluster volume geo-replication vol_distributed node03::secondary-vol_distributed config use_meta_volume true

geo-replication config updated successfully
[root@node01 ~]#
gluster volume geo-replication vol_distributed node03::secondary-vol_distributed start

Starting geo-replication session between vol_distributed & node03::secondary-vol_distributed has been successful
[root@node01 ~]#
gluster volume geo-replication vol_distributed node03::secondary-vol_distributed status

PRIMARY NODE    PRIMARY VOL        PRIMARY BRICK             SECONDARY USER    SECONDARY                            SECONDARY NODE    STATUS    CRAWL STATUS       LAST_SYNCED
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
node01          vol_distributed    /glusterfs/distributed    root              node03::secondary-vol_distributed                      Active    Changelog Crawl    2022-04-14 13:41:28
node02          vol_distributed    /glusterfs/distributed    root              node03::secondary-vol_distributed                      Active    Changelog Crawl    2022-04-14 13:41:31
関連コンテンツ