In this video, we'll explore Docker Swarm fault tolerance in practice: what happens if a worker node, manager node, or leader in a Swarm cluster fails.
I'll show you how Swarm recreates tasks when a worker fails, why containers aren't automatically restored to a recovered node, and how to perform redistribution using docker service update --force. We'll also discuss why having two managers in a cluster is a bad idea, how quorum works in Raft, why you need at least three manager nodes, and what happens when a leader is lost. We'll use the docker node demote, docker node promote, docker node ls, docker service ps, and docker service ls commands. This is based on a downloaded script.
00:00 — What happens if a node crashes in Docker Swarm
01:06 — Checking the cluster and changing the VM9 role to worker
02:20 — Disabling a worker node and Swarm's reaction
05:25 — Resuming a worker: why a task isn't being moved back
07:35 — Manual rebalancing via Docker service update
10:14 — What happens if a manager node crashes
11:49 — Why two managers are a bad idea
12:55 — Promoting a worker to manager and a three-manager setup
14:05 — Leader crash and election of a new leader
15:03 — Summary: worker, manager, and leader nodes