187k views
5 votes
What do you use to gracefully remove a node from a swarm cluster?

A) docker node remove
B) docker swarm rm-node
C) docker rm-node
D) docker leave-swarm

1 Answer

2 votes

Final answer:

To remove a node from a Docker Swarm cluster, the command 'docker node rm' should be used followed by 'docker swarm leave' on the node to be removed. This ensures a graceful removal and stability of the remaining cluster.

Step-by-step explanation:

To gracefully remove a node from a Docker Swarm cluster, you would use the command docker node rm, followed by the ID or name of the node you want to remove. Before removing a node, make sure the node is drained of any tasks by setting its availability to 'drain', which will ensure that all running tasks are safely shut down and potentially rescheduled on other nodes.

To completely remove the node from the swarm, the node left the cluster must also leave the swarm using docker swarm leave. This process ensures no disruption to the swarm's operational integrity and allows the swarm to rebalance tasks accordingly.

User Uylmz
by
7.9k points