# dnf install virt-manager libvirt
# dnf install -y ntp fence-virtd fence-virtd-multicast fence-virtd-libvirt fence-virt*
# timedatectl list-timezones | grep shanghai # timedatectl set-timezone asia/shanghai
# 删除原配置中的相关配置项 # sed -e '/^server/d' -e '/^#server/d' -e '/^fudge/d' -e '/^#fudge/d' -i /etc/ntp.conf # 在结尾添加ntp服务器配置 # sed -e '$a server 127.127.1.0' -e '$a fudge 127.127.1.0 stratum' -i /etc/ntp.conf
# systemctl enable ntpd.service && systemctl start ntpd.service && systemctl status ntpd.service
ntpq -c peers ntpq -c assoc timedatectl
# mkdir -p /etc/cluster
# echo fecb9e62cbcf4e54dcfb > /etc/cluster/fence_xvm.key
# fence_virtd -c
# systemctl enable fence_virtd && systemctl start fence_virtd && systemctl status fence_virtd
# fence_xvm -o list
# 启动(on)、关机(off)、重启(reboot)、状态获取(status)
# fence_xvm -o off -h ha1 # fence_xvm -o off -h ha2 # fence_xvm -o off -h ha3
# yum install -y ntp pcs pacemaker corosync fence-agents-all resource-agents
1 # timedatectl set-timezone asia/shanghai 2 3 # sed -i s/^server.*// /etc/ntp.conf 4 # echo "server 192.168.43.177 iburst" >> /etc/ntp.conf 5 # echo "sync_hwclock=yes" >> /etc/sysconfig/ntpdate 6 # systemctl enable ntpd.service && systemctl start ntpd.service && systemctl status ntpd.service
# timedatectl
# mkdir -p /etc/cluster # echo fecb9e62cbcf4e54dcfb > /etc/cluster/fence_xvm.key
# echo 000000|passwd --stdin hacluster
# pcs cluster auth ha1 ha2 ha3 -u hacluster -p 000000 --force
# pcs cluster setup --force --name openstack-ha ha1 ha2 ha3
# pcs cluster enable --all
# pcs cluster start --all
# pcs status
1 # pcs stonith create fence1 fence_xvm multicast_address=225.0.0.12 2 # pcs stonith create fence2 fence_xvm multicast_address=225.0.0.12 3 # pcs stonith create fence3 fence_xvm multicast_address=225.0.0.12
[root@ha1 ~]# pcs status cluster name: openstack-ha stack: corosync current dc: ha1 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum last updated: thu aug 16 15:30:59 2018 last change: thu aug 16 12:44:03 2018 by root via cibadmin on ha1 3 nodes configured 3 resources configured online: [ ha1 ha2 ha3 ] full list of resources: fence1 (stonith:fence_xvm): started ha1 fence2 (stonith:fence_xvm): started ha2 fence3 (stonith:fence_xvm): started ha3 daemon status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled
[root@ha1 ~]# pcs stonith show fence1 (stonith:fence_xvm): started ha1 fence2 (stonith:fence_xvm): started ha2 fence3 (stonith:fence_xvm): started ha3
如对本文有疑问, 点击进行留言回复!!
linux下文本编辑器vim的使用方法(复制、粘贴、替换、行号、撤销、多文件操作)
网友评论