How does a Consul agent know it is the leader of a cluster?

前端 未结 5 2054
既然无缘
既然无缘 2021-02-14 09:40

In Consul you can have many agents as servers or clients. Amongst all servers one is chosen as the leader. From the agent\'s point of view, how does it know it is the leader?

5条回答
  •  孤独总比滥情好
    2021-02-14 10:15

    Consul uses RAFT Consensus Algorithm. This link below helps you understand how raft works visually (Which also shows how a member is elected as leader step by step).

    http://thesecretlivesofdata.com/raft/

    Reference is from official consul documentation: https://www.consul.io/docs/internals/consensus.html

提交回复
热议问题