用pcs工具创建集群VIP的时候发现一直处于STOP状态
[root@rs1 ~]# pcs status
Cluster name: cluster1
Stack: corosync
Current DC: rs1 (version 1.1.20-5.el7-3c4c782f70) - partition with quorum
Last updated: Fri May 8 10:15:52 2020
Last change: Fri May 8 10:06:20 2020 by hacluster via crmd on rs12 nodes configured
1 resource configuredOnline: [ rs1 rs2 ]
Full list of resources:
VIP (ocf:💓IPaddr2): STOP
Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled[root@rs1 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:46:eb:23 brd ff:ff:ff:ff:ff:ff
inet 192.168.43.10/24 brd 192.168.43.255 scope global noprefixroute ens32
valid_lft forever preferred_lft forever
inet6 fe80::a0b8:9a41:6d1b:7285/64 scope link tentative noprefixroute dadfailed
valid_lft forever preferred_lft forever
inet6 fe80::1777:3e7e:f136:6cf/64 scope link noprefixroute
valid_lft forever preferred_lft forever
很烦
我去查看集群配置
[root@rs1 ~]# crm_verify -L -V
error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid
发现原来是stonish没有这个资源
解决办法:禁用stonish
[root@rs1 ~]# pcs property set stonith-enabled=false
[root@rs1 ~]# crm_verify -L -V
OK,不报错了,说明我们配置成功了
再次测试:
[root@rs1 ~]# pcs status
Cluster name: cluster1
Stack: corosync
Current DC: rs1 (version 1.1.20-5.el7-3c4c782f70) - partition with quorum
Last updated: Fri May 8 10:15:52 2020
Last change: Fri May 8 10:06:20 2020 by hacluster via crmd on rs12 nodes configured
1 resource configuredOnline: [ rs1 rs2 ]
Full list of resources:
VIP (ocf:💓IPaddr2): Started rs2
Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled[root@rs2 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:01:55:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.43.20/24 brd 192.168.43.255 scope global noprefixroute ens32
valid_lft forever preferred_lft forever
inet 192.168.43.100/24 brd 192.168.43.255 scope global secondary ens32
valid_lft forever preferred_lft forever
inet6 fe80::a0b8:9a41:6d1b:7285/64 scope link noprefixroute
valid_lft forever preferred_lft forever
成功!