- 修改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
推荐阅读
-
83号美系性能控|比大多数同价位下的国产车都要强,接近五万优惠的别克英朗
-
犯罪|私占共享单车?违法!14名违法行为人被长航警方处罚
-
物种|我国已发现660多种外来入侵物种:对生态系统危害极大
-
「娱乐圈星扒爷」近照小腹赘肉明显疑已怀孕,张大奕人设崩塌?被正室手撕破坏家庭
-
社交|十一国庆过后,秋招Java岗,陆续收到字节/招银等offer
-
-
角色|三百块的游戏赚不过免费的手游?手游是怎么赚空我们的钱包的?
-
-
大表姐的穿衣经|邢菲清纯的穿搭风格惹人爱,穿碎花娃娃领裙子,像极了一个小公主
-
我是那水还是鱼|对待爱情很认真,从不轻易许诺,十二生肖中这4大生肖男
-
-
法制|牛是谁的说不清!贵州一法院给牛做“亲子鉴定”
-
20岁了有什么办法可以长高,20岁了还能长高么20岁怎么长高-
-
-
春运返程拦路虎!北方11省份今明有大面积降雪 南方阴雨一直下
-
李湘|李湘称体重太会缺斤少两,节目录制过半才瘦两斤,纯粹来炫富?
-
cad如何按比例放大字体,cad要如何才可以更改字体的大小
-
『华为mate』麒麟1020+全新工业外观设计,华为Mate40无可反驳的强悍
-
中国最漂亮火车站:花费140亿,历时5年才建好,获得多项建筑大奖
-
龟苓膏|网友评出“最难吃”的4种食物,若你全都吃过,我喊你声“大佬”