How to Implement Oracle Linux 7 Cluster Using Pacemaker and Corosync Using STONITH Block Devices in Oracle VM?

Hello,
Corosync/Pacemaker is a supported high availability cluster solution for Oracle Linux 7.3 or newer version. The main component for a Corosync/Pacemaker cluster is to have a reliable fencing agent, to prevent data corruption. The recommended solution is to use a generic fence. There are two agents that can be used: fence_scsi and fence_sbd.

In this blog post we will describe on how to use fence_sbd.

STONITH Block Devices (SBD) use a shared disk that will be used as a fence device. This disk must be used exclusively as sbd device, no filesystem should be created in the disk.

To enable SBD fencing:

1- Install SBD and watchdog (all nodes):

yum install -y watchdog sbd

2- Configure softdog as a watchdog device and start automatic at boot time (all nodes):

echo softdog > /etc/modules-load.d/softdog.conf
/sbin/modprobe softdog

3- Change the SBD configuration SBD_DEVICE to point to the shared disk (all nodes):

vi /etc/sysconfig/sbd
Change:
SBD_DEVICE=”/dev/xvdb” # /dev/xvdb is the shared disk
SBD_OPTS=”-n node1″ # if cluster node name is different from hostname this option must be used

4- Create the SBD device (just in one node)

pcs stonith sbd device setup –device=/dev/xvdb

Enable SBD service (all nodes):

systemctl enable –now sbd

SBD is configured. The Pacemaker STONITH fence can be created (just one node):

pcs stonith create sbd_fencing fence_sbd devices=/dev/xvdb

To test is the SBD is working:

pcs stonith fence node2

node2 should be rebooted.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s