3 ms·
Yes, in quite the same way that etcd and ZooKeeper does it. Info here: http://www.consul.io/docs/guides/leader-election.html http://www.consul.io/docs/guides/le
by wernerb 12y ago
Yes, in quite the same way that etcd and ZooKeeper does it. Info here: http://www.consul.io/docs/guides/leader-election.html http://www.consul.io/docs/guides/leader-election.html
I was looking it over and found how leader election is handled in general fascinating. Leader election can be tricky if you have a lot of machines. This example sets a watch on a single 'key'. But this would mean that all followers would be triggered upon lock-release, meaning all your machines will pound consul for a new lock request / leader election fight. To mitigate this, it seems they implemented 'lock-delay'.
In ZooKeeper what you typically do is create a linked-list of watches so that only the follower directly behind the leader gets triggered and so avoid 'disturbing the herd'.
In any case, consul seems great, and will probably use it!