Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
4.4.3. 添加集群节点
注意
强烈建议您仅在生产环境维护窗口期间将节点添加到现有集群中。这可让您对新节点及其保护配置执行适当的资源和部署测试。
使用以下步骤将新节点添加到现有集群中。在本例中,现有群集节点为
clusternode-01.example.com、cluster node-02.example.com 和 clusternode-03.example.com。新节点为 newnode.example.com。
在加入到集群中的新节点上,执行以下任务。
- 安装集群软件包。如果集群使用 SBD、Booth ticket 管理器或仲裁设备,则必须在新节点上手动安装相应的软件包(
sbd、booth)。-site、corosync-qdevice[root@newnode ~]#
yum install -y pcs fence-agents-all - 如果您正在运行 firewalld 守护进程,请执行以下命令启用红帽高可用性附加组件所需的端口。
#
firewall-cmd --permanent --add-service=high-availability#firewall-cmd --add-service=high-availability - 设置用户 ID
hacluster的密码。建议您为集群中的每个节点使用相同的密码。[root@newnode ~]#
passwd haclusterChanging password for user hacluster. New password: Retype new password: passwd: all authentication tokens updated successfully. - 执行以下命令启动
pcsd服务并在系统启动时启用pcsd:#
systemctl start pcsd.service#systemctl enable pcsd.service
在现有集群中的一个节点上执行以下任务。
- 在新群集节点上验证用户
hacluster。[root@clusternode-01 ~]#
pcs cluster auth newnode.example.comUsername: hacluster Password: newnode.example.com: Authorized - 在现有集群中添加新节点。此命令还会将群集配置文件
corosync.conf同步到集群中的所有节点,包括您要添加的新节点。[root@clusternode-01 ~]#
pcs cluster node add newnode.example.com
在加入到集群中的新节点上,执行以下任务。
- 在新节点上启动并启用集群服务。
[root@newnode ~]#
pcs cluster startStarting Cluster... [root@newnode ~]#pcs cluster enable - 确保您为新集群节点配置并测试隔离设备。有关配置隔离设备的详情请参考 第 5 章 隔离:配置 STONITH。