On Mon, Feb 06, 2012 at 04:48:26PM -0800, Chet Burgess wrote:
> Greetings,
> 
> I'm some what new to pacemaker and have been playing around with a
> number of configurations in a lab. Most recently I've been testing a
> multistate resource using the ofc:pacemaker:Stateful example RA.
> 
> While I've gotten the agent to work and notice that if I shutdown or
> kill a node the resources migrate I can't seem to figure out the
> proper way to migrate the resource between nodes when they are both
> up. 
> 
> For regular resources I've used "crm resource migrate <rsc>" without
> issue. However when I try this with a multistate resource it doesn't
> seem to work. When I run the command it just puts the slave node into
> a stopped state. If I try and tell it to migrate specifically to the
> slave node it claims to already be running their (which I suppose in a
> sense it is).

the crm shell does not support roles for the "move" or "migrate" command
(yet; maybe in newer versions. Dejan?).

What you need to do is set a location constraint on the role.
 * force master role off from one node:

        location you-name-it resource-id \
                rule $role=Master -inf: \
                #uname eq node-where-it-should-be-slave

 * or force master role off from all but one node,
   note the double negation in this one:

        location you-name-it resource-id \
                rule $role=Master -inf: \
                #uname ne node-where-it-should-be-master

Cheers,

        Lars

---
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

> The only method I've found to safely and reliable migrate a multistate
> resource from one node to another is I think it has something to do
> with the resource constraints I used to prefer a particular node, but
> I'm not entirely sure how the constraints and the master/slave state
> updating stuff works.
> 
> Am I using the wrong tool to migrate a multistate resource or is my
> configuration wrong in some way?  Any input greatly appreciated. 
> Thank you.
> 
> 
> Configuration:
> r...@tst3.local1.mc:/home/cfb$ crm configure show
> node tst3.local1.mc.metacloud.com
> node tst4.local1.mc.metacloud.com
> primitive stateful-test ocf:pacemaker:Stateful \
>       op monitor interval="30s" role="Slave" \
>       op monitor interval="31s" role="Master"
> ms ms-test stateful-test \
>       meta clone-node-max="1" notify="false" master-max="1" 
> master-node-max="1" target-role="Master"
> location ms-test_constraint_1 ms-test 25: tst3.local1.mc.metacloud.com
> location ms-test_constraint_2 ms-test 20: tst4.local1.mc.metacloud.com
> property $id="cib-bootstrap-options" \
>       cluster-infrastructure="openais" \
>       dc-version="1.1.5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f" \
>       last-lrm-refresh="1325273678" \
>       expected-quorum-votes="2" \
>       no-quorum-policy="ignore" \
>       stonith-enabled="false"
> rsc_defaults $id="rsc-options" \
>       resource-stickiness="100"
> 
> --
> Chet Burgess
> c...@liquidreality.org
> 
> 
> 
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker@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@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

Reply via email to