diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html | |
new repository
Diffstat (limited to 'devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html b/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html new file mode 100644 index 00000000..1d53eff2 --- /dev/null +++ b/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fadd-nodes%2Findex.html @@ -0,0 +1,32 @@ +<h1>Add nodes to the swarm</h1> + +<p>Once you’ve <a href="../create-swarm/index">created a swarm</a> with a manager node, you’re ready to add worker nodes.</p> <ol> <li> <p>Open a terminal and ssh into the machine where you want to run a worker node. This tutorial uses the name <code class="language-plaintext highlighter-rouge">worker1</code>.</p> </li> <li> <p>Run the command produced by the <code class="language-plaintext highlighter-rouge">docker swarm init</code> output from the <a href="../create-swarm/index">Create a swarm</a> tutorial step to create a worker node joined to the existing swarm:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join \ + --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ + 192.168.99.100:2377 + +This node joined a swarm as a worker. +</pre></div> <p>If you don’t have the command available, you can run the following command on a manager node to retrieve the join command for a worker:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join-token worker + +To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ + 192.168.99.100:2377 +</pre></div> </li> <li> <p>Open a terminal and ssh into the machine where you want to run a second worker node. This tutorial uses the name <code class="language-plaintext highlighter-rouge">worker2</code>.</p> </li> <li> <p>Run the command produced by the <code class="language-plaintext highlighter-rouge">docker swarm init</code> output from the <a href="../create-swarm/index">Create a swarm</a> tutorial step to create a second worker node joined to the existing swarm:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker swarm join \ + --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ + 192.168.99.100:2377 + +This node joined a swarm as a worker. +</pre></div> </li> <li> <p>Open a terminal and ssh into the machine where the manager node runs and run the <code class="language-plaintext highlighter-rouge">docker node ls</code> command to see the worker nodes:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node ls +ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS +03g1y59jwfg7cf99w4lt0f662 worker2 Ready Active +9j68exjopxe7wfl6yuxml7a7j worker1 Ready Active +dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader +</pre></div> <p>The <code class="language-plaintext highlighter-rouge">MANAGER</code> column identifies the manager nodes in the swarm. The empty status in this column for <code class="language-plaintext highlighter-rouge">worker1</code> and <code class="language-plaintext highlighter-rouge">worker2</code> identifies them as worker nodes.</p> <p>Swarm management commands like <code class="language-plaintext highlighter-rouge">docker node ls</code> only work on manager nodes.</p> </li> </ol> <h2 id="whats-next">What’s next?</h2> <p>Now your swarm consists of a manager and two worker nodes. In the next step of the tutorial, you <a href="../deploy-service/index">deploy a service</a> to the swarm.</p> +<p><a href="https://docs.docker.com/search/?q=tutorial">tutorial</a>, <a href="https://docs.docker.com/search/?q=cluster%20management">cluster management</a>, <a href="https://docs.docker.com/search/?q=swarm">swarm</a></p> +<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/swarm/swarm-tutorial/add-nodes/" class="_attribution-link">https://docs.docker.com/engine/swarm/swarm-tutorial/add-nodes/</a> + </p> +</div> |
