Clarify usage of --force when used on a swarm manager
Fixes #26125 Signed-off-by: Misty Stanley-Jones <misty@docker.com> Upstream-commit: 7b5c3d935a7a99b282f0f859101c887894a0b00e Component: engine
This commit is contained in:
@ -23,36 +23,45 @@ Options:
|
||||
--help Print usage
|
||||
```
|
||||
|
||||
Removes specified nodes from a swarm.
|
||||
When run from a manager node, removes the specified nodes from a swarm.
|
||||
|
||||
|
||||
Example output:
|
||||
|
||||
$ docker node rm swarm-node-02
|
||||
Node swarm-node-02 removed from swarm
|
||||
```nohighlight
|
||||
$ docker node rm swarm-node-02
|
||||
|
||||
Removes nodes from the swarm that are in the down state. Attempting to remove
|
||||
an active node will result in an error:
|
||||
|
||||
```bash
|
||||
$ docker node rm swarm-node-03
|
||||
Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not down and can't be removed
|
||||
Node swarm-node-02 removed from swarm
|
||||
```
|
||||
|
||||
If a worker node becomes compromised, exhibits unexpected or unwanted behavior, or if you lose access to it so
|
||||
that a clean shutdown is impossible, you can use the force option.
|
||||
Removes the specified nodes from the swarm, but only if the nodes are in the
|
||||
down state. If you attempt to remove an active node you will receive an error:
|
||||
|
||||
```bash
|
||||
```nohighlight
|
||||
$ docker node rm swarm-node-03
|
||||
|
||||
Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
|
||||
down and can't be removed
|
||||
```
|
||||
|
||||
If you lose access to a worker node or need to shut it down because it has been
|
||||
compromised or is not behaving as expected, you can use the `--force` option.
|
||||
This may cause transient errors or interruptions, depending on the type of task
|
||||
being run on the node.
|
||||
|
||||
```nohighlight
|
||||
$ docker node rm --force swarm-node-03
|
||||
|
||||
Node swarm-node-03 removed from swarm
|
||||
```
|
||||
|
||||
Note that manager nodes have to be demoted to worker nodes before they can be removed
|
||||
from the cluster.
|
||||
A manager node must be demoted to a worker node (using `docker node demote`)
|
||||
before you can remove it from the swarm.
|
||||
|
||||
## Related information
|
||||
|
||||
* [node inspect](node_inspect.md)
|
||||
* [node update](node_update.md)
|
||||
* [node demote](node_demote.md)
|
||||
* [node ps](node_ps.md)
|
||||
* [node ls](node_ls.md)
|
||||
|
||||
Reference in New Issue
Block a user