-
-
Notifications
You must be signed in to change notification settings - Fork 6
How work under the hood
Alessandro Pio Ardizio edited this page Dec 30, 2019
·
2 revisions
Ring-election library is based on a p2p communication between nodes.
One node is the leader and will not have any assigned partitions, it will just handle the cluster.
The other nodes are the followers and will have assigned partitions and send to the leader a periodic heartbeat.
If the leader is died , another node will become the leader based on its priority.
- Leader , the node that will handle the cluster and will not have assigned partitions
- Follower , a node that will have assigned partitions and will work on them
- Heartbeat , a message sent periodically from the followers to leader node to keep track that is alive.
- Heartcheck , a process that run on the leader and go to check the last heartbeat received by each follower
- Priority , is assigned to each follower based on the time that they joined the cluster , when a node die the priority is decreased by one . If the leader die the node with lower priority will become the leader
- Node id , each follower node has an assigned id that is unique into the cluster