- 修改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
推荐阅读
-
这些致盲性眼病“最爱”老年人!中山举办眼病科普公益活动
-
大众报业·大众日报客户端|图说山东经济半年报丨V字反弹!经济社会发展态势企稳向好、逆势上扬
-
车诸葛|后再开35万红旗H9,车主:差距太明显!,50万买的奔驰E
-
戈兰-德拉季奇|德拉季奇:复赛方便充当球探 会在现场观看竞争对手比赛
-
前方高能|网友:我也想要这样的婆婆,姜潮妈妈婚前给麦迪娜买房
-
3DM游戏网|有进步,网友晒《赛博朋克2077》18/19年与今年画面对比
-
中国美术学院|强强联手!中国美术学院与西湖大学签订校际合作协议,艺科融合
-
-
-
-
荷花|“秀色掩今古,荷花羞玉颜”诗仙李白笔下的西施,长这样
-
魅族科技■魅族 17 将发布,16s Pro 产线迎来最后一台
-
敢动|两位高人,一位说:我死后墓地被盗,一位却说:你的墓地无人敢动
-
『心理学』白天总比晚上痛苦,抑郁为何总是昼重夜轻?
-
涨停|华为校招没信用!华大应届生吐槽:让我推掉别人家,却又不签合同
-
-
『妇女儿童合法权益』江西将设立1598个妇女儿童维权工作站
-
书法字画|乾隆帝长啥样?一位意大利画师偷偷画下他容貌,网友:像一个明星
-
跳高的鱼|高三学生实现理想,要了解临考前一天的注意事项,迎战2020年高考
-