[Pacemaker] Stop all resource on failed node

Andrew Beekhof andrew at beekhof.net
Wed Feb 24 08:39:10 EST 2010


Please keep all emails on the list.

On Feb 24, 2010, at 2:37 PM, Alen Bašić wrote:

> On Wed, 2010-02-24 at 14:18 +0100, Andrew Beekhof wrote:
>> define "failed"
> well, 
> if network is down or some of resources fail and unable to restart on
> node1, failover will occur and node2 will be active, but resources on
> node1 will be "active" and I would like to stop them!

Then you need stonith.


> 
> 
> this is my xml
> <?xml version="1.0" ?>
> <cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="node1" epoch="45"
> have-quorum="1" num_updates="17" validate-with="pacemaker-1.0">
>  <configuration>
>    <crm_config>
>      <cluster_property_set id="cib-bootstrap-options">
>        <nvpair id="cib-bootstrap-options-dc-version" name="dc-version"
> value="1.0.7-d3fa20fc76c7947d6de66db7e52526dc6bd7d782"/>
>        <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-stonith-enabled"
> name="stonith-enabled" value="false"/>
>        <nvpair id="cib-bootstrap-options-no-quorum-policy"
> name="no-quorum-policy" value="ignore"/>
>      </cluster_property_set>
>    </crm_config>
>    <rsc_defaults/>
>    <op_defaults/>
>    <nodes>
>      <node id="node2" type="normal" uname="node2"/>
>      <node id="node1" type="normal" uname="node1"/>
>    </nodes>
>    <resources>
>      <group id="asterisk_fw_cluster">
>        <primitive class="ocf" id="ClusterIP" provider="heartbeat"
> type="IPaddr2">
>          <instance_attributes id="ClusterIP-instance_attributes">
>            <nvpair id="ClusterIP-instance_attributes-ip" name="ip"
> value="192.168.18.212"/>
>            <nvpair id="ClusterIP-instance_attributes-cidr_netmask"
> name="cidr_netmask" value="24"/>
>          </instance_attributes>
>          <operations>
>            <op id="ClusterIP-monitor-30s" interval="30s"
> name="monitor"/>
>          </operations>
>        </primitive>
>        <primitive class="ocf" id="Failover" provider="heartbeat"
> type="openvox"/>
>        <primitive class="ocf" id="Asterisk" provider="heartbeat"
> type="asterisk">
>          <operations>
>            <op id="Asterisk-monitor-30s" interval="30s"
> name="monitor"/>
>          </operations>
>        </primitive>
>        <primitive class="ocf" id="PBXM" provider="heartbeat"
> type="pbxm">
>          <operations>
>            <op id="PBXM-monitor-30s" interval="30s" name="monitor"/>
>          </operations>
>        </primitive>
>      </group>
>      <primitive class="ocf" id="resMON" provider="pacemaker"
> type="ClusterMon">
>        <operations id="resMON-operations">
>          <op id="resMON-monitor-180s" interval="180s" name="monitor"
> timeout="20s"/>
>        </operations>
>        <instance_attributes id="resMON-instance_attributes">
>          <nvpair id="resMON-instance_attributes-htmlfile"
> name="htmlfile" value="/tmp/html.xml"/>
>          <nvpair id="resMON-instance_attributes-extra_options"
> name="extra_options" value="--mail-to me at me.com"/>
>        </instance_attributes>
>      </primitive>
>      <clone id="pingdclone">
>        <meta_attributes id="pingdclone-meta_attributes">
>          <nvpair id="pingdclone-meta_attributes-globally-unique"
> name="globally-unique" value="false"/>
>        </meta_attributes>
>        <primitive class="ocf" id="pingd" provider="pacemaker"
> type="pingd">
>          <instance_attributes id="pingd-instance_attributes">
>            <nvpair id="pingd-instance_attributes-host_list"
> name="host_list" value="192.168.18.253"/>
>            <nvpair id="pingd-instance_attributes-multiplier"
> name="multiplier" value="100"/>
>          </instance_attributes>
>          <operations>
>            <op id="pingd-monitor-20s" interval="20s" name="monitor"
> timeout="5s"/>
>          </operations>
>        </primitive>
>      </clone>
>    </resources>
>    <constraints>
>      <rsc_location id="asterisk_fw_cluster_on_connected_node"
> rsc="asterisk_fw_cluster">
>        <rule boolean-op="or"
> id="asterisk_fw_cluster_on_connected_node-rule" score="-INFINITY">
>          <expression attribute="pingd"
> id="asterisk_fw_cluster_on_connected_node-expression"
> operation="not_defined"/>
>          <expression attribute="pingd"
> id="asterisk_fw_cluster_on_connected_node-expression-0" operation="lte"
> value="0"/>
>        </rule>
>      </rsc_location>
>      <rsc_location id="prefer-node2" node="node1"
> rsc="asterisk_fw_cluster" score="50"/>
>      <rsc_location id="prefer-node1" node="node1"
> rsc="asterisk_fw_cluster" score="50"/>
>      <rsc_location id="failover-only-on-node1" node="node1"
> rsc="asterisk_fw_cluster" score="200"/>
>    </constraints>
>  </configuration>
> </cib>
> 
> 

-- Andrew







More information about the Pacemaker mailing list