[Pacemaker] Help on setting order of resources

Jake Smith jsmith at argotec.com
Tue Aug 21 15:27:55 UTC 2012




----- Original Message -----
> From: "Adrian Gibanel" <adrian.gibanel at btactic.com>
> To: "The Pacemaker cluster resource manager" <pacemaker at oss.clusterlabs.org>
> Sent: Tuesday, August 21, 2012 10:35:19 AM
> Subject: Re: [Pacemaker] Help on setting order of resources
> 
> Let me explain what made me confused.
> 
> If you have:
> 
> order sample_order inf: 1 2 3
> colocation sample_colo inf: 3 2 1
> 
> it works ok as you say.
> 
> If you have:
> 
> order sample_order inf: 1 2 3
> colocation sample_colo inf: 1 2 3
> 
> it doesn't work at all!
> 
> What order do you infer from last commands?
> My answer always was: Order statement will define the order so it is:
> 1,2,3. If colocation had any order it would be overwritten.
> But it seems to happen that the way it works is: Colocation will
> define the order so it is: 3,2,1: If order had any order defined it
> is overwritten.

Ahh now I see your confusion.  Let me see if I can help.  I'm only going to talk about mandatory order and colocation statements - advisory are a bit different.  I left out the inf: from the order statements above before - I've correct them now.  Ordering and colocation do effect each other but neither wins or overwrites the other.  Pacemaker attempts to fulfill all constraints and does nothing if it can't meet all required mandatory requirements.  First some basic definitions:

order - the mandatory order in which resources must start/stop
colocation - mandatory placement of resource.  Where (what node) a resource is allowed to run based upon the location of another resource.

In the example above that doesn't work:
Ordering is requiring that 1 starts before 2 can start (and 2 before 3).  So 1 has to start up before anything else.
Now the colocation says that 1 has to run where 2 runs and 2 must run where 3 runs.  So until 3 is running we have no valid location to run 2 (and therefore also no place for 1). If 3 isn't running anywhere then 1 and 2 can't run anywhere either.  Ordering doesn't allow us to start 3 until 1 and 2 are started and at the same time colocation doesn't have any valid nodes to run 1 or 2 until we have 3 running in a known location.

End result nothing runs because ordering tries to start 1 and then the colocation says I have no valid node for it because 2 isn't running anywhere so it doesn't start.  Same things hold true for 2 and 3.

More information here that might be clearer than what I said for each as well as more complex examples:
http://www.clusterlabs.org/mwiki/images/d/d6/Ordering_Explained.pdf
http://www.clusterlabs.org/mwiki/images/6/61/Colocation_Explained.pdf

Jake

> 
> ----- Mensaje original -----
> 
> > De: "Jake Smith" <jsmith at argotec.com>
> > Para: "The Pacemaker cluster resource manager"
> > <pacemaker at oss.clusterlabs.org>
> > Enviados: Martes, 21 de Agosto 2012 15:59:54
> > Asunto: Re: [Pacemaker] Help on setting order of resources
> 
> > Adrian,
> 
> > A few more comments below to maybe make it clearer...
> 
> > > ----- Original Message -----
> 
> > > > De: "Adrian Gibanel" <adrian.gibanel at btactic.com>
> > >
> > > > Para: "The Pacemaker cluster resource manager"
> > > > <pacemaker at oss.clusterlabs.org>
> > >
> > > > Enviados: Domingo, 19 de Agosto 2012 10:27:34
> > >
> > > > Asunto: Re: [Pacemaker] Help on setting order of resources
> > >
> 
> > > > Now that I'm reading about that it makes sense. So it removes
> > > > my
> > > > idea
> > > > of: Colocation = Put in the same machine/server.
> > >
> 
> > Not quite sure I understand what you're saying here...
> 
> > Colocation does = Put in the same machine/server
> > Just didn't have the "order" inside of colocation statement correct
> 
> > > > I copy and paste from Configuration Explained pdf:
> > >
> 
> > > > ---
> > >
> > > > Well, I'm going to try to reverse the "order" in the colocation
> > > > statement.
> > >
> 
> > > > Now it makes sense why insisted me on setting up resources
> > > > inside
> > > > groups. It seems that makes things easier indeed.
> > >
> 
> > Groups - shortcut to order and colocation statements (so yes I
> > think
> > they are easier - as long as you are already confortable with the
> > order/colocation concepts)
> 
> > Resources inside groups are ordered as written and collocated in
> > reverse - that's my trick to remember the "normal" way a
> > collocation
> > statement is written. "Usually" the opposite of the order statement
> > i.e.
> 
> > order sample_order 1 2 3
> > colocation sample_colo inf: 3 2 1
> 
> > And I always review them by reading them with their "action"
> > between
> > the resources i.e.
> 
> > order of sample_order is 1 then 2 then 3
> > colocation of sample_colo is always 3 with 2 with 1
> 
> > Hope that makes it a bit clearer!
> 
> > Jake
> 
> --
> 
> --
> Adrián Gibanel
> I.T. Manager
> 
> +34 675 683 301
> www.btactic.com
> 
> 
> 
> Ens podeu seguir a/Nos podeis seguir en:
> 
> i
> 
> 
> Abans d´imprimir aquest missatge, pensa en el medi ambient. El medi
> ambient és cosa de tothom. / Antes de imprimir el mensaje piensa en
> el medio ambiente. El medio ambiente es cosa de todos.
> 
> AVIS:
> El contingut d'aquest missatge i els seus annexos és confidencial. Si
> no en sou el destinatari, us fem saber que està prohibit
> utilitzar-lo, divulgar-lo i/o copiar-lo sense tenir l'autorització
> corresponent. Si heu rebut aquest missatge per error, us agrairem
> que ho feu saber immediatament al remitent i que procediu a destruir
> el missatge .
> 
> AVISO:
> El contenido de este mensaje y de sus anexos es confidencial. Si no
> es el destinatario, les hacemos saber que está prohibido utilizarlo,
> divulgarlo y/o copiarlo sin tener la autorización correspondiente.
> Si han recibido este mensaje por error, les agradeceríamos que lo
> hagan saber inmediatamente al remitente y que procedan a destruir el
> mensaje .
> 
> _______________________________________________
> 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