[Pacemaker] Clone configuration help

Mihai unixro at gmail.com
Tue May 26 13:00:04 UTC 2009


Hello, 
I am having some problems trying to configure a cluster made of 3 servers. 
Server 1 - resources sql http sip +ip0
Server 2 - resources sql http sip +ip1
Server 3 - resources sip        +ip3

What I did since sip depends on sql being started and also the ipX depends on sip started is created a group between: 
http+sql     next created a clone of this group (max-clones=2 and only one per server) with location restrictions on server 1 +2 and -infinity on 3 (let's call this clonesql)
Created a clone with sip (let's call this clonesip) with max-clones=3 and only 1 per server

Also created a collocation constraint for ip0-3 to start only on clonesip. 
I've put the whole config bellow. 
Tested scenarios: 
Changed on server 3 init script to return 1 on start and stopped sip. The ip3 moved to server 2. And this was correct. 
Then started it again. 
Next stopped sql on server 2, since this caused sip on server 3 to stopped (sip on server 3 was connected to sql on server2) this caused an undesired  behavior.  Instead of moving all the ips on server on it stopped them all, 
Also clone-sip stopped working on all servers: (I might have done this two times to end up here) 
My problem is what am i doing wrong here, since if i understood the manual correctly then this shouldn't be happening. Also if I try similar configuration with collocation_set or order_set it does not take them into account. 

I'm using the public rpms from opensuse repository pacemaker-1.0.3-2.2 for centos 5 x86_64


Here is crm_mon output: 


Last updated: Tue May 26 14:55:52 2009
Current DC: registration1 - partition with quorum
3 Nodes configured, 2 expected votes
5 Resources configured.
============

Online: [ registration2 registration3 registration1 ]
Clone Set: clonesql
    Resource Group: voip:2
        failover-sql:2  (lsb:mysql):     ORPHANED Stopped
        failover-http:2 (lsb:voip):   ORPHANED Started registration1
        Started: [ registration1 ]
        Stopped: [ voipnow:0 ]

Failed actions:
    failover-sql:0_monitor_30000 (node=registration2, call=55, rc=7, status=complete): not running
    failover-sip:2_monitor_15000 (node=registration2, call=76, rc=7, status=complete): not running
    failover-sip:0_monitor_15000 (node=registration2, call=86, rc=7, status=complete): not running
    failover-ip0_start_0 (node=registration3, call=13, rc=1, status=complete): unknown error
    failover-sip:1_monitor_15000 (node=registration3, call=1717, rc=7, status=complete): not running

#default vars:
crm_attribute --attr-name stonith-enabled --attr-value false
crm_attribute --attr-name stop-orphan-resources --attr-value true
crm_attribute --attr-name stop-orphan-actions --attr-value true


<constraints>
<rsc_order id="order-sip" first="clonesip" score="INFINITY" then="clonesql"/>
<rsc_location id="loc-1" rsc="clonesql" node="registration1" score="200"/>
<rsc_location id="loc-2" rsc="clonesql" node="registration2" score="200"/>
<rsc_location id="loc-3" rsc="clonesql" node="registration3" score="-INFINITY"/>
<rsc_location id="loc-4" rsc="failover-ip0" node="registration1" score="15000"/>
<rsc_location id="loc-5" rsc="failover-ip0" node="registration2" score="1000"/>
<rsc_location id="loc-6" rsc="failover-ip0" node="registration3" score="-INFINITY"/>
<rsc_location id="loc-7" rsc="failover-ip1" node="registration1" score="1000"/>
<rsc_location id="loc-8" rsc="failover-ip1" node="registration2" score="15000"/>
<rsc_location id="loc-9" rsc="failover-ip1" node="registration3" score="-INFINITY"/>
<rsc_location id="loc-10" rsc="failover-ip2" node="registration1" score="100"/>
<rsc_location id="loc-11" rsc="failover-ip2" node="registration2" score="1000"/>
<rsc_location id="loc-12" rsc="failover-ip2" node="registration3" score="15000"/>
<rsc_colocation id="ip0-colo" rsc="failover-ip0" score="INFINITY" with-rsc="clonesip"/>
<rsc_colocation id="ip1-colo" rsc="failover-ip1" score="INFINITY" with-rsc="clonesip"/>
<rsc_colocation id="ip2-colo" rsc="failover-ip2" score="INFINITY" with-rsc="clonesip"/>

</constraints>


<resources>
      <primitive class="ocf" id="failover-ip0" provider="heartbeat" type="IPaddr">
        <instance_attributes id="failover-ip0-instance_attributes">
          <nvpair id="failover-ip0-instance_attributes-ip" name="ip" value="192.168.1.3"/>
        </instance_attributes>
        <operations>
          <op id="failover-ip0-monitor-10s" interval="10s" name="monitor" on-fail="stop"/>
        </operations>
        <meta_attributes id="failover-ip0-meta_attributes">
          <nvpair id="failover-ip0-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
      </primitive>
      <primitive class="ocf" id="failover-ip1" provider="heartbeat" type="IPaddr">
        <instance_attributes id="failover-ip1-instance_attributes">
          <nvpair id="failover-ip1-instance_attributes-ip" name="ip" value="192.168.1.5"/>
        </instance_attributes>
        <operations>
          <op id="failover-ip1-monitor-10s" interval="10s" name="monitor" on-fail="stop"/>
        </operations>
        <meta_attributes id="failover-ip1-meta_attributes">
          <nvpair id="failover-ip1-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
      </primitive>
      <primitive class="ocf" id="failover-ip2" provider="heartbeat" type="IPaddr">
        <instance_attributes id="failover-ip2-instance_attributes">
          <nvpair id="failover-ip2-instance_attributes-ip" name="ip" value="192.168.1.7"/>
        </instance_attributes>
        <operations>
          <op id="failover-ip2-monitor-10s" interval="10s" name="monitor" on-fail="stop"/>
        </operations>
        <meta_attributes id="failover-ip2-meta_attributes">
          <nvpair id="failover-ip2-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
      </primitive>
  <clone id="clonesip">
    <meta_attributes id="clonesip-meta_attributes">
        <nvpair id="clonesip-meta_attributes-clone-max" name="clone-max" value="3"/>
        <nvpair id="clonesip-meta_attributes-globally-unique" name="globally-unique" value="false"/>
        <nvpair id="clonesip-meta_attributes-clone-node-max" name="clone-node-max" value="1" />
    </meta_attributes>

    <primitive class="lsb" id="failover-sip" type="kamailio">
      <operations>
        <op id="failover-sip-monitor-15s" interval="15s" name="monitor" on-fail="stop"/>
      </operations>
      <meta_attributes id="failover-sip-meta_attributes">
        <nvpair id="failover-sip-meta_attributes-target-role" name="target-role" value="Started"/>
      </meta_attributes>
    </primitive>
 </clone>
  <clone id="clonesql">
    <meta_attributes id="clonesql-meta_attributes">
        <nvpair id="clonesql-meta_attributes-clone-max" name="clone-max" value="2"/>
        <nvpair id="clonesql-meta_attributes-globally-unique" name="globally-unique" value="false"/>
        <nvpair id="clonesql-meta_attributes-clone-node-max" name="clone-node-max" value="1" />
    </meta_attributes>

  <group id="voip" >
    <meta_attributes id="voip-meta_attributes">
           <nvpair id="voip-meta_attributes-collocated" name="collocated" value="true"/>

    </meta_attributes>

    <primitive class="lsb" id="failover-sql" type="mysql">
      <operations>
        <op id="failover-sql-start" name="start" interval="0" timeout="30s"/>
        <op id="failover-sql-stop" name="stop" interval="0" timeout="30s"/>
        <op id="failover-sql-monitor-30s" interval="30s" name="monitor" on-fail="stop"/>
      </operations>
      <meta_attributes id="failover-sql-meta_attributes">
        <nvpair id="failover-sql-meta_attributes-target-role" name="target-role" value="Started"/>
      </meta_attributes>
    </primitive>
    <primitive class="lsb" id="failover-http" type="voip">
      <operations>
        <op id="failover-http-monitor-15s" interval="15s" name="monitor" on-fail="stop"/>
      </operations>
      <meta_attributes id="failover-http-meta_attributes">
        <nvpair id="failover-http-meta_attributes-target-role" name="target-role" value="Started"/>
      </meta_attributes>
    </primitive>
  </group>
  </clone>
</resources>





More information about the Pacemaker mailing list