A system administrator is managing a web application deployed as a replicated service on a Docker Swarm cluster. The service is configured to maintain three replicas for high availability. If a worker node hosting one of these replicas unexpectedly fails and goes offline, what is the primary responsibility of the Swarm manager in response?
It will wait for the failed node to reconnect to the swarm before taking any corrective action.
It will move the existing task from the failed node to a healthy node.
It will schedule a new task on a healthy node to replace the one on the failed node, thereby restoring the replica count to three.
It will permanently decrease the service's desired replica count to two to match the new number of healthy replicas.
The correct response is that the Swarm manager will schedule a new task to replace the lost one. Docker Swarm operates on a declarative model where it constantly attempts to reconcile the cluster's actual state with the service's desired state. In this scenario, the desired state is three replicas. When a node failure causes the actual state to drop to two replicas, the manager's reconciliation loop detects this discrepancy and schedules a new task on a healthy node to create a new container, thus restoring the service to its desired state of three replicas.
The manager does not change the desired state to match the actual state. Tasks are atomic scheduling units and cannot be 'moved' from a failed node; a new task must be created to replace the lost one. Waiting for the node to return would negate the high-availability benefits of using a container orchestrator.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Docker Swarm?
Open an interactive chat with Bash
What does 'desired state' mean in Docker Swarm?
Open an interactive chat with Bash
How does Docker Swarm ensure high availability?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access