leader election
also: leader election algorithm, consensus election, master election
A distributed computing process where multiple nodes or processes automatically select one among themselves to coordinate shared tasks or resources. The elected leader then handles decisions or state management for the group until it fails or relinquishes the role.
Leader election is a consensus mechanism used in distributed systems—including Kubernetes clusters, database replicas, and message queues—where nodes need to agree on a single coordinator. When a cluster starts or the current leader becomes unavailable, the remaining nodes run an election algorithm to pick a replacement.
Common algorithms include Raft (used in etcd and Consul) and Paxos, which ensure only one leader is chosen even if network partitions or node failures occur. The elected leader typically handles write operations, scheduling, or cluster state updates, reducing conflicts and improving consistency.
For example, in a Kubernetes cluster, one node becomes the leader and manages resource allocation and API server coordination. If that node crashes, the remaining nodes automatically elect a new leader within seconds.