Product SiteDocumentation Site

Pacemaker 1.1

从头开始搭建集群

在Fedora上面创建主/主和主备集群

版 5

Andrew Beekhof

作者 
Red Hat

Raoul Scarazzini

意大利语翻译 

Dan Frîncu

Romanian translation 

法律通告

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.

摘要

本文档的主要目的是提供一站式指南,教您如何使用Pacemaker创建一个主/备模式的集群并把它转换到主/主模式。
示例集群会使用以下软件:
  1. Fedora 13 as the host operating system
  2. Corosync作为通信层和提供关系管理服务
  3. Pacemaker来实现资源管理
  4. DRBD 作为一个经济的共享存储方案
  5. GFS2 作为集群文件系统(主/主模式中)
  6. crm shell 来显示并修改配置文件
虽然给出了图形化安装Fedora的过程,并且有很多截图,但是本文的主要是靠命令来操作,包括为什么要运行这个命令和这些操作产生的结果。(译者注:本文中基本是crm shell来操作的,这里应该是老版本文档的遗留)

目录

前言
1. 文档约定
1.1. 排版约定
1.2. 抬升式引用约定
1.3. 备注及警告
2. We Need Feedback!
1. Read-Me-First
1.1. 本文范围
1.2. 什么是Pacemaker?
1.3. Pacemaker 架构
1.3.1. 内部组件
1.4. Pacemaker 集群的种类
2. 安装
2.1. 安装操作系统
2.2. 集群软件安装
2.2.1. 安全提示
2.2.2. 安装集群软件
2.3. 写在开始之前
2.4. 安装
2.4.1. 设定网络
2.4.2. 配置SSH
2.4.3. 简化节点名称
2.4.4. 配置 Corosync
2.4.5. 传送配置文件
3. 检验集群的安装
3.1. 检验Corosync的安装
3.2. 检查Pacemaker的安装
4. Pacemaker Tools
4.1. 使用Pacemaker工具
5. 创建一个主/备集群
5.1. 浏览现有配置
5.2. 添加一个资源
5.3. 做一次失效备援
5.3.1. 法定人数和双节点集群
5.3.2. 防止资源在节点恢复后移动
6. Apache - 添加更多的服务
6.1. Forward
6.2. 安装Apache
6.3. 准备工作
6.4. 开启 Apache status URL
6.5. 更新配置文件
6.6. 确保资源在同一个节点运行
6.7. 控制资源的启动停止顺序
6.8. 指定优先的 Location
6.9. 在集群中手工地移动资源
6.9.1. 把控制权交还给集群
7. 用DRBD同步存储
7.1. Background
7.2. 安装DRBD软件包
7.3. 配置DRBD
7.3.1. 为DRBD创建一个分区
7.3.2. 配置DRBD
7.3.3. 初始化并载入DRBD
7.3.4. 向DRBD中添加数据
7.4. 在集群中配置DRBD
7.4.1. 迁移测试
8. 转变为Active/Active
8.1. 需求
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. 创建一个 GFS2 文件系统
8.3.1. 准备工作
8.3.2. 创建并迁移数据到 GFS2 分区
8.4. 8.5. 重新为集群配置GFS2
8.5. 重新配置 Pacemaker 为 Active/Active
8.5.1. 恢复测试
9. 配置 STONITH
9.1. What Is STONITH
9.2. 你该用什么样的STONITH设备。
9.3. 配置STONITH
9.4. 例子
A. 配置扼要重述
A.1. 最终的集群配置文件
A.2. 节点列表
A.3. 集群选项
A.4. 资源
A.4.1. 默认选项
A.4.2. 隔离
A.4.3. 服务地址
A.4.4. DRBD - 共享存储
A.4.5. 集群文件系统
A.4.6. Apache
B. Sample Corosync Configuration
C. 延伸阅读
D. 修订历史
索引

插图清单

1.1. 概念层次总览
1.2. Pacemaker 层次
1.3. 内部组件
1.4. Active/Passive 冗余
1.5. N to N 冗余
2.1. Installation: Good choice
2.2. 安装Fedora - 存储设备
2.3. 安装Fedora -机器名
2.4. 安装Fedora - 安装类型
2.5. 安装Fedora - 默认分区
2.6. 安装Fedora - 自定义分区
2.7. 安装Fedora - Bootloader
2.8. 安装Fedora - 软件
2.9. 安装Fedora - 安装中
2.10. 安装Fedora - 安装完成
2.11. 安装Fedora - 第一次启动
2.12. 安装Fedora - 创建非特权用户
2.13. 安装Fedora - 日期和时间
2.14. 安装Fedora -自定义网络
2.15. 安装Fedora - 指定网络参数
2.16. 安装Fedora - 激活网络
2.17. 安装Fedora - 打开终端