Product SiteDocumentation Site

Pacemaker 2.0

Clusters from Scratch

Step-by-Step Instructions for Building Your First High-Availability Cluster

Edition 11

Written by the Pacemaker project contributors

Legal Notice

Copyright © 2009-2018 The Pacemaker project contributors.
The text of and illustrations in this document are licensed under version 4.0 or later of the Creative Commons Attribution-ShareAlike International Public License ("CC-BY-SA")[2].
In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
In addition to the requirements of this license, the following activities are looked upon favorably:
  1. If you are distributing Open Publication works on hardcopy or CD-ROM, you provide email notification to the authors of your intent to redistribute at least thirty days before your manuscript or media freeze, to give the authors time to provide updated documents. This notification should describe modifications, if any, made to the document.
  2. All substantive modifications (including deletions) be either clearly marked up in the document or else described in an attachment to the document.
  3. Finally, while it is not mandatory under this license, it is considered good form to offer a free copy of any hardcopy or CD-ROM expression of the author(s) work.


This document provides a step-by-step guide to building a simple high-availability cluster using Pacemaker.
The example cluster will use:
  1. CentOS 7.5 as the host operating system
  2. Corosync to provide messaging and membership services,
  3. Pacemaker 1.1.18 [1]
  4. DRBD as a cost-effective alternative to shared storage,
  5. GFS2 as the cluster filesystem (in active/active mode)
Given the graphical nature of the install process, a number of screenshots are included. However the guide is primarily composed of commands, the reasons for executing them and their expected outputs.

[1] While this guide is part of the document set for Pacemaker 2.0, it demonstrates the version available in the standard CentOS repositories.

Table of Contents

1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
1. Read-Me-First
1.1. The Scope of this Document
1.2. What Is Pacemaker?
1.3. Cluster Architecture
1.4. Pacemaker Architecture
1.5. Node Redundancy Designs
2. Installation
2.1. Install CentOS 7.5
2.1.1. Boot the Install Image
2.1.2. Installation Options
2.1.3. Configure Network
2.1.4. Configure Disk
2.1.5. Configure Time Synchronization
2.1.6. Finish Install
2.2. Configure the OS
2.2.1. Verify Networking
2.2.2. Login Remotely
2.2.3. Apply Updates
2.2.4. Use Short Node Names
2.3. Repeat for Second Node
2.4. Configure Communication Between Nodes
2.4.1. Configure Host Name Resolution
2.4.2. Configure SSH
3. Set up a Cluster
3.1. Simplify Administration With a Cluster Shell
3.2. Install the Cluster Software
3.3. Configure the Cluster Software
3.3.1. Allow cluster services through firewall
3.3.2. Enable pcs Daemon
3.3.3. Configure Corosync
3.4. Explore pcs
4. Start and Verify Cluster
4.1. Start the Cluster
4.2. Verify Corosync Installation
4.3. Verify Pacemaker Installation
4.4. Explore the Existing Configuration
5. Configure Fencing
5.1. What is Fencing?
5.2. Choose a Fence Device
5.3. Configure the Cluster for Fencing
5.4. Example
6. Create an Active/Passive Cluster
6.1. Add a Resource
6.2. Perform a Failover
6.3. Prevent Resources from Moving after Recovery
7. Add Apache HTTP Server as a Cluster Service
7.1. Install Apache
7.2. Create Website Documents
7.3. Enable the Apache status URL
7.4. Configure the Cluster
7.5. Ensure Resources Run on the Same Host
7.6. Ensure Resources Start and Stop in Order
7.7. Prefer One Node Over Another
7.8. Move Resources Manually
8. Replicate Storage Using DRBD
8.1. Install the DRBD Packages
8.2. Allocate a Disk Volume for DRBD
8.3. Configure DRBD
8.4. Initialize DRBD
8.5. Populate the DRBD Disk
8.6. Configure the Cluster for the DRBD device
8.7. Configure the Cluster for the Filesystem
8.8. Test Cluster Failover
9. Convert Storage to Active/Active
9.1. Install Cluster Filesystem Software
9.2. Configure the Cluster for the DLM
9.3. Create and Populate GFS2 Filesystem
9.4. Reconfigure the Cluster for GFS2
9.5. Clone the Filesystem Resource
9.6. Test Failover
A. Configuration Recap
A.1. Final Cluster Configuration
A.2. Node List
A.3. Cluster Options
A.4. Resources
A.4.1. Default Options
A.4.2. Fencing
A.4.3. Service Address
A.4.4. DRBD - Shared Storage
A.4.5. Cluster Filesystem
A.4.6. Apache
B. Sample Corosync Configuration
C. Further Reading
D. Revision History

List of Figures

1.1. Example Cluster Stack
1.2. Internal Components
1.3. Active/Passive Redundancy
1.4. Shared Failover
1.5. N to N Redundancy
2.1. CentOS 7.5 Installation Welcome Screen
2.2. CentOS 7.5 Installation Summary Screen
2.3. CentOS 7.5 Network Interface Screen
2.4. CentOS 7.5 Manual Partitioning Screen
2.5. CentOS 7.5 Console Prompt

List of Examples

4.1. The last XML you’ll see in this document