I really want to know how i find first leader??

51 views
Skip to first unread message

Choi SW

unread,
Aug 5, 2016, 4:39:30 AM8/5/16
to raft-dev
Hi ~

nowadays i researching Raft

i want to know how i find the first Leader?

if Shard turn on, and then member or clusters on in series, 

what follower turn to Leader ?

and in MD-SAL_akka Raft,

jordan.h...@gmail.com

unread,
Aug 6, 2016, 5:09:41 PM8/6/16
to raft...@googlegroups.com
If you're asking whether there's some deterministic way a leader will be elected, there isn't. Even if you start nodes in sequence, once a majority of the cluster has been started there's no guarantee regarding which will become the leader or even that any leader will be elected (if there's a partition). Randomized election timeouts ensure that order is unpredictable, and even if you were to use fixed timeouts the order of elections would still be unpredictable.

If you need some way for clients to find the leader that's typically just done in the protocol. A client can connect to a random server and attempt to submit a command. If the server to which the client is connected knows of anther leader, it sends the correct leader back to the client and the client reconnects to the leader. Of course, there are a bunch of variants on this pattern, and there's not really any correct or incorrect way to implement it.
--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages