[Pacemaker] (no subject)

Shravan Mishra shravan.mishra at gmail.com
Thu Jan 21 08:43:34 UTC 2010


Hi all,

I have an active-passive 2 node cluster.
Whenever the active/primary node is powered off the services nicely
failover and continue but once the powered off node is brought back
online, instead of staying as secondary/passive node it is again
becoming primary thus leading to a unnecessary failover kind of
scenario.

My question is what kind of constraints can I specify to have my
resources stick to the node where they are currently running and not
jump around.



Please let me know if its possible.


Following is the config that I'm running:

==========
<cib epoch="98" admin_epoch="0" validate-with="pacemaker-1.0"
crm_feature_set="3.0.1" have-quorum="1"
dc-uuid="qa2.e-lab.itactics.com" num_updates="49">
  <configuration>
    <crm_config>
      <cluster_property_set id="cib-bootstrap-options">
        <nvpair id="cib-bootstrap-options-dc-version"
name="dc-version"
value="1.0.5-9e9faaab40f3f97e3c0d623e4a4c47ed83fa1601"/>
        <nvpair id="cib-bootstrap-options-cluster-infrastructure"
name="cluster-infrastructure" value="openais"/>
        <nvpair id="cib-bootstrap-options-expected-quorum-votes"
name="expected-quorum-votes" value="2"/>
        <nvpair id="cib-bootstrap-options-no-quorum-policy"
name="no-quorum-policy" value="ignore"/>
        <nvpair id="cib-bootstrap-options-symmetric-cluster"
name="symmetric-cluster" value="true"/>
        <nvpair id="cib-bootstrap-options-stonith-action"
name="stonith-action" value="reboot"/>
        <nvpair id="cib-bootstrap-options-stonith-enabled"
name="stonith-enabled" value="true"/>
        <nvpair id="cib-bootstrap-options-dc-deadtime"
name="dc-deadtime" value="3min"/>
      </cluster_property_set>
    </crm_config>
    <nodes>
      <node id="qa2.e-lab.itactics.com" uname="qa2.e-lab.itactics.com"
type="normal">
        <instance_attributes id="nodes-qa2.e-lab.itactics.com">
          <nvpair id="nodes-qa2.e-lab.itactics.com-standby"
name="standby" value="off"/>
        </instance_attributes>
      </node>
      <node id="qa1.e-lab.itactics.com" uname="qa1.e-lab.itactics.com"
type="normal">
        <instance_attributes id="nodes-qa1.e-lab.itactics.com">
          <nvpair id="nodes-qa1.e-lab.itactics.com-standby"
name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources>
      <clone id="connectivity">
        <primitive id="ping" provider="pacemaker" class="ocf" type="pingd">
          <instance_attributes id="ping-attrs">
            <nvpair id="pingd-role" name="target-role" value="started"/>
            <nvpair id="pingd-dampen" name="dampen" value="5s"/>
            <nvpair id="pingd-multiplier" name="multiplier" value="1000"/>
            <nvpair id="pingd-hosts" name="host_list" value="172.30.0.1"/>
          </instance_attributes>
          <operations>
            <op id="ping-monitor-60s" interval="60s" timeout="2min"
name="monitor"/>
          </operations>
        </primitive>
      </clone>
      <master id="ms-drbd">
        <meta_attributes id="ma-ms-drbd">
          <nvpair id="ma-ms-drbd-1" name="clone_max" value="2"/>
          <nvpair id="ma-ms-drbd-2" name="clone-node-max" value="1"/>
          <nvpair id="ma-ms-drbd-3" name="notify" value="yes"/>
          <nvpair id="ma-ms-drbd-4" name="globally-unique" value="false"/>
          <nvpair id="ma-ms-drbd-5" name="master-max" value="1"/>
          <nvpair id="ma-ms-drbd-6" name="master-node-max" value="1"/>
          <nvpair id="ma-ms-drbd-7" name="target-role" value="started"/>
        </meta_attributes>
        <primitive id="drbd0" class="ocf" provider="linbit" type="drbd">
          <instance_attributes id="ia-drbd">
            <nvpair id="ia-drbd-1" name="drbd_resource" value="var_nsm"/>
          </instance_attributes>
          <operations>
            <op id="op-drbd-1" name="monitor" interval="59s"
timeout="10s" role="Master"/>
            <op name="start" interval="0" id="op-drbd-2"
timeout="3min" role="Master"/>
            <op name="stop" interval="0" id="op-drbd-3" timeout="3min"
role="Master"/>
            <op id="op-drbd-4" name="monitor" interval="60s"
timeout="10s" role="Slave"/>
            <op id="op-drbd-5" name="start" interval="0"
timeout="3min" role="Slave"/>
            <op id="op-drbd-6" name="stop" interval="0" timeout="3min"
role="Slave"/>
          </operations>
        </primitive>
      </master>
      <primitive class="stonith" type="external/safe/ipmi"
id="qa1.e-lab.itactics.com-stonith">
        <operations>
          <op id="op-qa1.e-lab.itactics.com-stonith-1" name="monitor"
timeout="3min" interval="20s"/>
        </operations>
        <instance_attributes id="qa1.e-lab.itactics.com-attributes">
          <nvpair id="ia-qa1.e-lab.itactics.com-stonith-0"
