← All notes

Docker Swarm Raft: how managers agree on cluster state

Answer: Swarm managers use Raft so they share one consistent cluster state and can recover if a leader fails.

Why Swarm uses consensus

Manager nodes run Raft to hold the global cluster state.

The goal is that every manager stores the same consistent state for scheduling work.

If the leader manager dies unexpectedly, any other manager can pick up scheduling and re-balance tasks to match the desired state.

Consensus requires a majority of nodes to agree on values when failures occur.

Quorum and what happens on failure

Raft can tolerate up to (N-1)/2 failures and needs a quorum of (N/2)+1 members.

If 3 nodes are unavailable in a cluster of 5 managers running Raft, the system cannot process any more requests to schedule additional tasks.

Existing tasks keep running, but the scheduler cannot rebalance if the manager set is unhealthy.

Swarm mode also relies on mutual exclusion through leader election.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Raft consensus in swarm mode; Docker, Inc., Raft consensus in swarm mode (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Raft consensus in swarm mode; Docker, Inc., Raft consensus in swarm mode (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:zgatqpb7

iinventedlight. 2026. "Docker Swarm Raft: how managers agree on cluster state." iinventedlight Library, iil:note:zgatqpb7, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-swarm-raft/. License: CC-BY-4.0.

@misc{iil_note_zgatqpb7,
  author = {{iinventedlight}},
  title = {{Docker Swarm Raft: how managers agree on cluster state}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/docker-swarm-raft/},
  note = {Permanent ID iil:note:zgatqpb7. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-swarm-raft.md.