[Pacemaker] Check if resource is running on specific node

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Mar 8 10:49:30 EST 2011


Hi,

On Thu, Mar 03, 2011 at 11:38:23AM +0100, Thomas Baumann wrote:
> Hi,
> 
> I have the following scenario:
> 
> - resource 1 runs on Node A
> - resource 2 should be started on Node B if resource 1 is running on Node A

order o1 inf: r1 r2
location pref-r1 r1 100: nodea
location pref-r2 r2 100: nodeb

> - if resource 1 is not running on Node A, resource 2 should be stopped
> and resource 3 started

r2 should be stopped if r1 is stopped. But I'm not sure how to
make r3 start in that case. Perhaps something like this would
do (or something similar):

colocation no-r3 -inf: r3 r2
location no-r3-on-a r3 -inf: nodea
location pref-r3 r3 50: nodeb

> What attribute is set on Node A, that exactly tells me that the
> resource is running ? I want to use that for the decision how to
> handle the resource on Node B.
> 
> If I check the transient state of the node, I am not sure what to use.

Normally, you use only RA created attributes, for instance by ping.

Thanks,

Dejan

> regards,
> 
> Thomas
> 
> <node_state uname="m-lab-prx-lb-1" ha="active" in_ccm="true"
> crmd="online" shutdown="0" join="member" expected="member"
> id="m-lab-prx-lb-1" crm-debug-origin="do_state_transition">
>       <transient_attributes id="m-lab-prx-lb-1">
>         <instance_attributes id="status-m-lab-prx-lb-1">
>           <nvpair id="status-m-lab-prx-lb-1-probe_complete"
> name="probe_complete" value="true"/>
>           <nvpair
> id="status-m-lab-prx-lb-1-fail-count-res_mysqld_lb1-primitive"
> name="fail-count-res_mysqld_lb1-primitive" value="1"/>
>           <nvpair
> id="status-m-lab-prx-lb-1-last-failure-res_mysqld_lb1-primitive"
> name="last-failure-res_mysqld_lb1-primitive" value="1299094062"/>
>           <nvpair
> id="status-m-lab-prx-lb-1-fail-count-res_ser_lb1-primitive"
> name="fail-count-res_ser_lb1-primitive" value="1"/>
>           <nvpair
> id="status-m-lab-prx-lb-1-last-failure-res_ser_lb1-primitive"
> name="last-failure-res_ser_lb1-primitive" value="1299094062"/>
>         </instance_attributes>
> 
> _______________________________________________
> 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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker




More information about the Pacemaker mailing list