Cluster computing 在不同接口上具有共享IP的PC群集

Cluster computing 在不同接口上具有共享IP的PC群集,cluster-computing,pacemaker,Cluster Computing,Pacemaker,我正在为HAProxy创建Fedora PC群集。我让它在VMWare上运行,并遵循本指南,进入添加iPadr2资源的这一步: 唯一的区别是,我需要在一个NIC/子网上安装群集心跳信号/通信,在另一个NIC/子网上安装共享资源IP 我的内部通信是Node1=192.160.0.1和Node2=192.168.0.2,我的资源ip是10.0.0.1 在这种情况下如何使用此命令: pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \ ip

我正在为HAProxy创建Fedora PC群集。我让它在VMWare上运行,并遵循本指南,进入添加iPadr2资源的这一步:

唯一的区别是,我需要在一个NIC/子网上安装群集心跳信号/通信,在另一个NIC/子网上安装共享资源IP

我的内部通信是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

您需要指定NIC。如果第一个NIC为eth0,第二个NIC为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地址,但需要在唯一的子接口上配置每个地址。

首先,您需要指定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