Author: Madhan Gopalakrishnan | Published on : 11-02-202

High Availability (HA) & Clustering in Linux ensures that critical applications and services remain accessible even in the event of hardware or software failures. It involves multiple nodes working together to provide redundancy, failover, and load balancing.
🎯 Key Objectives
- Minimize downtime ⏳
- Improve reliability ⚙️
- Ensure fault tolerance 🛡️
- Balance workloads ⚖️
1️⃣ High Availability (HA) Clustering Overview
HA clusters operate by monitoring each node, and in case of failure, resources are automatically transferred to a standby node. Components include:
✅ Cluster Nodes – Servers participating in the cluster ✅ Heartbeat Mechanism – Ensures nodes are active and responsive ✅ Quorum – Defines how many nodes need to be active ✅ Failover – Automatic switching of resources ✅ Load Balancing – Distributing workload evenly
2️⃣ Pre-requisites for Each Module
Pacemaker 🏆
- Storage: Shared storage (NFS, iSCSI, DRBD) recommended
- Network Dependence: Requires multicast/unicast communication between nodes
- Compute: Minimum 2 nodes, recommended 3+ for quorum
- IP Requirements: Static IP for each node, virtual/floating IP for failover
Corosync 🔄
- Storage: Not storage-dependent but works well with shared storage setups
- Network Dependence: Low-latency network required, separate cluster communication network recommended
- Compute: Minimum 2 nodes, recommended 3+ for redundancy
- IP Requirements: Unique IPs for each node, network fencing recommended
DRBD (Distributed Replicated Block Device) 💾
- Storage: Requires dedicated block storage on each node
- Network Dependence: High-speed, low-latency network recommended (1Gbps or higher)
- Compute: At least 2 nodes with sufficient disk space
- IP Requirements: Static IPs for storage replication and synchronization
HAProxy (High Availability Proxy) 🌐
- Storage: Not storage-dependent
- Network Dependence: Requires a reliable network with load balancing capability
- Compute: Minimum 2 nodes, recommended additional nodes for scalability
- IP Requirements: Virtual/floating IP for load balancing and failover
3️⃣ Packages for HA Clustering
Pacemaker 🏆
- Package:
pacemaker - Purpose: Manages cluster resources and failover
- Installation Command:
sudo apt install pacemaker -y # Debian/Ubuntu sudo yum install pacemaker -y # RHEL/CentOS sudo dnf install pacemaker -y # Fedora - Basic Commands:
sudo systemctl enable pacemaker sudo systemctl start pacemaker sudo crm_mon -1 # Check cluster status
Corosync 🔄
- Package:
corosync - Purpose: Provides messaging layer for cluster communication
- Installation Command:
sudo apt install corosync -y sudo yum install corosync -y - Basic Commands:
sudo systemctl start corosync sudo systemctl enable corosync sudo corosync-cfgtool -s # Show cluster status
DRBD (Distributed Replicated Block Device) 💾
- Package:
drbd-utils - Purpose: Provides block-level replication for HA storage
- Installation Command:
sudo apt install drbd-utils -y sudo yum install drbd-utils -y - Basic Commands:
sudo drbdadm create-md my_resource sudo drbdadm up my_resource sudo drbdadm status
HAProxy (High Availability Proxy) 🌐
- Package:
haproxy - Purpose: Provides high availability, load balancing, and proxying for TCP and HTTP-based applications.
- Installation Command:
sudo apt install haproxy -y # Debian/Ubuntu sudo yum install haproxy -y # RHEL/CentOS - Basic Commands:
sudo systemctl start haproxy sudo systemctl enable haproxy sudo systemctl status haproxy
🚀 Conclusion Linux HA Clustering with Pacemaker, Corosync, and HAProxy is a powerful solution to ensure high availability, fault tolerance, and redundancy. By mastering these tools, you can build a resilient infrastructure with minimal downtime!
🔗Other Topics Links Related to Linux High Avilability








