Failure recovery and cluster maintenance
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Tabletop incident, no fault injection:3 managers reachable; 2 workers, web desired 3worker w1 lost; w2 has capacity for 2 tasks totalobserved: 2 web tasks running; 1 pendingstateful db task formerly used a node-local volume on w1Do not start a fresh empty database as a recovery shortcut.Read-only inspection: docker node ls; docker service ps bm28_webFirst verify context and manager quorum; record desired versus observed tasks, node state and sanitized rejection reasons. In the example scheduling cannot achieve three replicas until eligible capacity is restored. A local volume name on another node is not evidence that the old data is present. Use application-supported replication or an approved restore plan, protect the original data and prevent concurrent writers when consistency requires it. For planned maintenance, check quorum and spare capacity before draining one approved node; verify rescheduling and business acceptance before the next change. Swarm manager state backup and recovery require a version-specific documented procedure and protected keys. Do not force a new cluster, remove managers or delete storage merely to clear a pending status. Quorum loss and data loss are distinct emergencies. Quorum and application data must have separate recovery evidence. A node-local volume with the same name elsewhere is a different storage instance unless an approved storage design establishes otherwise. Do not equate restoring manager state with restoring database state.
Common mistake
A newly created empty volume is not successful recovery of a stateful workload.
Manual practice
Create a tabletop runbook for loss of one worker, then for loss of manager quorum. For each, identify read-only evidence, owner, stop condition, data protection and acceptance tests. Explain why the two recovery plans differ.
Worksheet: lab-fixtures/docker-swarm-orchestration/08-recovery/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Failure recovery and cluster maintenance — Knowledge check
Interpret cluster orchestration evidence and make a safe operational decision.
Under the fictional surviving-worker capacity assumptions, why is one of three desired web tasks pending?
What does a same-named local volume on another node prove?
What should precede planned drain?