blob: 41b5deb87fbc4f7a6341c2aafa13939420fd0e20 (
plain)
1
2
3
4
5
6
7
8
9
10
|
<h1>docker node update</h1> <p><br></p> <p>Update a node</p> <p><span class="badge badge-info" data-toggle="tooltip" data-placement="right" title="This command works with the Swarm orchestrator.">Swarm</span> This command works with the Swarm orchestrator.</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker node update [OPTIONS] NODE
</pre></div> <p>Refer to the <a href="#options">options section</a> for an overview of available <a href="#options"><code class="language-plaintext highlighter-rouge">OPTIONS</code></a> for this command.</p> <h2 id="description">Description</h2> <p name="extended-description">Update metadata about a node, such as its availability, labels, or roles.</p> <blockquote> <p><strong>Note</strong></p> <p>This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the <a href="../../../swarm/index">Swarm mode section</a> in the documentation.</p> </blockquote> <p>For example uses of this command, refer to the <a href="#examples">examples section</a> below.</p> <h2 id="options">Options</h2> <table> <thead> <tr> <td>Name, shorthand</td> <td>Default</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge">--availability</code></td> <td></td> <td>Availability of the node ("active"|"pause"|"drain")</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--label-add</code></td> <td></td> <td>Add or update a node label (key=value)</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--label-rm</code></td> <td></td> <td>Remove a node label if exists</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--role</code></td> <td></td> <td>Role of the node ("worker"|"manager")</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <h3 id="add-label-metadata-to-a-node">Add label metadata to a node</h3> <p>Add metadata to a swarm node using node labels. You can specify a node label as a key with an empty value:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node update --label-add foo worker1
</pre></div> <p>To add multiple labels to a node, pass the <code class="language-plaintext highlighter-rouge">--label-add</code> flag for each label:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node update --label-add foo --label-add bar worker1
</pre></div> <p>When you <a href="../service_create/index">create a service</a>, you can use node labels as a constraint. A constraint limits the nodes where the scheduler deploys tasks for a service.</p> <p>For example, to add a <code class="language-plaintext highlighter-rouge">type</code> label to identify nodes where the scheduler should deploy message queue service tasks:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node update --label-add type=queue worker1
</pre></div> <p>The labels you set for nodes using <code class="language-plaintext highlighter-rouge">docker node update</code> apply only to the node entity within the swarm. Do not confuse them with the docker daemon labels for <a href="../dockerd/index">dockerd</a>.</p> <p>For more information about labels, refer to <a href="https://docs.docker.com/config">apply custom metadata</a>.</p> <h2 id="parent-command">Parent command</h2> <table> <thead> <tr> <th style="text-align: left">Command</th> <th style="text-align: left">Description</th> </tr> </thead> <tbody> <tr> <td style="text-align: left"><a href="../node/index">docker node</a></td> <td style="text-align: left">Manage Swarm nodes</td> </tr> </tbody> </table> <h2 id="related-commands">Related commands</h2> <table> <thead> <tr> <td>Command</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td><a href="../node_demote/index">docker node demote</a></td> <td>Demote one or more nodes from manager in the swarm</td> </tr> <tr> <td><a href="../node_inspect/index">docker node inspect</a></td> <td>Display detailed information on one or more nodes</td> </tr> <tr> <td><a href="../node_ls/index">docker node ls</a></td> <td>List nodes in the swarm</td> </tr> <tr> <td><a href="../node_promote/index">docker node promote</a></td> <td>Promote one or more nodes to manager in the swarm</td> </tr> <tr> <td><a href="../node_ps/index">docker node ps</a></td> <td>List tasks running on one or more nodes, defaults to current node</td> </tr> <tr> <td><a href="../node_rm/index">docker node rm</a></td> <td>Remove one or more nodes from the swarm</td> </tr> <tr> <td><a href="index">docker node update</a></td> <td>Update a node</td> </tr> </tbody> </table> <div class="_attribution">
<p class="_attribution-p">
© 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br>
<a href="https://docs.docker.com/engine/reference/commandline/node_update/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/node_update/</a>
</p>
</div>
|