curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corey Nolet <>
Subject Re: Force leader
Date Wed, 28 May 2014 19:59:11 GMT

I'm still wrestling with the recommended way to implement this. Basically
what I want is a normal leader selection algorithm but with the ability to
force a leader sometimes.

Ultimately, it would be amazing if I could do this:


I've tried having a node in Zookeeper that the leader is watching so that
it can revoke leadership upon the node being updated. Upon each consecutive
node being elected as a leader, they check to see if they are the forced
lead and if not, they revoke right away. This definitely seems like a hack.
I'd like to try to stay in the Curator framework to implement this if


On Wed, May 21, 2014 at 1:34 PM, Corey Nolet <> wrote:

> It it helps, here's a rough design of the project:
> On Wed, May 21, 2014 at 1:33 PM, Corey Nolet <> wrote:
>> Jordan,
>> Thanks for your quick response! So what I am building is a faul-tolerant
>> framework for linux systems to watch over some number of processes and,
>> when a process goes down and can't be brought back up (disk space, memory,
>> etc...), I want the process watcher to revoke its leadership so that a
>> different machine can start up the process, do any configuration necessary
>> to route clients over to that machine, and assume responsibility as the
>> lead for that process.
>> Often times what happens is a couple physical machines go down and ALL
>> the managed processes end up on a single machine.
>> I'm giving the users control over groups of processes. A group would be
>> "amqp broker" or "web server". Once a sys admin comes into work and
>> realizes what happened, they are going to want to force the amqp broker
>> back to a specific node and force the web server onto some other node. The
>> way I've designed it, this means those nodes need to be forced to be the
>> leaders for those groups.
>> Thanks again!
>> On Wed, May 21, 2014 at 1:20 PM, Jordan Zimmerman <
>>> wrote:
>>> I’d need more details to answer concretely. But, this sounds like a
>>> simple lock. Have the process that wants to be leader acquire an
>>> InterProcessMutex.
>>> -JZ
>>> From: Corey Nolet
>>> Reply:
>>> Date: May 21, 2014 at 12:12:35 PM
>>> To: user
>>> Subject:  Force leader
>>>  I have a cluster which is electing a single leader to perform
>>> operations on a node until the node is deemed to be unhealthy. At this
>>> time, the leader revokes itself and another leader is elected to perform
>>> the operations.
>>> There are times, however, when I need the ability to force a specific
>>> leader. How would I implement something like this? I really don't want to
>>> have to cascade through all the other nodes and tell them to revoke their
>>> leadership because they will each try to run some initialization upon
>>> becoming the leader and that would waste resources.
>>> Any ideas?
>>> Thanks!

View raw message