2 Installing and Configuring Pacemaker and Corosync
This chapter describes how to set up and configure the Pacemaker and Corosync features to create a high availability (HA) cluster that delivers continuous access to services running across multiple nodes.
Enabling Access to the Pacemaker and Corosync Packages
The Pacemaker and Corosync packages are available on the Oracle Linux yum server in the
ol8_addons
repository, or on the Unbreakable Linux Network (ULN) in the ol8_arch_addons
channel.
Some dependency packages may be required from the
ol8_appstream
and
ol8_baseos_latest
yum repositories, or from
the
ol8_arch_appstream
and
ol8_arch_baseos_latest
channels on ULN.
Enabling Repositories With ULN
If you are registered to use ULN, use the ULN web interface to subscribe the system to the appropriate channels.
To subscribe to the ULN channels:
-
Log in to https://linux.oracle.com with your ULN user name and password.
-
On the Systems tab, click the link named for the system in the list of registered machines.
-
On the System Details page, click Manage Subscriptions.
-
On the System Summary page, select each required channel from the list of available channels and click the right arrow to move the channel to the list of subscribed channels. Subscribe the system to the following channels:
-
ol8_arch_appstream
-
ol8_arch_baseos_latest
-
ol8_arch_addons
-
-
Click Save Subscriptions.
Enabling Repositories With the Oracle Linux Yum Server
If you are using the Oracle Linux yum server for system updates, enable the appropriate Oracle Linux yum repositories.
To enable the yum repositories:
-
Enable the following yum repositories:
-
ol8_appstream
-
ol8_baseos_latest
-
ol8_addons
Use the dnf config-manager tool to enable the yum repositories:
sudo dnf config-manager --enable ol8_appstream ol8_baseos_latest ol8_addons
-
Installing and Enabling the Pacemaker and Corosync Service
On each node in the cluster, install the pcs
and pacemaker
software packages, along with
all of the available resource and fence agents from the Oracle Linux yum server or
from ULN, for example:
sudo dnf install pcs pacemaker resource-agents fence-agents-all
If you are running firewalld, add the
high-availability
service on each of the
nodes so that the service components are able to communicate
across the network. Per the command that is run in the following
example, this step typically enables the following ports: TCP
port 2224 (used by the pcs
daemon), port 3121
(for Pacemaker Remote nodes), port 21064 (for DLM resources),
and UDP ports 5405 (for Corosync clustering), and 5404 (for
Corosync multicast, if configured):
sudo firewall-cmd --permanent --add-service=high-availability
sudo firewall-cmd --add-service=high-availability
To use the pcs command to configure and
manage your cluster, you must set a password on each node for
the hacluster
user.
Tip:
It is helpful if you set the same password for this user as the password you set for the user on each node.
Use the passwd command on each node to set the password:
sudo passwd hacluster
Note that to use the pcs command, the
pcsd
service must be running on each of the
nodes in the cluster. You can set this service to run and to
start at boot by running the following command:
sudo systemctl enable --now pcsd.service
Note:
When running High Availability Clustering in the cloud, please refer to the following documents: