Hi,

I'm working on setting up a 3 node cluster with DRBD master/slave resources, 
constraints, and ordering.

The purpose is to have 3 nodes, one with a postgresql database, and 2 with 
apache frontends, connecting to the database.

I wanted to set up the cluster so that with 3 nodes alive, there is one node 
for each, and if there are only 2 nodes alive, one apache instance is stopped 
and one server hosts postgresql and one apache.
So I put a higher priority to the postgresql group than to the 2 others. And 
then I put location constraints (the nodes hosting the drbd periphals), 
ordering constraints (postgresql before the other ones, each drbd to master 
before its associated application group) and colocation constraints (don't 
want 2 application groups on the same node).


I've managed to create a simplified test case showing what's not working.

It's still a 3 node cluster, but the third node is standby and not used.

One hosts postgresql, the other one apache.

If I put the node hosting apache offline, postgresql is stopped too.

Attached is the cib used for the test.

The problematic rule seems to be :
<rsc_colocation from="postgresr2" to="applisr1" id="postgresr2_applisr1" 
score="-INFINITY"/>

If I remove it, postgresql is not stopped anymore when I have only one node 
remaining (which I want). Of course, I then get apache on the same node (on a 
2 node case, that would be ok, but the ultimate purpose is to solve the 
original 3 node case).

Anyone knows what I'm doing wrong ?

Thanks for helping.

Cheers

