Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
3.2.3. 新增叢集節點
使用下列程序來新增節點至既有的叢集中。在此範例中,既有的叢集節點為
clusternode-01.example.com
、clusternode-02.example.com
以及 clusternode-03.example.com
。新的節點為 newnode.example.com
。
在需加入至叢集的新節點上執行下列任務。
- 安裝叢集套件;
[root@newnode ~]#
yum install -y pacemaker cman pcs
- 若要避免
corosync
在無cman
的情況下啟用,請執行以下指令:[root@newnode ~]#
chkconfig corosync off
- 為使用者 ID
hacluster
設置一組密碼。建議您使用與叢集中各個節點相同的密碼。[root@newnode ~]#
passwd hacluster
Changing password for user hacluster. New password: Retype new password: passwd: all authentication tokens updated successfully. - 在新節點上啟用
pcsd
:[root@newnode ~]#
service pcsd start
[root@newnode ~]#chkconfig pcsd on
在既有叢集中的節點上執行下列任務。
- 在新的叢集節點上認證使用者
hacluster
。[root@clusternode-01 ~]#
pcs cluster auth newnode.example.com
Username: hacluster Password: newnode.example.com: Authorized - 將新節點加入至既有的叢集中。這項指令亦能使叢集配置檔案
cluster.conf
與叢集中的所有節點同步,包括您要新增的節點。[root@clusternode-01 ~]#
pcs cluster node add newnode.example.com
clusternode-01.example.com: Corosync updated clusternode-02.example.com: Corosync updated clusternode-03.example.com: Corosync updated newnode.example.com: Updated cluster.conf... newnode.example.com: Starting Cluster...
在需加入至叢集的新節點上執行下列任務。
- 在新的節點上,為叢集中所有節點認證使用者
hacluster
。[root@newnode ~]#
pcs cluster auth
Username: hacluster Password: clusternode-01.example.com: Authorized clusternode-02.example.com: Authorized clusternode-03.example.com: Authorized newnode.example.com: Already authorized - 在新節點上啟用叢集服務。
[root@newnode ~]#
pcs cluster start
Starting Cluster... [root@newnode ~]#pcs cluster enable
- 確認您為新的叢集節點配置了隔離裝置。欲取得配置隔離裝置上的相關資訊,請參閱〈章 4, 隔離:配置 STONITH〉。