[Pacemaker] monitoring attributes

Michael Schwartzkopff ms at sys4.de
Mon Mar 3 04:45:16 EST 2014

Am Montag, 3. März 2014, 10:26:30 schrieb Giuliano Zorzi:
> Hi all,
> I'm stuck on something I thought to be very simple, but googling hasn't
> helped me :(
> I have a 2 node cluster with an IPaddress2 resource and a
> pacemaker:pingd clone. The resource goes away from the node with pingd
> value = 0 just fine.
> Now I need to run a script on the "failed" node when it comes back but I
> can't seem to find a way.

No. You make your resources depend on the result of the ping monitoring by a 
location constraint and the score_attribute "pingd". So the ping resource 
checks the availabilily of the hosts in the list and updates the result in the 
pingd attribute of avery node.

If no host is available hte node gets 0 points and "multiplier" points for 
every reachable host.

pacemaker will place your resource on the host that gathers most points. If 
the contact is lost (0 points) the resource moves away. If the contact is 
established again, it depends on the resource-stickiness, if the reource fails 
back to the node.

BTW: you should use ocf:pacemaker:ping instead of the ocf:pacemaker:pingd
Be sure to have a monitor operation configured.

> I tried ClusterMon but it seems to work only when the clone resource is
> started/stopped, not when the atrtibute value changes
> Is there a way to have this done ?
> As last resort I could use a cronjob and monitor the pingd attribute
> with crm_attribute (crm_attribute --query --name=pingd --node node1
> returns "name=pingd value=(null) Error performing operation: cib object
> missing", any idea ?)
> Any help will be greatly appreciated
> giuliano
> versions details
> OS is centos 5
> kernel is 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:40 EST 2010 i686
> i686 i386 GNU/Linux
> heartbeat-3.0.3-2.3.el5.i386.rpm
> heartbeat-libs-3.0.3-2.3.el5.i386.rpm
> pacemaker-1.0.12-1.el5.centos.i386.rpm
> pacemaker-libs-1.0.12-1.el5.centos.i386.rpm
> all from clusterlabs repo
> crm config
> primitive p_ping ocf:pacemaker:ping \
>          params host_list="" multiplier="100" dampen="5s" \
>          op monitor interval="60" timeout="60" \
>          op start interval="0" timeout="60" \
>          op stop interval="0" timeout="60"

> clone c_ping p_ping
> primitive res_IPaddr2 ocf:heartbeat:IPaddr2 \
>          params ip="" cidr_netmask="32" \
>          operations $id="res_IPaddr2-operations" \
>          op start interval="0" timeout="20" \
>          op stop interval="0" timeout="20" \
>          op monitor interval="10" timeout="20" start-delay="0"
> location l_ping res_IPaddr2 \
>          rule $id="l_ping-rule" -inf: not_defined pingd or pingd lte 0


location l_ping res_IPaddr2 rule pingd: defined pingd

> property $id="cib-bootstrap-options" \
>          dc-version="1.0.12-unknown" \
>          cluster-infrastructure="Heartbeat" \
>          stonith-enabled="false" \
>          no-quorum-policy="ignore" \
>          last-lrm-refresh="1393595832"
> rsc_defaults $id="rsc-options" \
>          resource-stickiness="1000"

Well, you have a resource stickiness of "1000". A node only can gather 100 
points from the ping resource. if both nodes have 100 points from ping, the 
resource will not fail back. If you want to have fail-back lower the resource-
stickiness to 50. But why do you want a failback anyway?

Mit freundlichen Grüßen,

Michael Schwartzkopff

[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140303/4ee9f6ba/attachment-0003.sig>

More information about the Pacemaker mailing list