本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
集群配置
更新用户hacluster
密码
更改两个节点haclustser
上的用户密码,如以下示例所示:
[root@prihana ~]# passwd hacluster [root@sechana ~]# passwd hacluster
启动并启用pcs
服务
以下命令在两个节点上启动和启用该pcs
服务:
[root@prihana ~]# systemctl start pcsd.service [root@prihana ~]# systemctl enable pcsd.service
使用用户 hacluster 对电脑进行身份验证
以下命令pcs
向集群中节点pcs
上的守护程序进行身份验证。两个节点hacluster
上的pcs
管理用户名必须使用相同的密码。
RHEL 7.x
[root@prihana ~]# pcs cluster auth prihana sechana Username: hacluster Password: sechana: Authorized prihana: Authorized [root@prihana ~]#
RHEL 8.x
[root@<host1> ~]# pcs host auth prihana sechana Username: hacluster Password: sechana: Authorized prihana: Authorized [root@<host1> ~]#
查看与集群操作冲突的实例设置
为确保重启是可预测的,我们建议禁用简化的自动恢复,不要为属于 pacemaker 集群的实例配置基于 Amazon CloudWatch 操作的恢复。使用以下命令禁用简化的自动恢复。
aws ec2 modify-instance-maintenance-options --instance-id i-0abcdef1234567890 --auto-recovery disabled
您必须确保对属于起搏器集群的 Amazon EC2 实例禁用停止保护。使用以下命令禁用停止保护。
aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --no-disable-api-stop
设置集群
以下命令配置群集配置文件并同步两个节点上的配置。
pcs cluster setup –name rhelhanaha prihana sechana [rooteprihana~]pcs cluster setup --name rhelhanaha prihana sechana Destroying cluster on nodes: prihana, sechana... sechana: Stopping Cluster (pacemaker)... prihana: Stopping Cluster (pacemaker)... sechana: Successfully destroyed cluster prihana: Successfully destroyed cluster Sending 'pacemaker_remote authkey' to iprihana', 'sechana' prihana: successful distribution of the file 'pacemaker remote authkey' sechana: successful distribution of the file 'pacemaker_remote authkey' Sending cluster config files to the nodes... prihana: Succeeded sechana: Succeeded Synchronizing pcsd certificates on nodes prihana, sechana... saphdbdbe2: Success prihana: Success Restarting pcsd on the nodes in order to reload the certificates... sechana: Success prihana: Success
启用并启动集群
以下命令启用和启动集群:
pcs cluster enable –all root@prihana etc]# pcs cluster enable --all prihana: Cluster Enabled sechana: Cluster Enabled
pcs cluster start –all [root@prihana etc]# pcs cluster start --all prihana: Starting Cluster (corosync)... sechana: Starting Cluster (corosync)... sechana: Starting Cluster (pacemaker)... prihana: Starting Cluster (pacemaker)... [rooteprihana etc]# I
增加 corosync 图腾令牌超时时间
RHEL 7.x
-
编辑所有群集节点中的
/etc/corosync/corosync.conf
文件并增加或添加令牌的值,如以下示例所示。totem { version: 2 secauth: off cluster_name: my-rhel-sap-cluster transport: udpu rrp_mode: passive token: 30000 <------ Value to be set }
-
只需在一个群集节点中运行以下命令即可重新加载。
corosync
这不需要任何停机时间。# pcs cluster reload corosync
-
运行以下命令以确认您的更改处于活动状态。
# corosync-cmapctl | grep totem.token Runtime.config.totem.token (u32) = 30000
RHEL 8.x
运行以下命令以延长corosync
令牌超时时间。
# pcs cluster config update totem token=29000