← all tinkertoys

How a Raft leader election works

Every node starts as a follower with a random timer. The first timer to expire asks for votes; whoever collects a majority becomes leader and keeps everyone calm with heartbeats.

Tweak it

Break it

Normal run: a leader is elected and heartbeats keep the cluster stable.

What to notice