Rafting consensus
We've seen how the Consul servers elect their leader utilizing the consensus protocol, but what exactly does that mean, and is that all that they do? Well, of course they do more; otherwise, this would be a very short section. The consensus protocol that Consul utilizes is based on the Raft algorithm (https://raft.github.io/raft.pdf), which is based on Paxos (https://en.wikipedia.org/wiki/Paxos_%28computer_science%29). If you get the feeling that we are quickly heading down a rabbit hole, don't worry—we aren't going to keep digging until we hit water.
A closer look at leader election
As you will soon see, a Consul server is configured with a number of other servers, which it will Raft up with. This is called the bootstrap_expect
value within the configuration. That number of servers is important to remember, as it will come up again. Of course, if a Consul server is going to expect a number of servers to Raft up with, it needs to know about...