summaryrefslogtreecommitdiff
path: root/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html')
-rw-r--r--devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html
new file mode 100644
index 00000000..f7f31810
--- /dev/null
+++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Fswarm_join%2Findex.html
@@ -0,0 +1,22 @@
+<h1>docker swarm join</h1> <p><br></p> <p>Join a swarm as a node and/or manager</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 swarm join [OPTIONS] HOST:PORT
+</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">Join a node to a swarm. The node joins as a manager node or worker node based upon the token you pass with the <code class="language-plaintext highlighter-rouge">--token</code> flag. If you pass a manager token, the node joins as a manager. If you pass a worker token, the node joins as a worker.</p> <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">--advertise-addr</code></td> <td></td> <td>Advertised address (format: &lt;ip|interface&gt;[:port])</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--availability</code></td> <td><code class="language-plaintext highlighter-rouge">active</code></td> <td>Availability of the node ("active"|"pause"|"drain")</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--data-path-addr</code></td> <td></td> <td>Address or interface to use for data path traffic (format: &lt;ip|interface&gt;)</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--listen-addr</code></td> <td><code class="language-plaintext highlighter-rouge">0.0.0.0:2377</code></td> <td>Listen address (format: &lt;ip|interface&gt;[:port])</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--token</code></td> <td></td> <td>Token for entry into the swarm</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <h3 id="join-a-node-to-swarm-as-a-manager">Join a node to swarm as a manager</h3> <p>The example below demonstrates joining a manager node using a manager token.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2 192.168.99.121:2377
+This node joined a swarm as a manager.
+
+$ docker node ls
+ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
+dkp8vy1dq1kxleu9g4u78tlag * manager2 Ready Active Reachable
+dvfxp4zseq4s0rih1selh0d20 manager1 Ready Active Leader
+</pre></div> <p>A cluster should only have 3-7 managers at most, because a majority of managers must be available for the cluster to function. Nodes that aren’t meant to participate in this management quorum should join as workers instead. Managers should be stable hosts that have static IP addresses.</p> <h3 id="join-a-node-to-swarm-as-a-worker">Join a node to swarm as a worker</h3> <p>The example below demonstrates joining a worker node using a worker token.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx 192.168.99.121:2377
+This node joined a swarm as a worker.
+
+$ docker node ls
+ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
+7ln70fl22uw2dvjn2ft53m3q5 worker2 Ready Active
+dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active Reachable
+dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader
+</pre></div> <h3 id="--listen-addr-value"><code class="language-plaintext highlighter-rouge">--listen-addr value</code></h3> <p>If the node is a manager, it will listen for inbound swarm manager traffic on this address. The default is to listen on 0.0.0.0:2377. It is also possible to specify a network interface to listen on that interface’s address; for example <code class="language-plaintext highlighter-rouge">--listen-addr eth0:2377</code>.</p> <p>Specifying a port is optional. If the value is a bare IP address, or interface name, the default port 2377 will be used.</p> <p>This flag is generally not necessary when joining an existing swarm.</p> <h3 id="--advertise-addr-value"><code class="language-plaintext highlighter-rouge">--advertise-addr value</code></h3> <p>This flag specifies the address that will be advertised to other members of the swarm for API access. If unspecified, Docker will check if the system has a single IP address, and use that IP address with the listening port (see <code class="language-plaintext highlighter-rouge">--listen-addr</code>). If the system has multiple IP addresses, <code class="language-plaintext highlighter-rouge">--advertise-addr</code> must be specified so that the correct address is chosen for inter-manager communication and overlay networking.</p> <p>It is also possible to specify a network interface to advertise that interface’s address; for example <code class="language-plaintext highlighter-rouge">--advertise-addr eth0:2377</code>.</p> <p>Specifying a port is optional. If the value is a bare IP address, or interface name, the default port 2377 will be used.</p> <p>This flag is generally not necessary when joining an existing swarm. If you’re joining new nodes through a load balancer, you should use this flag to ensure the node advertises its IP address and not the IP address of the load balancer.</p> <h3 id="--data-path-addr"><code class="language-plaintext highlighter-rouge">--data-path-addr</code></h3> <p>This flag specifies the address that global scope network drivers will publish towards other nodes in order to reach the containers running on this node. Using this parameter it is then possible to separate the container’s data traffic from the management traffic of the cluster. If unspecified, Docker will use the same IP address or interface that is used for the advertise address.</p> <h3 id="--token-string"><code class="language-plaintext highlighter-rouge">--token string</code></h3> <p>Secret value required for nodes to join the swarm</p> <h3 id="--availability"><code class="language-plaintext highlighter-rouge">--availability</code></h3> <p>This flag specifies the availability of the node at the time the node joins a master. Possible availability values are <code class="language-plaintext highlighter-rouge">active</code>, <code class="language-plaintext highlighter-rouge">pause</code>, or <code class="language-plaintext highlighter-rouge">drain</code>.</p> <p>This flag is useful in certain situations. For example, a cluster may want to have dedicated manager nodes that are not served as worker nodes. This could be achieved by passing <code class="language-plaintext highlighter-rouge">--availability=drain</code> to <code class="language-plaintext highlighter-rouge">docker swarm join</code>.</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="../swarm/index">docker swarm</a></td> <td style="text-align: left">Manage Swarm</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="../swarm_ca/index">docker swarm ca</a></td> <td>Display and rotate the root CA</td> </tr> <tr> <td><a href="../swarm_init/index">docker swarm init</a></td> <td>Initialize a swarm</td> </tr> <tr> <td><a href="index">docker swarm join</a></td> <td>Join a swarm as a node and/or manager</td> </tr> <tr> <td><a href="../swarm_join-token/index">docker swarm join-token</a></td> <td>Manage join tokens</td> </tr> <tr> <td><a href="../swarm_leave/index">docker swarm leave</a></td> <td>Leave the swarm</td> </tr> <tr> <td><a href="../swarm_unlock/index">docker swarm unlock</a></td> <td>Unlock swarm</td> </tr> <tr> <td><a href="../swarm_unlock-key/index">docker swarm unlock-key</a></td> <td>Manage the unlock key</td> </tr> <tr> <td><a href="../swarm_update/index">docker swarm update</a></td> <td>Update the swarm</td> </tr> </tbody> </table> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 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/swarm_join/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/swarm_join/</a>
+ </p>
+</div>