物理的に違うkvmのサブホストを使用
ホスト名:smb3, IP: 192.168.4.63
ホスト名:smb4, IP: 192.168.4.64
仮想IP: 192.168.4.65
まずは https://www.server-world.info/query?os=CentOS_Stream_9&p=pacemaker&f=1を参考に進めていく。
# dnf –enablerepo=highavailability -y install pacemaker pcs
とインストールが終わった所で、何も設定せず対抗するサブホストにここを参考にしてサブホストにコピーする。さもないとhttps://www.kinryo.net/?p=3602のようにトラブル。
ホスト名で設定していくので
# gedit /etc/host
の最後に
192.168.4.63 smb3 smb3.inpac.jp
192.168.4.64 smb4 smb4.inpac.jp
を追記し保存。これを両ホストに設定
次に設定がダブっているので(IPやhostname)、https://www.kinryo.net/?p=2529を参考に変更してください。ただしUUIDの変更は出来なかったので、変更していない。/grub2/grub.cfgにあるUUIDを全部変更してもオリジナルのUUIDが見つからないと言われブート出来なかった!!そして再起動しておく
pcsdを起動して、パスワードの設定をする
# systemctl enable –now pcsd
# passwd hacluster
これを両方のサブホストで行う。
ここからはオリジナルのサブホストのsmb3での作業
# pcs host auth smb3 smb4
Username: hacluster
Password:
smb4: Authorized
smb3: Authorized
ユーザーを聞かれるので hacluster パスワードは設定した物。
# pcs cluster setup mycluster –force smb3 smb4
結果の表示は長いので省略(最後にCluster has been successfully set up.が表示される筈)。次にクラスターをスタートし
# pcs cluster start –all
smb3: Starting Cluster…
smb4: Starting Cluster…
起動後にスタートさせる
# pcs cluster enable –all
smb3: Cluster Enabled
smb4: Cluster Enabled
# pcs status
Cluster name: mycluster
WARNINGS:
No stonith devices and stonith-enabled is not false
Status of pacemakerd: ‘Pacemaker is running’ (last updated 2023-10-23 19:53:50 +09:00)
Cluster Summary:
* Stack: corosync
* Current DC: smb4 (version 2.1.5-9.el9_2.3.alma.1-a3f44794f94) – partition with quorum
* Last updated: Mon Oct 23 19:53:50 2023
* Last change: Mon Oct 23 19:38:00 2023 by hacluster via crmd on smb4
* 2 nodes configured
* 0 resource instances configured
Node List:
* Online: [ smb3 smb4 ]
Full List of Resources:
* No resources
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
WARNINGが出ているので、https://www.kinryo.net/?p=3610を参考にして解除。corosync もチェックしておく。
# pcs status corosync
Membership information
———————-
Nodeid Votes Name
1 1 smb3 (local)
2 1 smb4