[Pacemaker] Proper way to migrate multistate resource?

Michael Schwartzkopff misch at schwartzkopff.org
Tue Feb 7 08:03:32 EST 2012


> 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

These constraints would prevent the MS resource to run in Master state even on 
that node. Even in case the preferred node is not available any more. This 
might be not what Chet wanted.

Perhaps it would be easier if you give the resource some points if it runs in 
Master state on the preferred node:

location name-of-your-constraint resource-id \
  rule $role=Master 100: \
    #uname eq name-of-the-preferred-node

-- 
Dr. Michael Schwartzkopff
Guardinistr. 63
81375 München

Tel: (0163) 172 50 98
Fax: (089) 620 304 13
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20120207/cdcc950a/attachment-0003.sig>


More information about the Pacemaker mailing list