[Pacemaker] trouble configuring location with clones

Joshua Hoblitt jhoblitt at noao.edu
Fri Jul 1 19:14:30 UTC 2011


Hello,

I'm relatively new to pacemaker and I'm working on my second HA setup.

The setup I need is very simplistic, I have two nodes (VMs actually)
running pacemaker 1.0.10 on top of heartbeat 3.0.4.  The goal is two
have both nodes running apache (for testing, etc) which a single VIP
that fails over between them.  I'd also like to run pingd.  What I've
tried to setup is httpd & pingd as clones and then use location(s) such
that that VIP can only be on a node where httpd & pingd are running.

The basic config with just the VIP + clones is:

--
node $id="3981ed26-9f6d-4d32-94c6-18285f90b3c8" monitorb \
	attributes standby="off"
node $id="e5243ca3-5bd1-4f81-876b-4957ee480c6d" monitora \
	attributes standby="off"
primitive p_ip_monitor ocf:heartbeat:IPaddr2 \
	params ip="140.252.25.75" cidr_netmask="24" \
	op monitor interval="10s" timeout="40s" \
	op start interval="0" timeout="20s" \
	op stop interval="0" timeout="20s" \
	meta target-role="Started"
primitive p_lsb_httpd lsb:httpd \
	op start interval="0" timeout="20s" \
	op stop interval="0" timeout="20s"
primitive p_pingd ocf:pacemaker:pingd \
	params host_list="140.252.25.1" multiplier="100" \
	meta target-role="Started"
clone c_lsb_httpd p_lsb_httpd
clone c_lsb_pingd p_pingd
order o_httpd_before_ip inf: c_lsb_httpd:start p_ip_monitor:start
property $id="cib-bootstrap-options" \
	stonith-enabled="false" \
	no-quorum-policy="ignore" \
	dc-version="1.0.10-c3869c00c759b303ac2eff950db50fd3c845bb14" \
	cluster-infrastructure="Heartbeat"
rsc_defaults $id="rsc-options" \
	resource-stickiness="100"
--

The status looks like:

--
Online: [ monitora monitorb ]

p_ip_monitor    (ocf::heartbeat:IPaddr2):	Started monitora
 Clone Set: c_lsb_httpd
     Started: [ monitora monitorb ]
 Clone Set: c_lsb_pingd
     Started: [ monitora monitorb ]
__

And the VIP bounces around correct from reboots and standbys.

However, when I try to add a location constraint as in this example:
http://www.clusterlabs.org/wiki/Example_configurations#pingd_location_constraint

--
location l_ip_monitor_on_connected_node p_ip_monitor \
        rule $id="l_ip_monitor_on_connected_node-rule" -inf: not_defined
p_pingd or p_pingd lte 0
--

The cluster completely drops the VIP

It seems like what I need for httpd should be:

--
location l_ip_monitor_on_httpd p_ip_monitor \
                rule $id="l_ip_monitor_on_httpd-rule" -inf: not_defined
p_lsb_httpd or p_lsb_httpd lte 0
--

But I suspect that I'm completely missing something as to how locations
are supposed to work.  I tried colocations as well but that didn't work
as I expected either.

-Josh

--




More information about the Pacemaker mailing list