[Pacemaker] globally-unique clone question

Andrew Beekhof andrew at beekhof.net
Fri May 22 10:24:36 UTC 2009


On Thu, May 21, 2009 at 5:04 PM, Joe Armstrong <jarmstrong at postpath.com> wrote:
> Hi All,
>
> I am a little confused about globally-unique clones, since there can be no instance attributes for a clone how do you tell each clone that it is unique ?

The globally-unique=true option.
Then, inside your resource agent, you need to set up a mapping between
the instance number and the per-instance data.

> My use case is that we need to run N instances of a mail server, each mail server is unique in that it serves a specific domain, two mail server can never run on the same host.  In order to provide HA we need to tell the mail server instance what domain to serve (or what filesystem to mount in order to get the right data/config).
>
> I was thinking that using globally-unique clones would be the way to manage this (it makes the mutual exclusion rule easy: clone-node-max=1) but I don't see how to make each instance unique.
>
> ... then again I could be mis-using the concept...

Its a valid use-case.

As someone said below, you could set
   name="mydata" value="node1:www.example.com node2:www.example2.com
node3:www.example3.com"
convert that into an array and use the clone number to index into the array.

Or set:
   name=domain0 value=www.example0.com
   name=domain1 value=www.example1.com
   name=domainN value=www.exampleN.com
and simply look up the value of domain$CRM_meta_clone in the environment

Just make sure you include error checking so that the cluster doesn't
blow up if clone-max > number of domains.




More information about the Pacemaker mailing list