name="target_role" value="started"/>
          <nvpair id="ia-qa1.e-lab.itactics.com-stonith-1"
name="hostname" value="qa1.e-lab.itactics.com"/>
          <nvpair name="ipaddr"
id="ia-qa1.e-lab.itactics.com-stonith-2" value="192.168.2.7"/>
        </instance_attributes>
      </primitive>
      <primitive class="stonith" type="external/safe/ipmi"
id="qa2.e-lab.itactics.com-stonith">
        <operations>
          <op id="op-qa2.e-lab.itactics.com-stonith-1" name="monitor"
timeout="2min" interval="20s"/>
        </operations>
        <instance_attributes id="qa2.e-lab.itactics.com-attributes">
          <nvpair id="ia-qa2.e-lab.itactics.com-stonith-0"
name="target_role" value="started"/>
          <nvpair id="ia-qa2.e-lab.itactics.com-stonith-1"
name="hostname" value="qa2.e-lab.itactics.com"/>
          <nvpair name="ipaddr"
id="ia-qa2.e-lab.itactics.com-stonith-2" value="192.168.2.8"/>
        </instance_attributes>
      </primitive>
      <group id="svcs_grp">
        <meta_attributes id="ma-svcs">
          <nvpair id="ma-svcs-1" name="target_role" value="started"/>
        </meta_attributes>
        <primitive class="ocf" provider="heartbeat" type="Filesystem" id="fs0">
          <meta_attributes id="ma-fs0">
            <nvpair name="target_role" id="ma-fs0-1" value="stopped"/>
          </meta_attributes>
          <instance_attributes id="ia-fs0">
            <nvpair id="ia-fs0-1" name="fstype" value="xfs"/>
            <nvpair id="ia-fs0-2" name="directory" value="/var/nsm"/>
            <nvpair id="ia-fs0-3" name="device" value="/dev/drbd1"/>
          </instance_attributes>
          <operations>
            <op name="start" interval="0" id="op-fs0-1" timeout="5min"/>
            <op interval="0" id="op-fs0-2" name="stop" timeout="5min"/>
            <op id="op-fs0-3" name="monitor" timeout="3min" interval="20s"/>
          </operations>
        </primitive>
        <primitive id="vip" class="ocf" type="IPaddr2" provider="heartbeat">
          <operations>
            <op id="op-vip-1" name="monitor" timeout="2min" interval="20s"/>
            <op id="op-vip-2" name="start" timeout="4min" interval="0"/>
            <op id="op-vip-3" name="stop" timeout="4min" interval="0"/>
          </operations>
          <instance_attributes id="ia-vip">
            <nvpair id="vip-addr" name="ip" value="172.30.0.18"/>
          </instance_attributes>
        </primitive>
        <primitive class="ocf" type="safe" provider="itactics" id="safe_svcs">
          <operations>
            <op name="start" interval="0" id="op-safe-1" timeout="30min"/>
            <op interval="0" id="op-safe-2" name="stop" timeout="1440min"/>
            <op id="op-safe-3" name="monitor" timeout="30min" interval="20s"/>
          </operations>
          <instance_attributes id="ia-safe">
            <nvpair id="ia-safe-1" name="target-role" value="started"/>
            <nvpair id="ia-safe-2" name="is-managed" value="true"/>
            <nvpair id="ia-safe-3" name="migration-threshold" value="2"/>
          </instance_attributes>
        </primitive>
      </group>
    </resources>
    <constraints>
      <rsc_location id="qa1.e-lab.itactics.com-stonith-placement"
rsc="qa1.e-lab.itactics.com-stonith">
        <rule id="ri-qa1.e-lab.itactics.com-stonith-placement-1"
score="-INFINITY">
          <expression
id="ex-qa1.e-lab.itactics.com-stonith-placement-1"
value="qa1.e-lab.itactics.com" attribute="#uname" operation="eq"/>
        </rule>
      </rsc_location>
      <rsc_location id="qa2.e-lab.itactics.com-stonith-placement"
rsc="qa2.e-lab.itactics.com-stonith">
        <rule id="ri-qa2.e-lab.itactics.com-stonith-placement-1"
score="-INFINITY">
          <expression
id="ex-qa2.e-lab.itactics.com-stonith-placement-1"
value="qa2.e-lab.itactics.com" attribute="#uname" operation="eq"/>
        </rule>
      </rsc_location>
      <rsc_location id="drbd-master" rsc="ms-drbd">
        <rule id="ping-exclude-rule" score="-INFINITY" role="master">
          <expression id="ping-exclude" attribute="pingd"
operation="lt" value="1000"/>
        </rule>
        <rule id="ping-prefer-rule" score-attribute="pingd" role="master">
          <expression id="ping-prefer" attribute="pingd" operation="defined"/>
        </rule>
      </rsc_location>
      <rsc_order first="ms-drbd" first-action="promote"
id="ms-drbd-before-svcs-group" score="INFINITY" then="svcs_grp"
then-action="start"/>
    </constraints>
    <rsc_defaults>
      <meta_attributes id="rsc_defaults-options">
        <nvpair id="resource-stickiness" name="resource-stickiness"
value="1000"/>
      </meta_attributes>
    </rsc_defaults>
  </configuration>
</cib>

==========



Thanks

Shravan




More information about the Pacemaker mailing list