github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/docs/reference/commandline/node_rm.md (about)

     1  ---
     2  title: "node rm"
     3  description: "The node rm command description and usage"
     4  keywords: "node, remove"
     5  ---
     6  
     7  <!-- This file is maintained within the docker/cli GitHub
     8       repository at https://github.com/docker/cli/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # node rm
    17  
    18  ```markdown
    19  Usage:	docker node rm [OPTIONS] NODE [NODE...]
    20  
    21  Remove one or more nodes from the swarm
    22  
    23  Aliases:
    24    rm, remove
    25  
    26  Options:
    27    -f, --force   Force remove a node from the swarm
    28        --help    Print usage
    29  ```
    30  
    31  ## Description
    32  
    33  When run from a manager node, removes the specified nodes from a swarm.
    34  
    35  
    36  ## Examples
    37  
    38  ### Remove a stopped node from the swarm
    39  
    40  ```bash
    41  $ docker node rm swarm-node-02
    42  
    43  Node swarm-node-02 removed from swarm
    44  ```
    45  ### Attempt to remove a running node from a swarm
    46  
    47  Removes the specified nodes from the swarm, but only if the nodes are in the
    48  down state. If you attempt to remove an active node you will receive an error:
    49  
    50  ```non
    51  $ docker node rm swarm-node-03
    52  
    53  Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
    54  down and can't be removed
    55  ```
    56  
    57  ### Forcibly remove an inaccessible node from a swarm
    58  
    59  If you lose access to a worker node or need to shut it down because it has been
    60  compromised or is not behaving as expected, you can use the `--force` option.
    61  This may cause transient errors or interruptions, depending on the type of task
    62  being run on the node.
    63  
    64  ```bash
    65  $ docker node rm --force swarm-node-03
    66  
    67  Node swarm-node-03 removed from swarm
    68  ```
    69  
    70  A manager node must be demoted to a worker node (using `docker node demote`)
    71  before you can remove it from the swarm.
    72  
    73  ## Related commands
    74  
    75  * [node demote](node_demote.md)
    76  * [node inspect](node_inspect.md)
    77  * [node ls](node_ls.md)
    78  * [node promote](node_promote.md)
    79  * [node ps](node_ps.md)
    80  * [node update](node_update.md)