Installing Pacemaker Corosync Cluster on RHEL 8
Installing Pacemaker Corosync Cluster on RHEL 8
RHEL 8.7
Setting Media ISO repository
・ Configuring Yum Repositories
Enable High Availability Repository
subscription-manager register |
Configuring Network
・ Configuring Network Bonding on RHEL 7,8
nmcli con add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=1000" |
Configuring hosts resolve.
cat >>/etc/hosts <<EOF |
Installing cluster software
On each node in the cluster, install the Red Hat High Availability Add-On software packages along with all available fence agents from the High Availability channel.
dnf -y install pcs pacemaker fence-agents-all |
If you are running the firewalld daemon, execute the following commands to enable the ports that are required by the Red Hat High Availability Add-On.
firewall-cmd --permanent --add-service=high-availability |
In order to use pcs to configure the cluster and communicate among the nodes, you must set a password on each node for the user ID hacluster, which is the pcs administration account. It is recommended that the password for user hacluster be the same on each node.
echo hacluster | passwd hacluster --stdin |
Before the cluster can be configured, the pcsd daemon must be started and enabled to boot on startup on each node. This daemon works with the pcs command to manage configuration across the nodes in the cluster.
On each node in the cluster, execute the following commands to start the pcsd service and to enable pcsd at system start.
systemctl start pcsd.service |
(Recommended) To install the pcp-zeroconf package, PCP is Red Hat’s recommended resource-monitoring tool for RHEL systems.
dnf -y install pcp-zeroconf |
Creating a high availability cluster
Authenticate the pcs user hacluster for each node in the cluster on the node from which you will be running pcs.
pcs host auth node01-hb node02-hb |
Execute the following command from node1-hb to create the two-node cluster cluster that consists of nodes node1-hb and node2-hb. This will propagate the cluster configuration files to both nodes in the cluster. This command includes the --start option, which will start the cluster services on both nodes in the cluster.
pcs cluster setup my_cluster --start node01-hb node02-hb |
Enable the cluster services to run on each node in the cluster when the node is booted.
pcs cluster enable --all |
You can display the current status of the cluster with the pcs cluster status command.
pcs cluster status |
Creating a high availability cluster with multiple links
pcs cluster setup my_twolink_cluster node01-hb addr=100.100.100.211 addr=100.100.200.211 node02-hb addr=100.100.100.212 addr=100.100.200.212 |
If you use NIC binding, you do not need to configure multiple links.
Configuring STONITH
Test the IPMI interface is reachable using the default port 623:
nmap -sU -p623 192.168.3.99 |
Finally you can safely test your configuration by printing the chassis status on each node remotely.
ipmitool -I lanplus -H 192.168.3.99 -U Administrator -P 60142058 -v chassis status |
Set up a password script instead of directly using password.
cat >/usr/local/bin/IPMI_password_node01 <<EOF |
In a 2-node cluster it may happen that both nodes are unable to contact each other and then each node tries to fence the other one. But can't reboot both nodes at the same time since that will result in downtime and possibly harm cluster integrity. To avoid this need to configure a different delay (e.g., one without delay, and the other one with at least a 10 second delay).
pcs stonith create node01_ilo fence_ilo4 ipaddr="192.168.3.99" \ |
Unwanted fencing might happen also when a node "commit suicide", i.e., shut itself down because it was not able to contact the other node of the cluster. This is an unwanted situation because all nodes of a cluster might be fenced at the same time. To avoid this should set a constraint to prevent a node's stonith resource from running on the cluster node itself:
pcs constraint location node01_ilo avoids node1-hb |
To prevent unwanted fencing in the event of minor network outages, increase the totem token timeout to at least 5 seconds by editing /etc/corosync/corosync.conf as follows:
totem { |
Then sync this config file to all other cluster nodes and reload corosync:
pcs cluster sync |
Now that fencing is configured, set the stonith property to true to enable it:
pcs property set stonith-enabled=true |
Once the fence device has been configured in the cluster with the same options that worked manually and the cluster has been started, test fencing with the pcs stonith fence command from any node (or even multiple times from different nodes), as in the following example. The pcs stonith fence command reads the cluster configuration from the CIB and calls the fence agent as configured to execute the fence action. This verifies that the cluster configuration is correct.
pcs stonith fence node01-hb |
Create a kdump fence.
systemctl is-enabled kdump |
Monitor the link status of a network interface
pcs resource create bond0-monitor ethmonitor interface=bond0 --clone |
Creating oracle database resources
・ Oracle Database in Pacemaker
Configuring constraints to prevent resources failling back
pcs constraint show --full |



