A Linux system administrator is managing a Docker Swarm cluster and needs to perform maintenance on a specific worker node. To prevent service disruption, the administrator must ensure all tasks currently running on the node are safely rescheduled to other active nodes before taking the node offline. Which of the following commands accomplishes this task gracefully?
The correct command is docker node update --availability drain <NODE_NAME>. This command sets the node's availability to 'drain', which prevents the scheduler from assigning new tasks to the node and also shuts down any existing tasks, rescheduling them on other available nodes in the swarm.
docker node demote <NODE_NAME> is incorrect because it is used to change a manager node's role to a worker, which is not relevant for gracefully taking a worker node offline for maintenance.
docker swarm leave --force is incorrect as it forces the node to leave the swarm. While this does stop tasks, it is not a graceful maintenance procedure and is a more drastic action, especially with the --force flag which can be disruptive.
docker node rm <NODE_NAME> is incorrect because this command removes a node from the swarm list, typically used after a node has already left the swarm or is confirmed to be down. It does not manage the rescheduling of running tasks on an active node.
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 does the 'docker node update --availability drain' command do?
Open an interactive chat with Bash
How does setting a node's availability to 'drain' differ from removing the node entirely?
Open an interactive chat with Bash
What happens if you use 'docker swarm leave --force' on a worker node?
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