CentOS 8
Sponsored Link

Pacemaker : Set Fence Device
2020/02/24
 
Set Fence Device on Cluster. (see about Fencing on the site below)
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_high_availability_clusters/assembly_overview-of-high-availability-configuring-and-managing-high-availability-clusters#s1-fencing-HAAO

It's possible to use many kinds of devices for fencing, APC or IPMI and so on.
On this example, Configure storage based fencing by using SCSI storage like follows
Configure basic Cluster settings first, refer to here.

                        +--------------------+
                        | [  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]
Configure ISCSI Target and Create a storage for fence device, refer to here.
On this example, it created ISCSI storage as IQN [iqn.2020-02.world.srv:dlp.target01] with [1M] size.
[2]
On all Cluster Nodes, Login to ISCSI Target, refer to here.
[3] On all Cluster Nodes, Install SCSI Fence Agent.
[root@node01 ~]#
dnf --enablerepo=HighAvailability -y install fence-agents-scsi
[4] Configure Fencing on a Node.
[sda] of the example below is the storage from ISCSI target.
# confirm disk ID

[root@node01 ~]#
ll /dev/disk/by-id | grep sda

lrwxrwxrwx. 1 root root  9 Feb 20 01:04 scsi-3600140566b2f46e563144e3a479176d2 -> ../../sda
lrwxrwxrwx. 1 root root  9 Feb 20 01:04 wwn-0x600140566b2f46e563144e3a479176d2 -> ../../sda

# set fencing

# [scsi-shooter] ⇒ any name

# [pcmk_host_list=***] ⇒ specify cluster nodes

# [devices=***] ⇒ disk ID

[root@node01 ~]#
pcs stonith create scsi-shooter fence_scsi pcmk_host_list="node01.srv.world node02.srv.world" devices=/dev/disk/by-id/wwn-0x600140566b2f46e563144e3a479176d2 meta provides=unfencing
# show config

[root@node01 ~]#
pcs stonith config scsi-shooter

 Resource: scsi-shooter (class=stonith type=fence_scsi)
  Attributes: devices=/dev/disk/by-id/wwn-0x600140549561e5a83794422a943176a7 pcmk_host_list="node01.srv.world node02.srv.world"
  Meta Attrs: provides=unfencing
  Operations: monitor interval=60s (scsi-shooter-monitor-interval-60s)

# show status

# OK if the status of fence device is [Started]

[root@node01 ~]#
pcs status

Cluster name: ha_cluster
Stack: corosync
Current DC: node01.srv.world (version 2.0.2-3.el8_1.2-744a30d655) - partition with quorum
Last updated: Thu Feb 20 01:29:54 2020
Last change: Thu Feb 20 01:29:47 2020 by root via cibadmin on node01.srv.world

2 nodes configured
1 resource configured

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] Try to test fencing.
[root@node01 ~]#
pcs status

Cluster name: ha_cluster
Stack: corosync
Current DC: node01.srv.world (version 2.0.2-3.el8_1.2-744a30d655) - partition with quorum
Last updated: Thu Feb 20 01:29:54 2020
Last change: Thu Feb 20 01:29:47 2020 by root via cibadmin on node01.srv.world

2 nodes configured
1 resource configured

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@node01 ~]#
pcs stonith fence node01.srv.world

Node: node01.srv.world fenced
# confirm status on another node

[root@node02 ~]#
pcs status

Cluster name: ha_cluster
Stack: corosync
Current DC: node02.srv.world (version 2.0.2-3.el8_1.2-744a30d655) - partition with quorum
Last updated: Thu Feb 20 14:46:43 2020
Last change: Thu Feb 20 14:29:47 2020 by root via cibadmin on node01.srv.world

2 nodes configured
1 resource configured

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
Matched Content