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

前端 未结 5 2074
既然无缘
既然无缘 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 09:52

    consul operator raft list-peers also show the relationship between peers; for example

    consul operator raft list-peers

    Node    ID                                    Address               State     Voter  RaftProtocol
    agent1  2a3ae4a0-8193-7da9-f978-911d7df0d184  192.168.110.128:8300  leader    true   3
    agent2  5ca6550b-c211-d11f-0236-82a9572e2485  192.168.110.133:8300  follower  true   3
    agent3  10e1b43d-9393-6985-242b-8e31411839c5  192.168.110.137:8300  follower  true   3
    

提交回复
热议问题