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 13 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)
  6. The crm shell for displaying the configuration and making changes
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. Cluster Software Installation
2.2.1. Security Shortcuts
2.2.2. Install the Cluster Software
2.3. Before You Continue
2.4. Setup
2.4.1. Finalize Networking
2.4.2. Configure SSH
2.4.3. Short Node Names
2.4.4. Configuring Corosync
2.4.5. Propagate the Configuration
3. Verify Cluster Installation
3.1. Verify Corosync Installation
3.2. Verify Pacemaker Installation
4. Pacemaker Tools
4.1. Using Pacemaker Tools
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.2. Adding CMAN Support
8.2.1. Installing the required Software
8.2.2. Configuring CMAN
8.2.3. Redundant Rings
8.2.4. Configuring CMAN Fencing
8.2.5. Bringing the Cluster Online with CMAN
8.3. Create a GFS2 Filesystem
8.3.1. Preparation
8.3.2. Create and Populate an GFS2 Partition
8.4. Reconfigure the Cluster for GFS2
8.5. Reconfigure Pacemaker for Active/Active
8.5.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. Conceptual Stack Overview
1.2. The Pacemaker Stack
1.3. Internal Components
1.4. Active/Passive Redundancy
1.5. N to N Redundancy
2.1. Installation: Good choice
2.2. Fedora Installation - Storage Devices
2.3. Fedora Installation - Hostname
2.4. Fedora Installation - Installation Type
2.5. Fedora Installation - Default Partitioning
2.6. Fedora Installation - Customize Partitioning
2.7. Fedora Installation - Bootloader
2.8. Fedora Installation - Software
2.9. Fedora Installation - Installing
2.10. Fedora Installation - Installation Complete
2.11. Fedora Installation - First Boot
2.12. Fedora Installation - Create Non-privileged User
2.13. Fedora Installation - Date and Time
2.14. Fedora Installation - Customize Networking
2.15. Fedora Installation - Specify Network Preferences
2.16. Fedora Installation - Activate Networking
2.17. Fedora Installation - Bring up the Terminal