2014-10-27 101 views
0

我正在为HAProxy创建Fedora PCS群集。我有它在VMWare上运行,并按照本指南,并加入到这一步添加IPAddr2资源:http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/_adding_a_resource.html具有不同接口上的共享IP的PCS群集

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

我的内部通讯科为节点1 = 192.160.0.1和节点2 = 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 

如果我如上所述添加它,我得到这个:

[[email protected] .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 

回答

0

您需要指定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的,但我更喜欢使用sub接口为我的浮动IP地址。您可以在一个NIC上创建多个浮动IP地址,但您需要在独特的子接口上配置每个浮动IP地址。

1

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