diff options
| author | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
| commit | 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch) | |
| tree | 158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html | |
| parent | 9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff) | |
| download | dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip | |
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html b/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html deleted file mode 100644 index 5270a03c..00000000 --- a/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fscale-service%2Findex.html +++ /dev/null @@ -1,25 +0,0 @@ -<h1>Scale the service in the swarm</h1> -<p>Once you have <a href="../deploy-service/index">deployed a service</a> to a swarm, you are ready to use the Docker CLI to scale the number of containers in the service. Containers running in a service are called “tasks.”</p> <ol> <li> <p>If you haven’t already, open a terminal and ssh into the machine where you run your manager node. For example, the tutorial uses a machine named <code class="language-plaintext highlighter-rouge">manager1</code>.</p> </li> <li> <p>Run the following command to change the desired state of the service running in the swarm:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker service scale <SERVICE-ID>=<NUMBER-OF-TASKS> -</pre></div> <p>For example:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker service scale helloworld=5 - -helloworld scaled to 5 -</pre></div> </li> <li> <p>Run <code class="language-plaintext highlighter-rouge">docker service ps <SERVICE-ID></code> to see the updated task list:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker service ps helloworld - -NAME IMAGE NODE DESIRED STATE CURRENT STATE -helloworld.1.8p1vev3fq5zm0mi8g0as41w35 alpine worker2 Running Running 7 minutes -helloworld.2.c7a7tcdq5s0uk3qr88mf8xco6 alpine worker1 Running Running 24 seconds -helloworld.3.6crl09vdcalvtfehfh69ogfb1 alpine worker1 Running Running 24 seconds -helloworld.4.auky6trawmdlcne8ad8phb0f1 alpine manager1 Running Running 24 seconds -helloworld.5.ba19kca06l18zujfwxyc5lkyn alpine worker2 Running Running 24 seconds -</pre></div> <p>You can see that swarm has created 4 new tasks to scale to a total of 5 running instances of Alpine Linux. The tasks are distributed between the three nodes of the swarm. One is running on <code class="language-plaintext highlighter-rouge">manager1</code>.</p> </li> <li> <p>Run <code class="language-plaintext highlighter-rouge">docker ps</code> to see the containers running on the node where you’re connected. The following example shows the tasks running on <code class="language-plaintext highlighter-rouge">manager1</code>:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker ps - -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -528d68040f95 alpine:latest "ping docker.com" About a minute ago Up About a minute helloworld.4.auky6trawmdlcne8ad8phb0f1 -</pre></div> <p>If you want to see the containers running on other nodes, ssh into those nodes and run the <code class="language-plaintext highlighter-rouge">docker ps</code> command.</p> </li> </ol> <h2 id="whats-next">What’s next?</h2> <p>At this point in the tutorial, you’re finished with the <code class="language-plaintext highlighter-rouge">helloworld</code> service. The next step shows how to <a href="../delete-service/index">delete the service</a>.</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%20mode">swarm mode</a>, <a href="https://docs.docker.com/search/?q=scale">scale</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/scale-service/" class="_attribution-link">https://docs.docker.com/engine/swarm/swarm-tutorial/scale-service/</a> - </p> -</div> |
