Corosync :: Restarting some resources after Lan connectivity issue

Posted by moebius_eye on Server Fault See other posts from Server Fault or by moebius_eye
Published on 2014-08-25T12:18:42Z Indexed on 2014/08/25 16:22 UTC
Read the original article Hit count: 306

I am currently looking into corosync to build a two-node cluster. So, I've got it working fine, and it does what I want to do, which is:

  • Lost connectivity between the two nodes gives the first node '10node' both Failover Wan IPs. (aka resources WanCluster100 and WanCluster101 )
  • '11node' does nothing. He "thinks" he still has his Failover Wan IP. (aka WanCluster101)

But it doesn't do this:

  • '11node' should restart the WanCluster101 resource when the connectivity with the other node is back.

This is to prevent a condition where node10 simply dies (and thus does not get 11node's Failover Wan IP), resulting in a situation where none of the nodes have 10node's failover IP because 10node is down 11node has "given back" his failover Wan IP.

Here's the current configuration I'm working on.

node 10sch \
    attributes standby="off"
node 11sch \
    attributes standby="off"
primitive LanCluster100 ocf:heartbeat:IPaddr2 \
    params ip="172.25.0.100" cidr_netmask="32" nic="eth3" \
    op monitor interval="10s" \
    meta is-managed="true" target-role="Started"
primitive LanCluster101 ocf:heartbeat:IPaddr2 \
    params ip="172.25.0.101" cidr_netmask="32" nic="eth3" \
    op monitor interval="10s" \
    meta is-managed="true" target-role="Started"
primitive Ping100 ocf:pacemaker:ping \
    params host_list="192.0.2.1" multiplier="500" dampen="15s" \
    op monitor interval="5s" \
    meta target-role="Started"
primitive Ping101 ocf:pacemaker:ping \
    params host_list="192.0.2.1" multiplier="500" dampen="15s" \
    op monitor interval="5s" \
    meta target-role="Started"
primitive WanCluster100 ocf:heartbeat:IPaddr2 \
    params ip="192.0.2.100" cidr_netmask="32" nic="eth2" \
    op monitor interval="10s" \
    meta target-role="Started"
primitive WanCluster101 ocf:heartbeat:IPaddr2 \
    params ip="192.0.2.101" cidr_netmask="32" nic="eth2" \
    op monitor interval="10s" \
    meta target-role="Started"
primitive Website0 ocf:heartbeat:apache \
    params configfile="/etc/apache2/apache2.conf" options="-DSSL" \
    operations $id="Website-one" \
    op start interval="0" timeout="40" \
    op stop interval="0" timeout="60" \
    op monitor interval="10" timeout="120" start-delay="0" statusurl="http://127.0.0.1/server-status/" \
    meta target-role="Started"
primitive Website1 ocf:heartbeat:apache \
    params configfile="/etc/apache2/apache2.conf.1" options="-DSSL" \
    operations $id="Website-two" \
    op start interval="0" timeout="40" \
    op stop interval="0" timeout="60" \
    op monitor interval="10" timeout="120" start-delay="0" statusurl="http://127.0.0.1/server-status/" \
    meta target-role="Started"
group All100 WanCluster100 LanCluster100
group All101 WanCluster101 LanCluster101
location AlwaysPing100WithNode10 Ping100 \
    rule $id="AlWaysPing100WithNode10-rule" inf: #uname eq 10sch
location AlwaysPing101WithNode11 Ping101 \
    rule $id="AlWaysPing101WithNode11-rule" inf: #uname eq 11sch
location NeverLan100WithNode11 LanCluster100 \
    rule $id="RAND1083308" -inf: #uname eq 11sch
location NeverPing100WithNode11 Ping100 \
    rule $id="NeverPing100WithNode11-rule" -inf: #uname eq 11sch
location NeverPing101WithNode10 Ping101 \
    rule $id="NeverPing101WithNode10-rule" -inf: #uname eq 10sch
location Website0NeedsConnectivity Website0 \
    rule $id="Website0NeedsConnectivity-rule" -inf: not_defined pingd or pingd lte 0
location Website1NeedsConnectivity Website1 \
    rule $id="Website1NeedsConnectivity-rule" -inf: not_defined pingd or pingd lte 0
colocation Never -inf: LanCluster101 LanCluster100
colocation Never2 -inf: WanCluster100 LanCluster101
colocation NeverBothWebsitesTogether -inf: Website0 Website1
property $id="cib-bootstrap-options" \
    dc-version="1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff" \
    cluster-infrastructure="openais" \
    expected-quorum-votes="2" \
    no-quorum-policy="ignore" \
    stonith-enabled="false" \
    last-lrm-refresh="1408954702" \
    maintenance-mode="false"
rsc_defaults $id="rsc-options" \
    resource-stickiness="100" \
    migration-threshold="3"

I also have a less important question concerning this line:

colocation NeverBothLans -inf: LanCluster101 LanCluster100

How do I tell it that this collocation only applies to '11node'.

© Server Fault or respective owner

Related posts about linux

Related posts about linux-networking