How does Consul's gossip and consensus work?
⚡
Quick Answer
Consul uses a gossip protocol (Serf) for membership/failure detection and Raft for consensus among server nodes.
Detailed Answer
Agents run on every node; gossip spreads membership and health quickly and scalably. A small set of server agents form a Raft quorum that stores the authoritative catalog and KV, electing a leader and requiring a majority to commit writes — so you run an odd number (3 or 5) of servers.
💡
Interview Tip
Run 3 or 5 servers for a Raft quorum.
consulraftgossip