Show Table of Contents
8.6. 隔离 Controller 节点
隔离(fencing)就是把一个节点和集群中的其它节点进行隔离来保护整个集群和它的资源。如果没有隔离功能,一个有问题的节点可能会导致集群中的数据被破坏。
director 使用 Pacemaker 来为 Controller 节点提供高可用性集群。Pacemaker 使用 STONITH(Shoot-The-Other-Node-In-The-Head)进程来隔离有问题的节点。在默认情况下,STONITH 在集群中被禁用,您需要手工配置来使 Pacemaker 可以控制集群中的每个节点的电源管理。
注意
使用 director 上的
stack 用户,以 heat-admin 用户身份登录到每个节点。Overcloud 的创建过程会自动把 stack 用户的 SSH 密钥复制给每个节点的 heat-admin 用户。
运行
pcs status 验证您有一个正在运行的集群:
$ sudo pcs status Cluster name: openstackHA Last updated: Wed Jun 24 12:40:27 2015 Last change: Wed Jun 24 11:36:18 2015 Stack: corosync Current DC: lb-c1a2 (2) - partition with quorum Version: 1.1.12-a14efad 3 Nodes configured 141 Resources configured
使用
pcs property show 验证 stonith 被禁用:
$ sudo pcs property show
Cluster Properties:
cluster-infrastructure: corosync
cluster-name: openstackHA
dc-version: 1.1.12-a14efad
have-watchdog: false
stonith-enabled: false
Controller 节点为 director 支持的不同电源管理设备包括了一组隔离代理。这包括:
表 8.1. 隔离代理
|
设备
|
类型
|
|---|---|
fence_ipmilan
|
Intelligent Platform Management Interface (IPMI)
|
fence_idrac, fence_drac5
|
Dell Remote Access Controller (DRAC)
|
fence_ilo
|
Integrated Lights-Out (iLO)
|
fence_ucs
| |
fence_xvm, fence_virt
|
Libvirt 和 SSH
|
这一节的剩余部分会使用 IPMI 代理(
fence_ipmilan)作为示例。
查看 Pacemaker 支持的完整 IPMI 选项列表:
$ sudo pcs stonith describe fence_ipmilan
每个节点都需要配置 IPMI 设备来控制电源管理。这包括为每个节点在 pacemaker 中添加一个
stonith 设备。在集群中使用以下命令:
对于 Controller 节点 1:
$ sudo pcs stonith create my-ipmilan-for-controller01 fence_ipmilan pcmk_host_list=overcloud-controller-0 ipaddr=192.0.2.205 login=admin passwd=p@55w0rd! lanplus=1 cipher=1 op monitor interval=60s $ sudo pcs constraint location my-ipmilan-for-controller01 avoids overcloud-controller-0
对于 Controller 节点 2:
$ sudo pcs stonith create my-ipmilan-for-controller02 fence_ipmilan pcmk_host_list=overcloud-controller-1 ipaddr=192.0.2.206 login=admin passwd=p@55w0rd! lanplus=1 cipher=1 op monitor interval=60s $ sudo pcs constraint location my-ipmilan-for-controller02 avoids overcloud-controller-1
对于 Controller 节点 3:
$ sudo pcs stonith create my-ipmilan-for-controller03 fence_ipmilan pcmk_host_list=overcloud-controller-2 ipaddr=192.0.2.206 login=admin passwd=p@55w0rd! lanplus=1 cipher=1 op monitor interval=60s $ sudo pcs constraint location my-ipmilan-for-controller03 avoids overcloud-controller-2
注意
每个示例中的第二个命令保证了节点不会隔离自己。
运行以下命令来设置所有 stonith 资源:
$ sudo pcs stonith show
运行以下命令来查看一个特定的 stonith 资源:
$ sudo pcs stonith show [stonith-name]
最后,把
stonith 属性设置为 true 来启用隔离功能:
$ sudo pcs property set stonith-enabled=true
验证属性:
$ sudo pcs property show

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.