RHEL 8 Pacemaker PCS Cluster Installation and Configuration Guide
RHEL 8 Pacemaker PCS Cluster Installation and Configuration Guide
RHEL 8 Pacemaker PCS Cluster
High availability (HA) is a critical requirement for enterprise applications and services. Red Hat Enterprise Linux 8 (RHEL 8) provides a robust clustering solution using Pacemaker, Corosync, and the PCS (Pacemaker Configuration System) management utility.
This article explains the architecture, installation, configuration, and management of a Pacemaker PCS cluster on RHEL 8.
What is a Pacemaker PCS Cluster?
A Pacemaker cluster is a high-availability solution that monitors cluster nodes and automatically recovers services in the event of a failure.
The cluster stack consists of:
Pacemaker – Resource manager responsible for failover decisions.
Corosync – Cluster communication and membership service.
PCS (Pacemaker Configuration System) – Command-line and web-based management tool.
Fence Agents – Prevent split-brain situations by isolating failed nodes.
Cluster Architecture
Prerequisites
Before configuring the cluster:
Two or more RHEL 8 servers
Root or sudo access
Static IP addresses
Proper hostname resolution
Time synchronization enabled
High Availability repository enabled
Verify hostnames:
hostnamectl
Verify connectivity:
ping node1
ping node2
Install Required Packages
Enable the High Availability repository:
subscription-manager repos --enable=rhel-8-for-x86_64-highavailability-rpms
Install cluster packages on all nodes:
dnf install pcs pacemaker corosync fence-agents-all -y
Enable and Start PCS Service
Start and enable the PCS daemon:
systemctl enable pcsd
systemctl start pcsd
Verify service status:
systemctl status pcsd
Set Password for the Cluster User
PCS uses the hacluster account for authentication.
passwd hacluster
Configure the same password on all cluster nodes.
Authenticate Cluster Nodes
From one node:
pcs host auth node1 node2 -u hacluster
Example:
pcs host auth node1.example.com node2.example.com -u hacluster
Successful authentication confirms communication between nodes.
Create the Cluster
Create a cluster named prodcluster:
pcs cluster setup prodcluster node1 node2
Start the cluster:
pcs cluster start --all
Enable cluster startup after reboot:
pcs cluster enable --all
Verify Cluster Status
Check overall cluster health:
pcs status
Example output:
Cluster name: prodcluster
Node List:
Online: [ node1 node2 ]
Full List of Resources:
No resources configured
Configure STONITH (Fencing)
STONITH (Shoot The Other Node In The Head) is used to isolate failed nodes and prevent data corruption.
Check current fencing status:
pcs property show stonith-enabled
For production environments, configure an appropriate fencing device.
Example:
pcs stonith create ipmi-fence fence_ipmilan \
ipaddr=192.168.1.100 \
login=admin \
passwd=password \
lanplus=1
For lab environments only:
pcs property set stonith-enabled=false
Warning: Disabling STONITH is not recommended in production.
Create a Virtual IP Resource
A Virtual IP (VIP) allows applications to continue operating after failover.
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \
ip=192.168.1.200 cidr_netmask=24 \
op monitor interval=30s
Verify resource status:
pcs status resources
Create an Application Resource
Example Apache service resource:
pcs resource create ApacheService \
systemd:httpd \
op monitor interval=30s
Check resources:
pcs resource show
Resource Failover Testing
Move a resource manually:
pcs resource move ApacheService node2
Clear migration constraints:
pcs resource clear ApacheService
Cluster Maintenance Commands
Check Cluster Status
pcs status
View Configuration
pcs config
Stop Cluster
pcs cluster stop --all
Start Cluster
pcs cluster start --all
Disable Cluster Startup
pcs cluster disable --all
View Node Status
pcs node status
Troubleshooting
Check Cluster Logs
journalctl -u pacemaker
journalctl -u corosync
Verify Corosync
corosync-cfgtool -s
Check Cluster Health
crm_mon -1
Validate Configuration
pcs status --full
Common Use Cases
Database High Availability (Oracle, PostgreSQL, MySQL)
Web Server Failover
NFS High Availability
SAP Deployments
Enterprise Application Clusters
Virtual IP Management
Best Practices
Always configure STONITH in production.
Use redundant network paths for cluster communication.
Synchronize time using NTP or Chrony.
Monitor cluster logs regularly.
Test failover procedures periodically.
Use shared storage only when required by the application.
Conclusion
Pacemaker and PCS provide a powerful high-availability framework for RHEL 8 environments. By combining Pacemaker's resource management capabilities with Corosync's cluster communication services, administrators can build resilient infrastructures capable of automatically recovering from node failures and minimizing application downtime. Proper fencing, resource monitoring, and regular failover testing are essential for maintaining a reliable production cluster.