7.5. 在新节点上配置 pacemaker 集群
先决条件
-
您已在计划的集群节点上配置了
RHEL 高可用性存储库。
流程
从 High Availability 存储库安装红帽高可用性附加组件软件包。选择您在现有节点上配置的隔离代理,并在新节点上执行安装:
[root]# dnf install pcs pacemaker fence-agents-<model>启动并启用
pcsd服务:[root]# systemctl enable --now pcsd.service可选:如果您正在运行
firewalld服务,请启用红帽高可用性附加组件所需的端口:[root]# firewall-cmd --add-service=high-availability [root]# firewall-cmd --runtime-to-permanent为用户
hacluster设置密码:[root]# passwd hacluster为现有集群中新节点验证用户
hacluster。在现有节点上运行,如 node1 :[root]# pcs host auth <node3> Username: hacluster Password: <node3>: Authorized-
输入带有或不使用 FQDN 的节点名称,如
/etc/hosts文件中定义的。 -
在提示符后输入
hacluster用户密码。
-
输入带有或不使用 FQDN 的节点名称,如
在现有集群中添加新节点。这会同步节点之间的集群文件。在现有节点上运行,如 node1 :
[root]# pcs cluster node add <node3> No addresses specified for host 'node3', using 'node3' Disabling sbd... node3: sbd disabled Sending 'corosync authkey', 'pacemaker authkey' to 'node3' node3: successful distribution of the file 'corosync authkey' node3: successful distribution of the file 'pacemaker authkey' Sending updated corosync.conf to nodes... node1: Succeeded node3: Succeeded node2: Succeeded node1: Corosync configuration reloaded在新节点上启动集群。在新节点上运行,例如 node3:
[root]# pcs cluster start Starting Cluster...在系统引导时自动启动集群,这样可启用
corosync和pacemaker服务。如果您希望在节点重启后手动控制集群的启动,请跳过这一步。在新节点上运行:[root]# pcs cluster enable
验证
检查新节点是否可作为集群成员使用:
[root]# pcs cluster status Cluster Status: Cluster Summary: * Stack: corosync (Pacemaker is running) … * 3 nodes configured * 7 resource instances configured Node List: * Online: [ node1 node2 node3 ] PCSD Status: node3: Online node2: Online node1: Online
后续步骤
- 为新节点配置隔离设备。请参阅 在红帽高可用性集群中配置隔离。
- 在进行进一步配置集群前,测试新节点的隔离。如需更多信息,请参阅 如何在红帽高可用性集群中测试隔离设备和隔离配置?