本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
群集配置
更新用户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
集群中节点上的守护程序。的用户名pcs
管理必须是hacluster
在具有相同密码的两个节点上。
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> ~]#
设置集群
以下命令配置群集配置文件并同步两个节点上的配置。
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