364.1 Hardware and Resource High Availability (weight: 2)

Tech Tutorial: 364.1 Hardware and Resource High Availability (weight: 2) #

Introduction #

In this tutorial, we’ll explore the topic of Hardware and Resource High Availability (HA) in depth as it’s a crucial component in maintaining the reliability and availability of services in server environments. High Availability refers to the systems or configurations that allow a system to continue functioning for a longer-than-average period of time, typically by reducing downtime and ensuring operational continuity.

The focus will be on Linux environments, where several tools and techniques can be employed to ensure that hardware does not become a single point of failure.

Key Knowledge Areas: #

  • Understanding of HA concepts
  • Redundancy
  • Failover and Fencing
  • Resource management and resource groups
  • Common Address Redundancy Protocol (CARP)
  • High Availability Linux (Heartbeat, Corosync)

Utilities: #

  • pcs
  • crm
  • corosync
  • pacemaker

Step-by-Step Guide #

1. High Availability Concepts #

High Availability systems are designed to ensure an agreed level of operational performance, usually uptime, for a higher than normal period. This is achieved through redundancy and failover solutions.

2. Installing High Availability Tools #

On most Linux distributions, you can install HA tools like Corosync and Pacemaker from the repository. Here’s how to install them on a CentOS system:

sudo yum install pacemaker corosync pcs

After installation, it’s important to enable and start these services:

sudo systemctl enable pcsd.service
sudo systemctl enable corosync
sudo systemctl enable pacemaker
sudo systemctl start pcsd.service
sudo systemctl start corosync
sudo systemctl start pacemaker

3. Authenticating Nodes #

Before configuring HA properties, authenticate all nodes in the cluster:

sudo pcs cluster auth node1 node2 -u hacluster -p password

Replace node1 and node2 with your actual node names and password with the cluster’s password.

4. Creating and Starting the Cluster #

To create and start a cluster with two nodes:

sudo pcs cluster setup --name my_cluster node1 node2
sudo pcs cluster start --all

5. Configuring Corosync and Pacemaker #

Corosync is used for managing cluster membership whereas Pacemaker is for managing resources:

Corosync Configuration: #

Usually handled during setup, but you can check the status and configuration with:

corosync-cfgtool -s
corosync-cmapctl | grep members

Pacemaker Configuration: #

To configure a simple resource (e.g., a virtual IP), use:

sudo pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=192.168.1.100 cidr_netmask=24 op monitor interval=30s

6. Managing Cluster Resources and Groups #

To manage resources effectively:

# Check resource status
sudo pcs status resources

# Moving resources
sudo pcs resource move virtual_ip node1

# Removing resource constraints
sudo pcs constraint remove constraint-id

7. Setting Up Redundancy Using CARP #

While CARP (Common Address Redundancy Protocol) is not commonly used in Linux, similar functionality can be achieved using keepalived:

sudo yum install keepalived
sudo systemctl enable --now keepalived

Configuration of keepalived can be done in /etc/keepalived/keepalived.conf.

Conclusion #

This tutorial covered the essential aspects of setting up and managing High Availability configurations in Linux using tools like Corosync, Pacemaker, and pcs. High Availability is a complex but crucial area in system administration, ensuring minimal downtime and service reliability. With these configurations, systems are better equipped to handle failures gracefully, thus maintaining service continuity.