liveBook · Manning

Master election

As explained in Elasticsearch in Action, Second Edition

A master election is the distributed coordination process of selecting a new Elasticsearch master node when the current master is unavailable.

Master election selects a new Elasticsearch cluster master when a cluster first forms or its current master becomes unavailable. Master-eligible nodes monitor the master, vote, and let the winner resume cluster management. section 14.6.2 section 14.6.1

The process follows a practical failure-detection sequence:

A missed heartbeat

Suppose master-eligible node A stops receiving the master’s heartbeat. With cluster.election.initial_timeout set to its 500 ms default, A calls an election after that wait. A negative ping can trigger the election immediately instead. The elected master can then manage redistribution, replication, index management, and shard rearrangement. section 14.6.2 section 15.3.1

Election timing can be influenced by cluster.election.duration and cluster.election.initial_timeout. A master may also be replaced when cluster updates fail to commit within cluster.publish.timeout, described as 30 seconds by default. section 14.6.2 section 14.6.3

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains monitoring, timeout-based and immediate triggers, voting, and resulting cluster management without detailing election internals.
Examples
Uses a 500 ms missed-heartbeat scenario and negative ping to illustrate delayed and immediate elections.
What it assumes
Assumes an Elasticsearch cluster and teaches master eligibility, voting, liveness checks, and master duties.
What you can do after
Configure election timing and diagnose how master loss or failed cluster updates trigger failover.
How it connects
Connects master-eligible nodes, heartbeats, cluster state, quorum, and cluster management.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.