[Pacemaker] Unable to add ping resource to pacemaker 1.0.12
Jake Smith
jsmith at argotec.com
Wed Oct 17 21:12:37 UTC 2012
----- Original Message -----
> From: "Richard \"Alan\" McAlexander" <alanmac1982 at gmail.com>
> To: "Jake Smith" <jsmith at argotec.com>, "The Pacemaker cluster
> resource manager" <pacemaker at oss.clusterlabs.org>
> Sent: Wednesday, October 17, 2012 3:21:42 PM
> Subject: Re: [Pacemaker] Unable to add ping resource to pacemaker
> 1.0.12
> That's gotten me a little closer. I'm a bit of a newb when it comes
> to Pacemaker, on that note, I put the first group of your post (and
> changed the options to match the network I'm working on, I put this
> first configuration on the line with the existing group that I have
> setup.
> That group has stuff like apache, smb, dhcp and some custom software
> that this existing group is managing. Should I create a new group?
> Or just keep it in the existing group?
You can't put a clone in a group. The clone section should be under resources and after/before your existing groups at the same level. I explained below also where to insert the sections I sent you last time.
More on clones here:
http://www.clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/s-resource-clone.html
> The second configuration entry for constraints is already populated
> with the contraints for the existing group. Should this
> configuration be pasted within the existing constraint (<constraint>
> </constraint>)?
Yes it goes inside the existing constraints section but not within any of the existing location/colocation sections. Also see below I mentioned where this goes.
Pretty sure my instructions are accurate however I don't usually edit my cluster in xml... so no guarantees ;-)
More on ping/loction/rules here:
http://www.clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/ch09s03s03s02.html
> Also, if all my assumptions are correct, then I ran a verify test and
> got this output:
> /tmp/saved-cib.xml:159: element clone: Relax-NG validity error :
> Element group has extra content: clone
> /tmp/saved-cib.xml:41: element group: Relax-NG validity error :
> Element resources has extra content: group
> /tmp/saved-cib.xml:2: element configuration: Relax-NG validity error
> : Invalid sequence in interleave
> /tmp/saved-cib.xml:2: element configuration: Relax-NG validity error
> : Element configuration failed to validate content
> /tmp/saved-cib.xml:1: element cib: Relax-NG validity error : Element
> cib failed to validate content
> crm_verify[4016]: 2012/10/17_12:16:10 ERROR: main: CIB did not pass
> DTD/schema validation
> Errors found during check: config not valid
> Thank you for everything!
> Alan
> On Wed, Oct 17, 2012 at 8:36 AM, Jake Smith < jsmith at argotec.com >
> wrote:
> > ----- Original Message -----
>
> > > From: "Richard \"Alan\" McAlexander" < alanmac1982 at gmail.com >
>
> > > To: "The Pacemaker cluster resource manager"
>
> > > < pacemaker at oss.clusterlabs.org >
>
> > > Sent: Tuesday, October 16, 2012 7:23:37 PM
>
> > > Subject: Re: [Pacemaker] Unable to add ping resource to pacemaker
>
> > > 1.0.12
>
> > > Hi Jake,
>
> > > Below is my config. Thank you!
>
> > > <meta_attributes id="group_its-meta_attributes"/>
>
> > > <primitive id="res_ping_1" class="ocf" provider="pacemaker"
>
> > > type="ping">
>
> > > <instance_attributes id="res_ping_1-instance_attributes">
>
> > > <nvpair id="nvpair-res_ping_1-multiplier" name="multiplier"
>
> > > value="1000"/>
>
> > > <nvpair id="nvpair-res_ping_1-host_list" name="host_list"
>
> > > value="10.254.138.1"/>
>
> > > </instance_attributes>
>
> > > <operations id="res_ping_1-operations">
>
> > > <op interval="0" id="op-res_ping_1-start" name="start"
> > > timeout="60"/>
>
> > > <op interval="0" id="op-res_ping_1-stop" name="stop"
> > > timeout="20"/>
>
> > > <op id="op-res_ping_1-monitor" name="monitor" interval="10"
>
> > > timeout="60" start-delay="0"/>
>
> > > <op interval="0" id="op-res_ping_1-reload" name="reload"
>
> > > timeout="80"/>
>
> > > </operations>
>
> > > <meta_attributes id="res_ping_1-meta_attributes">
>
> > > <nvpair id="res_ping_1-meta_attributes-target-role"
>
> > > name="target-role" value="started"/>
>
> > > <nvpair id="res_ping_1-meta_attributes-migration-threshold"
>
> > > name="migration-threshold" value="3"/>
>
> > > <nvpair id="res_ping_1-meta_attributes-allow-migrate"
>
> > > name="allow-migrate" value="true"/>
>
> > > <nvpair id="res_ping_1-meta_attributes-resource-stickiness"
>
> > > name="resource-stickiness" value="-INFINITY"/>
>
> > > </meta_attributes>
>
> > > </primitive>
>
> > > <rsc_location id="loc_res_ping_1_seaaimsprd1" rsc="res_ping_1"
>
> > > node="seaaimsprd1" score="500"/>
>
> > > <rsc_location id="loc_res_ping_1_seaaimsprd2" rsc="res_ping_1"
>
> > > node="seaaimsprd2" score="500"/>
>
> > So I have two things for you.
>
> > You need to clone the ping resource so that it runs on all nodes.
> > You're location statements would just cancel each other out and the
> > cluster would decide where to put the single res_ping_1 resource.
>
> > For example I do this:
>
> > <resources>
>
This <clone id="cl_ping"> section needs to be under <resources> and at the same level as groups/primitives that you already have.
> > <clone id="cl_ping">
>
> > <meta_attributes id="cl_ping_gateways-meta_attributes">
>
> > <nvpair id="cl_ping_gateways-meta_attributes-clone-node-max"
> > name="clone-node-max" value="1"/>
>
> > <nvpair id="cl_ping_gateways-meta_attributes-interleave"
> > name="interleave" value="true"/>
>
> > <nvpair id="cl_ping_gateways-meta_attributes-target-role"
> > name="target-role" value="Started"/>
>
> > </meta_attributes>
>
> > <primitive class="ocf" id="p_ping_gateways" provider="pacemaker"
> > type="ping">
>
> > <instance_attributes id="p_ping_gateways-instance_attributes">
>
> > <nvpair id="p_ping_gateways-instance_attributes-host_list"
> > name="host_list" value="xxxxxxx"/>
>
> > <nvpair id="p_ping_gateways-instance_attributes-multiplier"
> > name="multiplier" value="100"/>
>
> > <nvpair id="p_ping_gateways-instance_attributes-dampen"
> > name="dampen"
> > value="33s"/>
>
> > </instance_attributes>
>
> > <operations>
>
> > <op id="p_ping_gateways-start-0" interval="0" name="start"
> > timeout="60s"/>
>
> > <op id="p_ping_gateways-stop-0" interval="0" name="stop"
> > timeout="20s"/>
>
> > <op id="p_ping_gateways-monitor-10s" interval="10s" name="monitor"
> > timeout="60s"/>
>
> > </operations>
>
> > </primitive>
>
> > </clone>
>
> > </resources>
>
> > Then you will have a clone instance of ping on each node.
>
> > Then you need to create location constraints for other resources in
> > relation to the pingd value.
>
> > For example:
>
> > <constraints>
>
This <rsc_location id="rule_name" rsc="resource_name"> section should be under <constraints> and at the same level as other rsc_location and rsc_colocation entries.
> > <rsc_location id="l_ntp_ip_with_ping" rsc="p_ip_ntp">
>
> > <rule boolean-op="or" id="l_ntp_ip_with_ping-rule"
> > score="-INFINITY">
>
> > <expression attribute="pingd" id="l_ntp_ip_with_ping-expression"
> > operation="not_defined"/>
>
> > <expression attribute="pingd" id="l_ntp_ip_with_ping-expression-0"
> > operation="lte" value="0"/>
>
> > </rule>
>
> > </rsc_location>
>
> > </constraints>
>
HTH
Jake
> > This contraint requires that resource "p_ip_ntp" must never run on
> > a
> > node where the value of pingd is undefined or less than 0.
>
> > Here's the crm code for the above:
>
> > primitive p_ping_gateways ocf:pacemaker:ping \
>
> > params host_list="xxxxx" multiplier="100" dampen="33s" \
>
> > op start interval="0" timeout="60s" \
>
> > op stop interval="0" timeout="20s" \
>
> > op monitor interval="10s" timeout="60s"
>
> > clone cl_ping p_ping_gateways \
>
> > meta clone-node-max="1" interleave="true" target-role="Started"
>
> > location l_ntp_ip_with_ping p_ip_ntp \
>
> > rule $id="l_ntp_ip_with_ping-rule" -inf: not_defined pingd or pingd
> > lte 0
>
> > HTH
>
> > Jake
>
> > > On Mon, Oct 15, 2012 at 9:46 PM, Jake Smith < jsmith at argotec.com
> > > >
>
> > > wrote:
>
> > > > Sorry for the top post.
>
> > >
>
> > > > Hard to say much without pacemaker config but did you configure
>
> > > > location constraints for your resources based upon pingd value?
>
> > >
>
> > > > Post your pacemaker config or pastebin link to it and we'll be
> > > > able
>
> > > > to help more.
>
> > >
>
> > > > Hth
>
> > >
>
> > > > Jake
>
> > >
>
> > > > From: Richard Alan McAlexander
>
> > >
>
> > > > Sent: Mon, 15/10/2012 06:39 PM
>
> > >
>
> > > > To: pacemaker at oss.clusterlabs.org
>
> > >
>
> > > > Subject: [Pacemaker] Unable to add ping resource to pacemaker
>
> > > > 1.0.12
>
> > >
>
> > > > _______________________________________________
>
> > >
>
> > > > Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>
> > >
>
> > > > http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> > >
>
> > > > Project Home: http://www.clusterlabs.org
>
> > >
>
> > > > Getting started:
>
> > > > http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>
> > >
>
> > > > Bugs: http://bugs.clusterlabs.org
>
> > >
>
> > > _______________________________________________
>
> > > Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>
> > > http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> > > Project Home: http://www.clusterlabs.org
>
> > > Getting started:
>
> > > http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>
> > > Bugs: http://bugs.clusterlabs.org
>
> > _______________________________________________
>
> > Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>
> > http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> > Project Home: http://www.clusterlabs.org
>
> > Getting started:
> > http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>
> > Bugs: http://bugs.clusterlabs.org
>
More information about the Pacemaker
mailing list