0

I use pacemaker and corosync to manage failover with two nodes in active/passive mode. I have configured a virtual IP resource as this:

 # pcs resource create VirtualIP ocf:heartbeat:IPaddr2 \
        ip=192.9.50.54 cidr_netmask=32 op monitor interval=1s timeout=5s \
        start interval=0s timeout=30s

# pcs resource create PingIP ocf:pacemaker:ping dampen=5s multiplier=1000 host_list=@IP --clone

# pcs constraint location VirtualIP rule score=-INFINITY pingd lt 1 or not_defined pingd

where @IP is the IP address to ping.

Everything work fine, the VIP move over the node according to the ping. However when both node can not ping @IP, my resource VirtualIP is disabled. I would like in this case to keep the VirtualIP resource enabled on the last node where it was enabled.

I think that I have to modify the score of my resource VirtualIP according to the ping result, but I do not found how to do it.

Thanks for your help

moonbossa
  • 60
  • 2
  • 6

1 Answers1

1

I found this solution, as I figured, I have modified the score of my resource VirtualIP with the following constraint.

# pcs constraint location VirtualIP rule score=50 pingd gte 1 and defined pingd

Thus when a node succeed to ping @IP, its VirtualIP resource is increased of 50. When both node failed to ping, the resource is not stopped and stay on the last node where it was.

Maybe it will be useful for somebody.

moonbossa
  • 60
  • 2
  • 6