Product SiteDocumentation Site

Pacemaker 1.1

Clusters from Scratch

Creating Active/Passive and Active/Active Clusters on Fedora

Edition 5

Andrew Beekhof

Primary author 
Red Hat

Raoul Scarazzini

Italian translation 

Dan Frîncu

Romanian translation 

Legal Notice

Copyright © 2009-2012 Andrew Beekhof.
The text of and illustrations in this document are licensed under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA")[1].
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.

Abstract

The purpose of this document is to provide a start-to-finish guide to building an example active/passive cluster with Pacemaker and show how it can be converted to an active/active one.
The example cluster will use:
  1. Fedora 17 as the host operating system
  2. Corosync to provide messaging and membership services,
  3. Pacemaker to perform resource management,
  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 Fedora 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.

Table of Contents

Preface
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. Pacemaker Architecture
1.3.1. Internal Components
1.4. Types of Pacemaker Clusters
2. Installation
2.1. OS Installation
2.2. Post Installation Tasks
2.2.1. Networking
2.2.2. Leaving the Console
2.2.3. Security Shortcuts
2.2.4. Short Node Names
2.3. Before You Continue
2.3.1. Finalize Networking
2.3.2. Configure SSH
2.4. Cluster Software Installation
2.4.1. Install the Cluster Software
2.4.2. Install the Cluster Management Software
2.5. Setup
2.5.1. Enable pcs Daemon
2.5.2. Notes on Multicast Address Assignment
2.5.3. Configuring Corosync
3. Pacemaker Tools
3.1. Using Pacemaker Tools
4. Verify Cluster Installation
4.1. Start the Cluster
4.2. Verify Corosync Installation
4.3. Verify Pacemaker Installation
5. Creating an Active/Passive Cluster
5.1. Exploring the Existing Configuration
5.2. Adding a Resource
5.3. Perform a Failover
5.3.1. Quorum and Two-Node Clusters
5.3.2. Prevent Resources from Moving after Recovery
6. Apache - Adding More Services
6.1. Forward
6.2. Installation
6.3. Preparation
6.4. Enable the Apache status URL
6.5. Update the Configuration
6.6. Ensuring Resources Run on the Same Host
6.7. Controlling Resource Start/Stop Ordering
6.8. Specifying a Preferred Location
6.9. Manually Moving Resources Around the Cluster
6.9.1. Giving Control Back to the Cluster
7. Replicated Storage with DRBD
7.1. Background
7.2. Install the DRBD Packages
7.3. Configure DRBD
7.3.1. Create A Partition for DRBD
7.3.2. Write the DRBD Config
7.3.3. Initialize and Load DRBD
7.3.4. Populate DRBD with Data
7.4. Configure the Cluster for DRBD
7.4.1. Testing Migration
8. Conversion to Active/Active
8.1. Requirements
8.1.1. Installing the required Software
8.2. Create a GFS2 Filesystem
8.2.1. Preparation
8.2.2. Create and Populate an GFS2 Partition
8.3. Reconfigure the Cluster for GFS2
8.4. Reconfigure Pacemaker for Active/Active
8.4.1. Testing Recovery
9. Configure STONITH
9.1. What Is STONITH
9.2. What STONITH Device Should You Use
9.3. Configuring STONITH
9.4. Example
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
Index

List of Figures

1.1. The Pacemaker Stack
1.2. Internal Components
1.3. Active/Passive Redundancy
1.4. Shared Failover
1.5. N to N Redundancy

List of Examples

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