Marc
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
         <attributes>
           <nvpair name="default-resource-stickiness" id="cib-bootstrap-options-default-resource-stickiness" value="0"/>
           <nvpair name="last-lrm-refresh" id="cib-bootstrap-options-last-lrm-refresh" value="1200576780"/>
           <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.3-node: 552305612591183b1628baa5bc6e903e0f1e26a3"/>
         </attributes>
       </cluster_property_set>
     </crm_config>
     <nodes>
       <node uname="drbdtest3" type="normal" id="3091f668-4bbe-4c7d-88b7-8fdfce1dd268">
         <instance_attributes id="nodes-3091f668-4bbe-4c7d-88b7-8fdfce1dd268">
           <attributes>
             <nvpair name="standby" id="standby-3091f668-4bbe-4c7d-88b7-8fdfce1dd268" value="on"/>
           </attributes>
         </instance_attributes>
       </node>
       <node uname="drbdtest2" type="normal" id="de86a1d4-8d8f-4fb7-b57c-254dba2ab744">
         <instance_attributes id="nodes-de86a1d4-8d8f-4fb7-b57c-254dba2ab744">
           <attributes>
             <nvpair name="standby" id="standby-de86a1d4-8d8f-4fb7-b57c-254dba2ab744" value="true"/>
           </attributes>
         </instance_attributes>
       </node>
       <node uname="drbdtest1" type="normal" id="09514e46-9f06-4242-9499-89d4db7fee5f">
         <instance_attributes id="nodes-09514e46-9f06-4242-9499-89d4db7fee5f">
           <attributes>
             <nvpair name="standby" id="standby-09514e46-9f06-4242-9499-89d4db7fee5f" value="off"/>
           </attributes>
         </instance_attributes>
       </node>
     </nodes>
     <resources>
       <group id="applisr1">
         <primitive id="ipr1" class="ocf" type="IPaddr2" provider="heartbeat">
           <instance_attributes id="ipr1_instance_attrs">
             <attributes>
               <nvpair id="addripr1" name="ip" value="89.195.5.152"/>
               <nvpair id="cidripr1" name="cidr_netmask" value="8"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive id="apacher1" class="ocf" type="Filesystem" provider="heartbeat">
           <instance_attributes id="u01_instance_attrs">
             <attributes>
               <nvpair id="typefsr1" name="fstype" value="ext3"/>
               <nvpair id="ptmontr1" name="directory" value="/apacher1"/>
               <nvpair id="devr1" name="device" value="/dev/drbd1"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive id="resource_apache2r1" class="ocf" type="apache" provider="heartbeat">
           <instance_attributes id="resource_apache2r1_instance_attrs">
             <attributes>
               <nvpair id="confapacher1" name="configfile" value="/apacher1/etc/apache2/apache2.conf"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <instance_attributes id="applisr1_instance_attrs">
           <attributes>
             <nvpair id="applisr1prio" name="priority" value="10"/>
           </attributes>
         </instance_attributes>
       </group>
       <group id="postgresr2">
         <primitive class="ocf" type="IPaddr2" provider="heartbeat" id="ipr2">
           <instance_attributes id="ipr2_instance_attrs">
             <attributes>
               <nvpair id="addripr2" name="ip" value="89.195.5.151"/>
               <nvpair id="cidripr2" name="cidr_netmask" value="8"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive id="r2" class="ocf" type="Filesystem" provider="heartbeat">
           <instance_attributes id="r2_instance_attrs">
             <attributes>
               <nvpair id="typefsr2" name="fstype" value="ext3"/>
               <nvpair id="ptmontr2" name="device" value="/dev/drbd2"/>
               <nvpair id="devr2" name="directory" value="/postgresr2"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive class="ocf" type="pgsql" provider="heartbeat" id="pgsql">
           <instance_attributes id="pgsql_instance_attrs">
             <attributes>
               <nvpair id="pgctlr2" name="pgctl" value="/usr/lib/postgresql/8.2/bin/pg_ctl"/>
               <nvpair id="pgdatar2" name="pgdata" value="/postgresr2/clusterpg"/>
               <nvpair id="pghostr2" name="pghost" value="89.195.5.151"/>
               <nvpair id="pgdbr2" name="pgdb" value="template1"/>
               <nvpair id="pgdbar2" name="pgdba" value="postgres"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <instance_attributes id="postgresr2_instance_attrs">
           <attributes>
             <nvpair name="priority" id="postgresr2prio" value="100"/>
           </attributes>
         </instance_attributes>
       </group>
       <master_slave id="cloner1">
         <meta_attributes id="cloner1_instance_attrs">
           <attributes>
             <nvpair id="cloner1_clone_max" name="clone_max" value="2"/>
             <nvpair id="cloner1_clone_node_max" name="clone_node_max" value="1"/>
             <nvpair id="cloner1_master_max" name="master_max" value="1"/>
             <nvpair id="cloner1_master_node_max" name="master_node_max" value="1"/>
             <nvpair id="cloner1_notify" name="notify" value="yes"/>
             <nvpair id="cloner1_globally_unique" name="globally_unique" value="false"/>
           </attributes>
         </meta_attributes>
         <primitive id="resource_drbdr1" class="ocf" type="drbd" provider="heartbeat">
           <instance_attributes id="resource_drbdr1_instance_attrs">
             <attributes>
               <nvpair id="drbdr1_resource_name" name="drbd_resource" value="r1"/>
             </attributes>
           </instance_attributes>
           <operations/>
         </primitive>
         <instance_attributes id="cloner1_instance_attrs">
           <attributes/>
         </instance_attributes>
       </master_slave>
       <master_slave id="cloner2">
         <meta_attributes id="cloner2_instance_attrs">
           <attributes>
             <nvpair id="cloner2_clone_max" name="clone_max" value="2"/>
             <nvpair id="cloner2_clone_node_max" name="clone_node_max" value="1"/>
             <nvpair id="cloner2_master_max" name="master_max" value="1"/>
             <nvpair id="cloner2_master_node_max" name="master_node_max" value="1"/>
             <nvpair id="cloner2_notify" name="notify" value="yes"/>
             <nvpair id="cloner2_globally_unique" name="globally_unique" value="false"/>
           </attributes>
         </meta_attributes>
         <primitive id="resource_drbdr2" class="ocf" type="drbd" provider="heartbeat">
           <instance_attributes id="resource_drbdr2_instance_attrs">
             <attributes>
               <nvpair id="drbdr2_resource_name" name="drbd_resource" value="r2"/>
             </attributes>
           </instance_attributes>
           <operations/>
         </primitive>
         <instance_attributes id="cloner2_instance_attrs">
           <attributes/>
         </instance_attributes>
       </master_slave>
     </resources>
     <constraints>
       <rsc_location id="prefloc:applisr1" rsc="applisr1">
         <rule id="rule:preflocapplisr1" score="1000">
           <expression attribute="#uname" operation="eq" value="drbdtest2" id="exprrule0:preflocapplisr1"/>
         </rule>
       </rsc_location>
       <rsc_location id="secloc:applisr1" rsc="applisr1">
         <rule id="rule:seclocapplisr1" score="100">
           <expression attribute="#uname" operation="eq" value="drbdtest1" id="exprrule0:secloccapplisr1"/>
         </rule>
       </rsc_location>
       <rsc_location id="prefloc:postgresr2" rsc="postgresr2">
         <rule id="rule:preflocpostgresr2" score="1000">
           <expression attribute="#uname" operation="eq" value="drbdtest1" id="exprrule0:preflocpostgresr2"/>
         </rule>
       </rsc_location>
       <rsc_location id="place_r2_drbdtest2" rsc="cloner2">
         <rule id="place_r2_drbdtest2" score="-INFINITY">
           <expression attribute="#uname" id="cloner2_drbdtest2" operation="eq" value="drbdtest2"/>
         </rule>
       </rsc_location>
       <rsc_location id="place_r3_drbdtest1" rsc="cloner3">
         <rule id="place_r3_drbdtest1" score="-INFINITY">
           <expression attribute="#uname" id="cloner3_drbdtest1" operation="eq" value="drbdtest1"/>
         </rule>
       </rsc_location>
       <rsc_colocation from="applisr1" to="cloner1" score="+INFINITY" id="r1_et_applis"/>
       <rsc_colocation from="applisr2" to="cloner2" score="+INFINITY" id="r2_et_applis"/>
       <rsc_order id="r1_avant_applisr1" from="applisr1" action="start" to="cloner1" to_action="promote" type="after" symmetrical="true"/>
       <rsc_order id="r2_avant_postgresr2" from="postgresr2" action="start" to="cloner2" to_action="promote" type="after" symmetrical="true"/>
       <rsc_colocation from="postgresr2" to="applisr1" id="postgresr2_applisr1" score="-INFINITY"/>
       <rsc_order action="start" symmetrical="true" id="postgresr2_avantr1" from="postgresr2" to="applisr1" type="before"/>
     </constraints>
   </configuration>
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to