Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Pacemaker

Question about master/slave resource promotion

 

 

Linux-HA pacemaker RSS feed   Index | Next | Previous | View Threaded


dvossel at redhat

Feb 24, 2012, 3:31 PM

Post #1 of 4 (1444 views)
Permalink
Question about master/slave resource promotion

Hey,

I have a 2 node cluster with a multi-state master/slave resource. When the multi-state resources start up on each node they enter the Slave role.  At that point I can't figure out how to promote the resource to activate the Master role on one of the nodes. Is there anything special I need to do to get an instance of my multi-state resource to promote to the Master role?

I'm using corosync v1 plugin if that makes any difference.  Below is a simple configuration demonstrating what is going on.  After promoting the resource in the last step, I'd expect to see a Master resource on one node, and a Slave resource on the other.  That doesn't happen, I end up with two Slave resources instead.

-------------- CRM showing config and attempt at promotion of MS_DUMMY resource.
crm(live)# configure show
node fc16-builder
node fc16-builder2
primitive DUMMY ocf:pacemaker:Dummy \
        op monitor interval="15" role="Slave" timeout="60s" \
        op monitor interval="30" role="Master" timeout="60s"
ms MS_DUMMY DUMMY \
        meta target-role="Master" clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="true"
property $id="cib-bootstrap-options" \
        dc-version="1.1.6-8567333" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        stonith-enabled="false" \
        no-quorum-policy="ignore"

crm(live)# resource status
 Master/Slave Set: MS_DUMMY [DUMMY]
     Slaves: [ fc16-builder fc16-builder2 ]

crm(live)# resource promote MS_DUMMY

crm(live)# resource status
 Master/Slave Set: MS_DUMMY [DUMMY]
     Slaves: [ fc16-builder fc16-builder2 ]
------------------------------------------------


---- CIB configuration
  <configuration>
    <crm_config>
      <cluster_property_set id="cib-bootstrap-options">
        <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1.1.6-8567333"/>
        <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>
    <nodes>
      <node id="fc16-builder" type="normal" uname="fc16-builder"/>
      <node id="fc16-builder2" type="normal" uname="fc16-builder2"/>
    </nodes>
    <resources>
      <master id="MS_DUMMY">
        <meta_attributes id="MS_DUMMY-meta_attributes">
          <nvpair id="MS_DUMMY-meta_attributes-target-role" name="target-role" value="Master"/>
          <nvpair id="MS_DUMMY-meta_attributes-clone-max" name="clone-max" value="2"/>
          <nvpair id="MS_DUMMY-meta_attributes-clone-node-max" name="clone-node-max" value="1"/>
          <nvpair id="MS_DUMMY-meta_attributes-master-max" name="master-max" value="1"/>
          <nvpair id="MS_DUMMY-meta_attributes-master-node-max" name="master-node-max" value="1"/>
          <nvpair id="MS_DUMMY-meta_attributes-notify" name="notify" value="true"/>
        </meta_attributes>
        <primitive class="ocf" id="DUMMY" provider="pacemaker" type="Dummy">
          <operations>
            <op id="DUMMY-monitor-15s" interval="15" name="monitor" role="Slave" timeout="60s"/>
            <op id="DUNNY-monitor-30s" interval="30" name="monitor" role="Master" timeout="60s"/>
          </operations>
        </primitive>
      </master>
    </resources>
    <constraints/>
  </configuration>


Thanks,
-- David

_______________________________________________
Pacemaker mailing list: Pacemaker [at] oss
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


florian at hastexo

Feb 25, 2012, 12:52 AM

Post #2 of 4 (1409 views)
Permalink
Re: Question about master/slave resource promotion [In reply to]

On Sat, Feb 25, 2012 at 12:31 AM, David Vossel <dvossel [at] redhat> wrote:
> Hey,
>
> I have a 2 node cluster with a multi-state master/slave resource. When the multi-state resources start up on each node they enter the Slave role.  At that point I can't figure out how to promote the resource to activate the Master role on one of the nodes. Is there anything special I need to do to get an instance of my multi-state resource to promote to the Master role?

Yeah, actually using a resource type that is capable of running in
master/slave mode would be a good start. :) Use ocf:pacemaker:Stateful
instead of ocf:pacemaker:Dummy in your test setup.

Hope this helps.

Cheers,
Florian

--
Need help with High Availability?
http://www.hastexo.com/now

_______________________________________________
Pacemaker mailing list: Pacemaker [at] oss
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


dvossel at redhat

Feb 25, 2012, 4:08 PM

Post #3 of 4 (1409 views)
Permalink
Re: Question about master/slave resource promotion [In reply to]

----- Original Message -----
> From: "Florian Haas" <florian [at] hastexo>
> To: "The Pacemaker cluster resource manager" <pacemaker [at] oss>
> Sent: Saturday, February 25, 2012 2:52:54 AM
> Subject: Re: [Pacemaker] Question about master/slave resource promotion
>
> On Sat, Feb 25, 2012 at 12:31 AM, David Vossel <dvossel [at] redhat>
> wrote:
> > Hey,
> >
> > I have a 2 node cluster with a multi-state master/slave resource.
> > When the multi-state resources start up on each node they enter
> > the Slave role.  At that point I can't figure out how to promote
> > the resource to activate the Master role on one of the nodes. Is
> > there anything special I need to do to get an instance of my
> > multi-state resource to promote to the Master role?
>
> Yeah, actually using a resource type that is capable of running in
> master/slave mode would be a good start. :) Use
> ocf:pacemaker:Stateful
> instead of ocf:pacemaker:Dummy in your test setup.
>

The example works with the Stateful resource agent, and your comment helped me understand how this concept works better. I was not aware resource agents knew anything about master/slave status. For some reason I had it in my head the master/slave concept was just internal to Pacemaker and we could make whatever we wanted out of it.

thanks:)

--David


> Hope this helps.
>
> Cheers,
> Florian
>
> --
> Need help with High Availability?
> http://www.hastexo.com/now
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker [at] oss
> 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
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


florian at hastexo

Feb 26, 2012, 1:39 AM

Post #4 of 4 (1407 views)
Permalink
Re: Question about master/slave resource promotion [In reply to]

On Sun, Feb 26, 2012 at 1:08 AM, David Vossel <dvossel [at] redhat> wrote:
> ----- Original Message -----
>> From: "Florian Haas" <florian [at] hastexo>
>> Yeah, actually using a resource type that is capable of running in
>> master/slave mode would be a good start. :) Use
>> ocf:pacemaker:Stateful
>> instead of ocf:pacemaker:Dummy in your test setup.
>>
>
> The example works with the Stateful resource agent, and your comment helped me understand how this concept works better. I was not aware resource agents knew anything about master/slave status.  For some reason I had it in my head the master/slave concept was just internal to Pacemaker and we could make whatever we wanted out of it.

If a resource management feature had no bearing on the resources at
all, being just "internal" to the resource manager, what would be the
point of having the feature in the first place?

Any resource that you want to manage as part of a master/slave set
obviously has to support the promote and demote operations. Those that
don't (such as Dummy, for example) have no way of ever getting
promoted.

The following items in the documentation should provide additional insight:

http://www.clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/ch10s03s09.html
http://www.linux-ha.org/doc/dev-guides/_literal_promote_literal_action.html
http://www.linux-ha.org/doc/dev-guides/_literal_demote_literal_action.html

Cheers,
Florian

--
Need help with High Availability?
http://www.hastexo.com/now

_______________________________________________
Pacemaker mailing list: Pacemaker [at] oss
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

Linux-HA pacemaker RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.