- 修改pcsd的TCP端口为指定的13314
sed -i '/#PCSD_PORT=2224/aPCSD_PORT=13314' /etc/sysconfig/pcsd重启pcsd服务,让新端口生效
[#23#root@gdb1 ~ 11:23:20]23 systemctl restart pcsd[#24#root@gdb1 ~ 11:23:39]24 systemctl status pcsd● pcsd.service - PCS GUI and remote configuration interfaceLoaded: loaded (/usr/lib/systemd/system/pcsd.service; enabled; vendor preset: disabled)Active: active (running) since 三 2023-02-22 11:23:39 CST; 5s agoDocs: man:pcsd(8)man:pcs(8) Main PID: 30041 (pcsd)Tasks: 4Memory: 27.3MCGroup: /system.slice/pcsd.service└─30041 /usr/bin/ruby /usr/lib/pcsd/pcsd2月 22 11:23:38 gdb1 systemd[1]: Starting PCS GUI and remote configuration interface...2月 22 11:23:39 gdb1 systemd[1]: Started PCS GUI and remote configuration interface.[#25#root@gdb1 ~ 11:23:45]25 - 设置集群认证信息,通过操作系统用户hacluster进行认证
[#27#root@gdb1 ~ 11:31:43]27 cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf[#28#root@gdb1 ~ 11:32:15]28 pcs cluster auth gdb1:13314 gdb2:13314 gdb3:13314 -u hacluster -p 'abc123'gdb1: Authorizedgdb2: Authorizedgdb3: Authorized[#29#root@gdb1 ~ 11:33:18]29 - 创建集群,任意节点执行即可
## 名称为gdb_ha , udp协议为13315, 掩码为24 ,集群成员为主机gdb1, gdb2, gdb3[#31#root@gdb1 ~ 11:41:48]31 pcs cluster setup --force --name gdb_ha --transport=udp --addr0 24 --mcastport0 13315 gdb1 gdb2 gdb3Destroying cluster on nodes: gdb1, gdb2, gdb3...gdb1: Stopping Cluster (pacemaker)...gdb2: Stopping Cluster (pacemaker)...gdb3: Stopping Cluster (pacemaker)...gdb2: Successfully destroyed clustergdb1: Successfully destroyed clustergdb3: Successfully destroyed clusterSending 'pacemaker_remote authkey' to 'gdb1', 'gdb2', 'gdb3'gdb2: successful distribution of the file 'pacemaker_remote authkey'gdb3: successful distribution of the file 'pacemaker_remote authkey'gdb1: successful distribution of the file 'pacemaker_remote authkey'Sending cluster config files to the nodes...gdb1: Succeededgdb2: Succeededgdb3: SucceededSynchronizing pcsd certificates on nodes gdb1, gdb2, gdb3...gdb1: Successgdb2: Successgdb3: SuccessRestarting pcsd on the nodes in order to reload the certificates...gdb1: Successgdb2: Successgdb3: Success - 确认完整的集群配置,在任意节点查看即可
[#21#root@gdb2 ~ 11:33:18]21 more /etc/corosync/corosync.conftotem {version: 2cluster_name: gdb_hasecauth: offtransport: udprrp_mode: passiveinterface {ringnumber: 0bin.NETaddr: 24mcastaddr: 239.255.1.1mcastport: 13315}}nodelist {node {ring0_addr: gdb1nodeid: 1}node {ring0_addr: gdb2nodeid: 2}node {ring0_addr: gdb3nodeid: 3}}quorum {provider: corosync_votequorum}logging {to_logfile: yeslogfile: /var/log/cluster/corosync.logto_syslog: yes}[#22#root@gdb2 ~ 14:23:50]22 - 启动所有集群节点的pacemaker 相关服务,任意节点执行即可
[#35#root@gdb1 ~ 15:30:51]35 pcs cluster start --allgdb1: Starting Cluster (corosync)...gdb2: Starting Cluster (corosync)...gdb3: Starting Cluster (corosync)...gdb3: Starting Cluster (pacemaker)...gdb1: Starting Cluster (pacemaker)...gdb2: Starting Cluster (pacemaker)...关闭服务时,使用pcs cluster stop --all,或者用pcs cluster stop 《server》关闭某一台
- 在每个节点上设置pacemaker相关服务开机自启动
[#35#root@gdb1 ~ 15:30:51]35 systemctl enable pcsd corosync pacemaker[#36#root@gdb1 ~ 15:30:53]36 pcs cluster enable --all - 没有STONITH 设备时,禁用STONITH 组件功能
禁用STONITH 组件功能后,分布式锁管理器DLM等资源以及依赖DLM的所有服务:例如cLVM2,GFS2,OCFS2等都将无法启动,不禁用时会有错误信息
pcs property set stonith-enabled=false完整的命令执行过程如下
[#32#root@gdb1 ~ 15:48:20]32 systemctl status pacemaker● pacemaker.service - Pacemaker High Availability Cluster ManagerLoaded: loaded (/usr/lib/systemd/system/pacemaker.service; disabled; vendor preset: disabled)Active: active (running) since 三 2023-02-22 15:35:48 CST; 1min 54s agoDocs: man:pacemakerdhttps://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/index.html Main PID: 25661 (pacemakerd)Tasks: 7Memory: 51.1MCGroup: /system.slice/pacemaker.service├─25661 /usr/sbin/pacemakerd -f├─25662 /usr/libexec/pacemaker/cib├─25663 /usr/libexec/pacemaker/stonithd├─25664 /usr/libexec/pacemaker/lrmd├─25665 /usr/libexec/pacemaker/attrd├─25666 /usr/libexec/pacemaker/pengine└─25667 /usr/libexec/pacemaker/crmd2月 22 15:35:52 gdb1 crmd[25667]:notice: Fencer successfully connected2月 22 15:36:11 gdb1 crmd[25667]:notice: State transition S_ELECTION -> S_INTEGRATION2月 22 15:36:12 gdb1 pengine[25666]:error: Resource start-up disabled since no STONITH resources have been defined2月 22 15:36:12 gdb1 pengine[25666]:error: Either configure some or disable STONITH with the stonith-enabled option2月 22 15:36:12 gdb1 pengine[25666]:error: NOTE: Clusters with shared data need STONITH to ensure data integrity2月 22 15:36:12 gdb1 pengine[25666]:notice: Delaying fencing operations until there are resources to manage2月 22 15:36:12 gdb1 pengine[25666]:notice: Calculated transition 0, saving inputs in /var/lib/pacemaker/pengine/pe-input-0.bz22月 22 15:36:12 gdb1 pengine[25666]:notice: Configuration ERRORs found during PE processing.Please run "crm_verify -L" to identify issues.2月 22 15:36:12 gdb1 crmd[25667]:notice: Transition 0 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-0.bz2): Complete2月 22 15:36:12 gdb1 crmd[25667]:notice: State transition S_TRANSITION_ENGINE -> S_IDLE[#33#root@gdb1 ~ 15:37:43]33 pcs property set stonith-enabled=false[#34#root@gdb1 ~ 15:48:20]34 systemctl status pacemaker● pacemaker.service - Pacemaker High Availability Cluster ManagerLoaded: loaded (/usr/lib/systemd/system/pacemaker.service; disabled; vendor preset: disabled)Active: active (running) since 三 2023-02-22 15:35:48 CST; 12min agoDocs: man:pacemakerdhttps://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/index.html Main PID: 25661 (pacemakerd)Tasks: 7Memory: 51.7MCGroup: /system.slice/pacemaker.service├─25661 /usr/sbin/pacemakerd -f├─25662 /usr/libexec/pacemaker/cib├─25663 /usr/libexec/pacemaker/stonithd├─25664 /usr/libexec/pacemaker/lrmd├─25665 /usr/libexec/pacemaker/attrd├─25666 /usr/libexec/pacemaker/pengine└─25667 /usr/libexec/pacemaker/crmd2月 22 15:36:12 gdb1 pengine[25666]:notice: Calculated transition 0, saving inputs in /var/lib/pacemaker/pengine/pe-input-0.bz22月 22 15:36:12 gdb1 pengine[25666]:notice: Configuration ERRORs found during PE processing.Please run "crm_verify -L" to identify issues.2月 22 15:36:12 gdb1 crmd[25667]:notice: Transition 0 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-0.bz2): Complete2月 22 15:36:12 gdb1 crmd[25667]:notice: State transition S_TRANSITION_ENGINE -> S_IDLE2月 22 15:48:20 gdb1 crmd[25667]:notice: State transition S_IDLE -> S_POLICY_ENGINE2月 22 15:48:21 gdb1 pengine[25666]:warning: Blind faith: not fencing unseen nodes2月 22 15:48:21 gdb1 pengine[25666]:notice: Delaying fencing operations until there are resources to manage2月 22 15:48:21 gdb1 pengine[25666]:notice: Calculated transition 1, saving inputs in /var/lib/pacemaker/pengine/pe-input-1.bz22月 22 15:48:21 gdb1 crmd[25667]:notice: Transition 1 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-1.bz2): Complete2月 22 15:48:21 gdb1 crmd[25667]:notice: State transition S_TRANSITION_ENGINE -> S_IDLE[#35#root@gdb1 ~ 15:48:31]35
推荐阅读
-
新鲜的星座知识|不努力就能得到一切的四大星座白羊座:有一群好朋友巨蟹座:父母厉害狮子座:天生聪慧摩羯座:不让人看见,真是气人
-
分区:北京初雪“准时”来了!有网友却吐槽:“北京的雪还分区
-
-
-
「饮食」减脂总是进入死胡同?不想减脂再次失败,这些误区要尽早避开
-
黄茶适合什么人喝5大人群喝黄茶效果翻倍,黄茶适合什么人喝
-
仰卧撑尤文想要沙拉维,他会回去受那个罪?,在中超轻松挣1亿开法拉利
-
张小斐|张小斐主持金鸡奖获观众好评:神态举止端庄大气,临场发挥很稳定
-
「吴昕」主持《快乐大本营》是吴昕的幸运,有很多人羡慕她
-
『红楼小谈』奋斗时我们像宝钗,中年时我们又希望是黛玉,年少时我们像黛玉
-
#花间雨屋星座#却很会识人的四大星座,看起来傻不拉几
-
作为家境好的人,和同一层次的人行为做事有差异,感到困惑,求教
-
健康直通车|安享幸福晚年,烟台市心理康复医院老年康复科:远离抑郁困扰
-
-
|身高178、体重98,网红高迪自嘲“细狗”,因粉丝调侃,决心增肥
-
时尚圈小麻雀|搭配黑色短裤,尽显迷人魅力!,街拍:运动时尚的小姐姐
-
-
-
#柠檬奇趣#照出了客户的真实修养,你周围有这样伪善的人吗?,安家:中介像一面镜子
-
机场@湖北各机场将复航?武汉机场:提前准备,未定时间