Creating Active/Passive and Active/Active Clusters on Fedora
Edition 5
Andrew Beekhof
Primary author
Red Hatandrew@beekhof.net Raoul Scarazzini
Italian translation rasca@miamammausalinux.org Dan Frîncu
Romanian translation df.cluster@gmail.com
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.
All substantive modifications (including deletions) be either clearly marked up in the document or else described in an attachment to the document.
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:
Fedora 13 as the host operating system
Corosync to provide messaging and membership services,
Pacemaker to perform resource management,
DRBD as a cost-effective alternative to shared storage,
GFS2 as the cluster filesystem (in active/active mode)
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
Preface1. Document Conventions1.1. Typographic Conventions1.2. Pull-quote Conventions1.3. Notes and Warnings2. We Need Feedback!1. Read-Me-First1.1. The Scope of this Document1.2. What Is Pacemaker?1.3. Pacemaker Architecture1.3.1. Internal Components1.4. Types of Pacemaker Clusters2. Installation2.1. OS Installation2.2. Cluster Software Installation2.2.1. Security Shortcuts2.2.2. Install the Cluster Software2.3. Before You Continue2.4. Setup2.4.1. Finalize Networking2.4.2. Configure SSH2.4.3. Short Node Names2.4.4. Configuring Corosync2.4.5. Propagate the Configuration3. Verify Cluster Installation3.1. Verify Corosync Installation3.2. Verify Pacemaker Installation4. Pacemaker Tools4.1. Using Pacemaker Tools5. Creating an Active/Passive Cluster5.1. Exploring the Existing Configuration5.2. Adding a Resource5.3. Perform a Failover5.3.1. Quorum and Two-Node Clusters5.3.2. Prevent Resources from Moving after Recovery6. Apache - Adding More Services6.1. Forward6.2. Installation6.3. Preparation6.4. Enable the Apache status URL6.5. Update the Configuration6.6. Ensuring Resources Run on the Same Host6.7. Controlling Resource Start/Stop Ordering6.8. Specifying a Preferred Location6.9. Manually Moving Resources Around the Cluster6.9.1. Giving Control Back to the Cluster7. Replicated Storage with DRBD7.1. Background7.2. Install the DRBD Packages7.3. Configure DRBD7.3.1. Create A Partition for DRBD7.3.2. Write the DRBD Config7.3.3. Initialize and Load DRBD7.3.4. Populate DRBD with Data7.4. Configure the Cluster for DRBD7.4.1. Testing Migration8. Conversion to Active/Active8.1. Requirements8.2. Adding CMAN Support8.2.1. Installing the required Software8.2.2. Configuring CMAN8.2.3. Redundant Rings8.2.4. Configuring CMAN Fencing8.2.5. Bringing the Cluster Online with CMAN8.3. Create a GFS2 Filesystem8.3.1. Preparation8.3.2. Create and Populate an GFS2 Partition8.4. Reconfigure the Cluster for GFS28.5. Reconfigure Pacemaker for Active/Active8.5.1. Testing Recovery9. Configure STONITH9.1. What Is STONITH9.2. What STONITH Device Should You Use9.3. Configuring STONITH9.4. ExampleA. Configuration RecapA.1. Final Cluster ConfigurationA.2. Node ListA.3. Cluster OptionsA.4. ResourcesA.4.1. Default OptionsA.4.2. FencingA.4.3. Service AddressA.4.4. DRBD - Shared StorageA.4.5. Cluster FilesystemA.4.6. ApacheB. Sample Corosync ConfigurationC. Further ReadingD. Revision HistoryIndex List of Figures
1.1. Conceptual Stack Overview1.2. The Pacemaker Stack1.3. Internal Components1.4. Active/Passive Redundancy1.5. N to N Redundancy2.1. Installation: Good choice2.2. Fedora Installation - Storage Devices2.3. Fedora Installation - Hostname2.4. Fedora Installation - Installation Type2.5. Fedora Installation - Default Partitioning2.6. Fedora Installation - Customize Partitioning2.7. Fedora Installation - Bootloader2.8. Fedora Installation - Software2.9. Fedora Installation - Installing2.10. Fedora Installation - Installation Complete2.11. Fedora Installation - First Boot2.12. Fedora Installation - Create Non-privileged User2.13. Fedora Installation - Date and Time2.14. Fedora Installation - Customize Networking2.15. Fedora Installation - Specify Network Preferences2.16. Fedora Installation - Activate Networking2.17. Fedora Installation - Bring up the Terminal