pcs安装pacemaker 2.1 + corosync 3.0

发布时间 2023-08-02 16:37:57作者: chinhousin
[root@pcmk-1 ~]#dnf config-manager --set-enabled highavailability
[root@pcmk-1 ~]#dnf install -y pacemaker pcs psmisc policycoreutils-python3
###policycoreutils-python3没有就用policycoreutils*
[root@pcmk-1 ~]#firewall-cmd --permanent --add-service=high-availability
[root@pcmk-1 ~]#firewall-cmd --reload[root@pcmk-1 ~]# setenforce 0 [root@pcmk-1 ~]# sed -i.bak "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config [root@pcmk-1 ~]# systemctl mask firewalld.service [root@pcmk-1 ~]# systemctl stop firewalld.service [root@pcmk-1 ~]# iptables --flush

# systemctl start pcsd.service
# systemctl enable pcsd.service
# passwd hacluster
Changing password for user hacluster.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
# ssh pcmk-2 -- 'echo mysupersecretpassword | passwd --stdin hacluster'
# pcs host auth pcmk-1 pcmk-2
### 此处为host非cluster
# pcs cluster setup mycluster \
    pcmk-1 addr=192.168.122.101 pcmk-2 addr=192.168.122.102
### setup没有--name选项
#pcs cluster start --all
# systemctl start corosync.service
# systemctl start pacemaker.service
# pcs status验证安装完成
# journalctl -b | grep -i error排错

如果有错请先确认是否pacemaker和corosync兼容,部分系统pacemaker暂不支持,如AWS