[Pacemaker] globally-unique clone question
Andrew Beekhof
andrew at beekhof.net
Fri May 22 10:16:50 UTC 2009
The idea behind unique vs. non-unique is best illustrated by example.
Take a CLUSTERIP resource...
Based on some criteria (usually the source address), it allocates all
requests into a bucket from 0..(N-1), where N ::= clone-max
So when we ask "is the resource running here", we're really asking: is
a specific bucket being served by this machine?
The easiest way to do this we set up a mapping between clone instance
(the bit after the colon) and the per-instance data.
In this case, the per-instance information is a bucket number so the
mapping is trivial.
But what it means is that myClone:0 running on nodeA is not the same
as myClone:1 on nodeB or indeed myClone:1 running on nodeA.
Each instance of the clone is considered unique and in order to
function correctly, requires globally-unique=true.
As an aside, only clones with globally-unique=true can set clone-node-max > 1.
(Perhaps the option's name could be clearer, I'm open to suggestions)
A counter example would be an LSB resource such as named.
There is only ever one copy of the service per machine and they all
serve up the same dataset, the instances are _not_ unique
(globally-unique=false) and the instance number has no meaning for the
resource.
This simplifies the resource agent since it can just look for the
named process to be running (named:0 running on nodeA is the same as
named:1 running on nodeA).
The cluster also handles anonymous clones differently, it only checks
for one copy per machine and doesn't initiate recovery if named:0 is
running on both nodeA and nodeB (instead it internally renames to use
a free "slot").
Other possible uses for clones globally-unique=true...
* Add the instance number to a base address to create an IP address range
* Map the instance number to a module (eg. in Tomcat)
* Map the instance number to a config file (eg. Apache)
* Map the instance number to a path (eg. NFS export)
Hope that helps.
More information about the Pacemaker
mailing list