[Pacemaker] Understanding rules: location, colocation, order. Using with Master/Slave

Adrian Chapela achapela.rexistros at gmail.com
Mon Oct 27 15:46:41 UTC 2008


Hello!

I am working on a cluster with a two Master/Slave instances.

I have: 2 drbd Master/Slave instance, 1 pingd clone instance, 1 group 
with Filesystem resource.

ms-drbd0 is the first Master/Slave
ms-drbd1 is the second Master/Slave
mail_Group is the first group, it depends on ms-drbd0
samba_Group is the second group, it depends on ms-drbd1

I have the next rules:

<rsc_order id="mail-drbd0_before_fs0" from="Montaxe_mail" action="start" 
to="ms-drbd0" to_action="promote"/>
<rsc_order id="samba-drbd1_before_fs0" from="Montaxe_samba" 
action="start" to="ms-drbd1" to_action="promote"/>
(starts Montaxe_mail when ms-drbd0 has been promoted, start 
Montaxe_samba when ms-drbd1 has been promoted. These rules are ok, I think)

<rsc_colocation id="mail_Group_on_ms-drbd0" to="ms-drbd0" 
to_role="master" from="mail_Group" score="INFINITY"/>
<rsc_colocation id="samba_Group_on_ms-drbd1" to="ms-drbd1" 
to_role="master" from="samba_Group" score="INFINITY"/>
(Run mail_Group only on the master node, run samba_Group on the master 
node)

<rsc_location id="mail:drbd" rsc="ms-drbd0">
 <rule id="rule:ms-drbd0" role="master" score="100">
     <expression  attribute="#uname" operation="eq" value="debianquagga2"/>
 </rule>
 <rule id="mail_Group:pingd:rule" score="-INFINITY" boolean_op="or">
      <expression id="mail_Group:pingd:expr:undefined" attribute="pingd" 
operation="not_defined"/>
      <expression id="mail_Group:pingd:expr:zero" attribute="pingd" 
operation="lte" value="0"/>
 </rule>
</rsc_location>
<rsc_location id="samba:drbd" rsc="ms-drbd1">
 <rule id="rule:ms-drbd1" role="master" score="100">
     <expression  attribute="#uname" operation="eq" value="debianquagga2"/>
 </rule>
 <rule id="samba_Group:pingd:rule" score="-INFINITY" boolean_op="or">
      <expression id="samba_Group:pingd:expr:undefined" 
attribute="pingd" operation="not_defined"/>
      <expression id="samba_Group:pingd:expr:zero" attribute="pingd" 
operation="lte" value="0"/>
 </rule>
</rsc_location>
(Select debianquagga2 as Master and if the node lost its connection take 
the score -INFINITY to do failover, it applies to ms-drbd0 and ms-drbd1)

With this rules all is working very well but the node selected as master 
isn't "debianquagga2",   Why could be the reason ?

I using Heartbeat 2.1.4




More information about the Pacemaker mailing list