PCS Cluster with Shared IP on different interface

user1076412 picture user1076412 · Oct 27, 2014 · Viewed 10.6k times · Source

I am creating a Fedora PCS Cluster for HAProxy. I have it running on VMWare, and am following this guide, and get to this step of adding a IPAddr2 resource: http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/_adding_a_resource.html

The only difference is that I need my cluster heartbeat/comms on one NIC/subnet, and my shared resource IP on a different NIC/subnet.

My internal comms is Node1=192.160.0.1 and Node2=192.168.0.2, and my resource ip is 10.0.0.1

How do I use this command in this situation:

pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \
    ip=192.168.0.120 cidr_netmask=32 op monitor interval=30s

If I add it as above, I get this:

[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

Answer

Simon MC. Cheng picture Simon MC. Cheng · Aug 2, 2016

First, you need to specify the network device as mentioned by Daniel, e.g.

pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.0.0.1 cidr_netmask=32 nic=eth0 op monitor interval=30s

Since you are running two node cluster, you don't have a fencing device. So you have to disable the STONITH setting but it is not recommended for production environment.

pcs property set stonith-enabled=false

The virtual ip address should be activated automatically.

#pcs status resources

    Full list of resources:
    ClusterIP      (ocf::heartbeat:IPaddr2):       Started:node-01