我正在为HAProxy创建一个Fedora PCS集群。我在VMWare上运行了它,并按照本指南进行操作,然后进入添加IPAddr2资源的步骤:http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/_adding_a_resource.html
唯一的区别是我的集群心跳/通信需要在一个NIC/子网上,而我的共享资源IP需要在不同的NIC/子网上。
我的内部通信是Node1=192.160.0.1和Node2=192.168.0.2,资源ip是10.0.0.1
在这种情况下如何使用此命令:
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \
ip=192.168.0.120 cidr_netmask=32 op monitor interval=30s如果我像上面那样添加它,我会得到这样的结果:
[root@node-01 .pcs]# pcs status
Cluster name: mycluster
Last updated: Tue Oct 28 09:10:13 2014
Last change: Tue Oct 28 09:00:13 2014 via cibadmin on node-02
Stack: corosync
Current DC: node-02 (2) - partition with quorum
Version: 1.1.11-1.fc20-9d39a6b
2 Nodes configured
1 Resources configured
Online: [ node-01 node-02 ]
Full list of resources:
ClusterIP (ocf::heartbeat:IPaddr2): Stopped
Failed actions:
ClusterIP_start_0 on node-01 'unknown error' (1): call=7, status=complete, last-rc-change='Tue Oct 28 09:00:13 2014', queued=0ms, exec=27ms
ClusterIP_start_0 on node-02 'unknown error' (1): call=6, status=complete, last-rc-change='Tue Oct 28 09:00:13 2014', queued=0ms, exec=27ms发布于 2016-08-02 16:37:55
首先,您需要指定Daniel提到的网络设备,例如
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.0.0.1 cidr_netmask=32 nic=eth0 op monitor interval=30s由于您运行的是两个节点集群,因此您没有隔离设备。因此,您必须禁用STONITH设置,但不建议将其用于生产环境。
pcs property set stonith-enabled=false虚拟ip地址应自动激活。
#pcs status resources
Full list of resources:
ClusterIP (ocf::heartbeat:IPaddr2): Started:node-01发布于 2014-10-28 15:39:37
您需要指定NIC。如果您的第一个NIC是eth0,第二个是eth1。您可以使用以下命令创建资源:
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.0.0.1 cidr_netmask=32 nic=eth1:0 op monitor interval=30s您也可以仅使用eth1,但我更喜欢使用子接口作为浮动IP地址。您可以在一个NIC上创建多个浮动IP地址,但需要在唯一的子接口上配置每个浮动IP地址。
https://stackoverflow.com/questions/26597904
复制相似问题