Answer the question
In order to leave comments, you need to log in
How do leader election algorithms work in distributed systems?
Hello, for the sake of interest, I decided to study the topic of distributed, highly loaded systems, read a couple of smart books that talked about replication and algorithms for choosing a new leader (Leader Election) in case of failure of the current one. In particular, I learned about the Bully algorithm , Modified Bully and Ring algorithms.
A couple of questions immediately appeared:
- Absolutely in all these algorithms such a concept as priority is mentioned. Whichever node has a higher priority is appointed the new leader. Is this priority a random number? Or it usually depends on some node parameters, such as the amount of available memory, disk usage, and so on.
- If the priority is a random number, why then do you need to poll each node and create such a long chain of Election requests? You can simply do this - some node noticed that the current leader has fallen off, and it immediately sends to all other nodes directly, or to some bus, that it is now the leader. In fact, this will be exactly the same random node as in the case of priorities, only without a huge chain of requests.
Answer the question
In order to leave comments, you need to log in
You can simply do this - some node noticed that the current leader has fallen off, and it immediately sends to all other nodes directly, or to some bus, that it is now the leader.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question