[Pacemaker] Ordering resource groups

Keith Ouellette Keith.Ouellette at Airgas.com
Wed Jan 9 15:43:02 EST 2013


I appreciate the quick response. I am relatively new to pacemaker, so I am trying to do this with the crm_gui. I just figured out how to get an XML representation of the resources and constraints configuration that I have. I will look ath these links. Also, here is the XML configuration 

<resources>
      <primitive class="ocf" id="ClusterIP" provider="heartbeat" type="IPaddr2">
        <meta_attributes id="ClusterIP-meta_attributes">
          <nvpair id="ClusterIP-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
        <operations id="ClusterIP-operations">
          <op id="ClusterIP-op-monitor-10s" interval="10s" name="monitor" timeout="20s"/>
        </operations>
        <instance_attributes id="ClusterIP-instance_attributes">
          <nvpair id="ClusterIP-instance_attributes-ip" name="ip" value="172.16.0.110"/>
          <nvpair id="ClusterIP-instance_attributes-cidr_netmask" name="cidr_netmask" value="24"/>
        </instance_attributes>
      </primitive>
      <primitive class="ocf" id="pgsql" provider="heartbeat" type="pgsql">
        <meta_attributes id="pgsql-meta_attributes">
          <nvpair id="pgsql-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
        <operations id="pgsql-operations">
          <op id="pgsql-op-start-0" interval="0" name="start" on-fail="restart" timeout="120"/>
          <op id="pgsql-op-monitor-7" interval="7" name="monitor" on-fail="restart" timeout="60"/>
          <op id="pgsql-op-monitor-Master-60" interval="60" name="monitor" on-fail="restart" role="Master" timeout="30"/>
          <op id="pgsql-op-promote-0" interval="0" name="promote" on-fail="restart" timeout="60"/>
          <op id="pgsql-op-stop-0" interval="0" name="stop" on-fail="block" timeout="60"/>
          <op id="pgsql-op-demote-0" interval="0" name="demote" on-fail="block" timeout="60"/>
          <op id="pgsql-op-notify-0" interval="0" name="notify" timeout="60"/>
        </operations>
        <instance_attributes id="pgsql-instance_attributes">
          <nvpair id="pgsql-instance_attributes-pgctl" name="pgctl" value="/opt/PostgreSQL/9.2/bin/pg_ctl"/>
          <nvpair id="pgsql-instance_attributes-psql" name="psql" value="/opt/PostgreSQL/9.2/bin/psql"/>
          <nvpair id="pgsql-instance_attributes-pgdata" name="pgdata" value="/opt/PostgreSQL/9.2/data/"/>
          <nvpair id="pgsql-instance_attributes-start_opt" name="start_opt" value="-p 5432"/>
          <nvpair id="pgsql-instance_attributes-rep_mode" name="rep_mode" value="sync"/>
          <nvpair id="pgsql-instance_attributes-node_list" name="node_list" value="test-db1 test-db2"/>
          <nvpair id="pgsql-instance_attributes-restore_command" name="restore_command" value="cp /opt/PostgreSQL/9.2/data/archive/%f %p"/>
          <nvpair id="pgsql-instance_attributes-primary_conninfo_opt" name="primary_conninfo_opt" value="keepalives_idle=60 keepalives_interval=5 keepalives_count=5"/>
          <nvpair id="pgsql-instance_attributes-master_ip" name="master_ip" value="172.16.0.111"/>
          <nvpair id="pgsql-instance_attributes-stop_escalate" name="stop_escalate" value="0"/>
        </instance_attributes>
      </primitive>
    </resources>
