[Pacemaker] Location with ping resource and stickiness

Thomas ThomasCaspari at t-online.de
Sat May 7 12:33:37 EDT 2011


Viacheslav Biriukov <v.v.biriukov at ...> writes:

> Hello!
> 
> Does ping resource and stickiness may work together?  
> For example I have next resources:
>
> primitive P_INTRANET ocf:pacemaker:ping \
> 	params host_list="192.168.56.1 192.168.56.100" multiplier="111"
name="ping_intranet" \
> 	op monitor interval="5s" timeout="20s"
> clone CL_INTRANET P_INTRANET \
> 	meta target-role="Started" globally-unique="false"
> location L_DRBD_MASTER_01 msDRBD \
> 	rule $id="L_DRBD_MASTER_01-rule" 100: #uname eq first.local
> location L_DRBD_MASTER_02 msDRBD \
> 	rule $id="L_DRBD_MASTER_02-rule" 10: #uname eq second.local
> location L_DRBD_MASTER_PING msDRBD \
> 	rule $id="L_DRBD_MASTER_03-rule" ping_intranet: defined ping_intranet
> rsc_defaults $id="rsc-options" \
> 	resource-stickiness="10000"
> 
> So when master node doesn't ping ip address -- resource moves to other node.
But when ip will up -- resource moves back (cause it location rate: 100+111+111
> 10+111+111) How can I prevent this behavior?
> Tnx.
> -- Viacheslav Sov1et Biriukov

Hello Viacheslav,

I'm currently doing my first cluster, using Virtualbox (network 192.168.56.0/24)
as a "development environment" and solved your problem using PINGD (not PING) as
follows (just the relevant parts of my config):

---begin---
primitive resIP ocf:heartbeat:IPaddr2 \
        params ip="192.168.56.20" nic="eth1" cidr_netmask="24" iflabel="eth1" \
        op start timeout="20" op stop timeout="20" \
        op monitor interval="10" timeout="20" start-delay="0" \
        meta resource-stickiness="50"
primitive resPINGD ocf:pacemaker:pingd \
        params host_list="192.168.56.1" dampen="5s" multiplier="100" interval="2s" \
        op monitor interval="10s" timeout="20s" start-delay="30s" \
        op start timeout="90s" op stop timeout="100s"
clone clonePINGD resPINGD
location locIP resIP \
        rule $id="locIP-rule" pingd: defined pingd
---end---

As you can see, I bind the IP with stickyness of 50 to the current node and
multiply the PINGD score by 100, so if PINGD cannot reach its default gateway
(in my case it's the default gateway which makes sense) the resulting score is
at least 50 points greater than the stickyness of my. When I unplug the cable of
my active node and wait between 8s and 10s before replugging, the IP and all
resources that depend on it move to the other node and stay there (until e.g.
then I unplug the other node's cable for 10 secs, then they all move back to the
first node). You can see the scores changing and then your resources move when
you use 'crm_mon -f'. The timeout and interval values I use here represent the
advisory minimum.

I currently dunno what's wrong with your config, though. I am still learning
about scores and location restraints and cannot fully explain my solution. I
know that it works, so it maybe of value for you. 

Have success :)





More information about the Pacemaker mailing list