Pacemaker : フェンスデバイスを設定する2025/10/09 |
|
クラスターにフェンスデバイスを設定します。(フェンシングの概要は下記サイト参照) https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html/configuring_and_managing_high_availability_clusters/s1-fencing-haao フェンスデバイスには APC 電源スイッチや IPMI 等々、多くが利用可能ですが、当例では、ストレージベースのフェンスデバイスを利用します。 例として、以下のように ISCSI Target のストレージを使用して SCSI フェンシングを設定します。事前にクラスターの基本構成を設定していることが前提です。
+--------------------+
| [ ISCSI Target ] |
| dlp.srv.world |
+---------+----------+
10.0.0.30|
|
+----------------------+ | +----------------------+
| [ Cluster Node#1 ] |10.0.0.51 | 10.0.0.52| [ Cluster Node#2 ] |
| node01.srv.world +----------+----------+ node02.srv.world |
| | | |
+----------------------+ +----------------------+
|
| [1] |
こちらを参考に、ISCSI ターゲット サーバーにフェンスデバイス用のストレージを作成しておきます。 |
| [2] |
こちらを参考に、クラスターを構成する全ノードで、ISCSI ターゲット サーバーにログインしておきます。 (ログインまでで OK) |
| [3] | クラスターを構成する全ノードに SCSI フェンスエージェントをインストールします。 |
|
root@node01:~#
root@node01:~# apt -y install pacemaker-resource-agents watchdog mkdir /etc/watchdog.d root@node01:~# cp /usr/share/cluster/fence_scsi_check /etc/watchdog.d/ root@node01:~# systemctl stop watchdog.service root@node01:~# systemctl start watchdog.service |
| [4] | フェンスデバイスを設定します。いずれかのノード上で設定すれば OK です。 下例の [sda] は ISCSI ターゲット サーバーのストレージです。 |
|
# ディスク ID 確認 root@node01:~# ll /dev/disk/by-id | grep sda | grep wwn lrwxrwxrwx 1 root root 9 Oct 9 08:50 wwn-0x60014052e2280b723e447989b527dd74 -> ../../sda # フェンシングを設定 # [scsi-shooter] : 任意の名称 # [pcmk_host_list=***] : クラスター構成ノードを指定 # [devices=***] : ISCSI ターゲット サーバーのストレージ root@node01:~# pcs stonith create scsi-shooter fence_scsi pcmk_host_list="node01.srv.world node02.srv.world" devices=/dev/disk/by-id/wwn-0x60014052e2280b723e447989b527dd74 meta provides=unfencing
# 設定確認 root@node01:~# pcs stonith config scsi-shooter
Resource: scsi-shooter (class=stonith type=fence_scsi)
Attributes: scsi-shooter-instance_attributes
devices=/dev/disk/by-id/wwn-0x60014052e2280b723e447989b527dd74
pcmk_host_list="node01.srv.world node02.srv.world"
Meta Attributes: scsi-shooter-meta_attributes
provides=unfencing
Operations:
monitor: scsi-shooter-monitor-interval-60s
interval=60s
# ステータス確認 # 設定したフェンスデバイスが [Started] であれば OK root@node01:~# pcs status Cluster name: ha_cluster Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node01.srv.world (version 3.0.0-3.0.0) - partition with quorum * Last updated: Thu Oct 9 08:55:57 2025 on node01.srv.world * Last change: Thu Oct 9 08:55:26 2025 by root via root on node01.srv.world * 2 nodes configured * 1 resource instance configured Node List: * Online: [ node01.srv.world node02.srv.world ] Full List of Resources: * scsi-shooter (stonith:fence_scsi): Started node01.srv.world Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled |
| [5] | 設定したフェンスデバイスが正常に機能するか、フェンシングのテストを実施します。 |
|
root@node02:~# pcs status Cluster name: ha_cluster Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node01.srv.world (version 3.0.0-3.0.0) - partition with quorum * Last updated: Thu Oct 9 08:55:57 2025 on node01.srv.world * Last change: Thu Oct 9 08:55:26 2025 by root via root on node01.srv.world * 2 nodes configured * 1 resource instance configured Node List: * Online: [ node01.srv.world node02.srv.world ] Full List of Resources: * scsi-shooter (stonith:fence_scsi): Started node01.srv.world Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled # フェンシングのテスト root@node02:~# pcs stonith fence node01.srv.world Node: node01.srv.world fenced # ノードは [OFFLINE] になり再起動される root@node02:~# pcs status Cluster name: ha_cluster Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node02.srv.world (version 3.0.0-3.0.0) - partition with quorum * Last updated: Thu Oct 9 08:56:52 2025 on node02.srv.world * Last change: Thu Oct 9 08:55:26 2025 by root via root on node01.srv.world * 2 nodes configured * 1 resource instance configured Node List: * Online: [ node02.srv.world ] * OFFLINE: [ node01.srv.world ] Full List of Resources: * scsi-shooter (stonith:fence_scsi): Started node02.srv.world Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled # 再起動後 手動で [Online] に戻す場合は以下 root@node02:~# pcs cluster start node01.srv.world |
| Sponsored Link |
|
|