<constraints>
      <rsc_location id="rsc-location-1" rsc="ClusterIP">
        <rule id="rsc-location-1-rule" score="200">
          <expression attribute="pgsql-status" id="rsc-location-1-rule-pgsql-status" operation="eq" value="HS:sync"/>
        </rule>
        <rule id="rsc-location-1-rule-0" score="100">
          <expression attribute="pgsql-status" id="rsc-location-1-rule-0-pgsql-status" operation="eq" value="PRI"/>
        </rule>
        <rule id="rsc-location-1-rule-1" score="-INFINITY">
          <expression attribute="pgsql-status" id="rsc-location-1-rule-1-pgsql-status" operation="not_defined"/>
        </rule>
        <rule boolean-op="and" id="rsc-location-1-rule-2" score="-INFINITY">
          <expression attribute="pgsql-status" id="rsc-location-1-rule-2-pgsql-status" operation="ne" value="HS:sync"/>
          <expression attribute="pgsql-status" id="rsc-location-1-rule-2-pgsql-status-0" operation="ne" value="PRI"/>
        </rule>
      </rsc_location>
      <rsc_location id="rsc-location-2" rsc="pgsql">
        <rule id="rsc-location-2-rule" role="Master" score="200">
          <expression attribute="#uname" id="rsc-location-2-rule-.uname" operation="eq" value="test-db1"/>
        </rule>
        <rule id="rsc-location-2-rule-0" role="Master" score="100">
          <expression attribute="#uname" id="rsc-location-2-rule-0-.uname" operation="eq" value="test-db2"/>
        </rule>
        <rule id="rsc-location-2-rule-1" role="Master" score="-INFINITY">
          <expression attribute="fail-count-ClusterIP" id="rsc-location-2-rule-1-fail-count-ClusterIP" operation="defined"/>
        </rule>
        <rule boolean-op="or" id="rsc-location-2-rule-2" score="-INFINITY">
          <expression attribute="default_ping_set" id="rsc-location-2-rule-2-default_ping_set" operation="not_defined"/>
          <expression attribute="default_ping_set" id="rsc-location-2-rule-2-default_ping_set-0" operation="lt" value="100"/>
        </rule>
      </rsc_location>
      <rsc_colocation id="rsc_colo-1" rsc="pgsql" score="INFINITY" with-rsc="ClusterIP"/>
      <rsc_order first="ClusterIP" first-action="start" id="rsc_order_1" symmetrical="false" then="pgsql" then-action="promote"/>
    </constraints>

Thanks,
Keith


________________________________________
From: David Vossel [dvossel at redhat.com]
Sent: Wednesday, January 09, 2013 2:48 PM
To: The Pacemaker cluster resource manager
Subject: Re: [Pacemaker] Ordering resource groups

----- Original Message -----
> From: "aRaviNd" <ambadiaravind at gmail.com>
> To: pacemaker at oss.clusterlabs.org
> Sent: Wednesday, January 9, 2013 9:58:55 AM
> Subject: [Pacemaker] Ordering resource groups
> Hi,
>
> I have configured 2 node cluster using pacemaker and corosync in
> Debian. One resource group is configured for cluster filesystem
> ocfs2 which contain resources dlm, o2cb, clvm etc. This resource
> group is cloned to run on both the servers.
>
> Another resource group is configured for service icinga with
> resources mysql, ido2db and icinga.
>
> I need to configure ordering constraint to start icinga resource
> group after ocfs resource group.
>
> But when i configure the ordering constraint it says no resource or
> template by name ocfs resource group name.
>
> Could you please let me know if it possible to configure ordering
> with resource group.

Yes, it is definitely possible.
http://clusterlabs.org/doc/en-US/Pacemaker/1.1-crmsh/html-single/Pacemaker_Explained/index.html#_group_constraints

and
http://clusterlabs.org/doc/en-US/Pacemaker/1.1-crmsh/html-single/Pacemaker_Explained/index.html#_clone_constraints

shows the xml representation in the cib.

Are you using a configuration tool like crm or pcs?  If so this may be a problem with that project.

-- Vossel


>
>
> If it is not possible how can i achieve the above configuration.
>
>
> Thanks in advance.
>
>
> Rgds,
> Aravind M D
>
>
>
>
>
>
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started:
> http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
>

_______________________________________________
Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org



More information about the Pacemaker mailing list