Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 9ac145d73621b6393be763686b06b9cf5fb22ce2)
Signed-off-by: Tibor Vass <tibor@docker.com>
| ... | ... |
@@ -23,24 +23,24 @@ This tutorial uses the name `worker1`. |
| 23 | 23 |
[Create a swarm](create-swarm.md) tutorial step to create a worker node joined to the existing swarm: |
| 24 | 24 |
|
| 25 | 25 |
```bash |
| 26 |
- $ docker swarm join --secret 4ao565v9jsuogtq5t8s379ulb \ |
|
| 27 |
- --ca-hash sha256:07ce22bd1a7619f2adc0d63bd110479a170e7c4e69df05b67a1aa2705c88ef09 \ |
|
| 26 |
+ $ docker swarm join \ |
|
| 27 |
+ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ |
|
| 28 | 28 |
192.168.99.100:2377 |
| 29 |
+ |
|
| 30 |
+ This node joined a swarm as a worker. |
|
| 29 | 31 |
``` |
| 30 | 32 |
|
| 31 |
- If you don't have the command available, you can run the following command: |
|
| 33 |
+ If you don't have the command available, you can run the following command |
|
| 34 |
+ on a manager node to retrieve the join command for a worker: |
|
| 32 | 35 |
|
| 33 | 36 |
```bash |
| 34 |
- docker swarm join --secret <SECRET> <MANAGER-IP>:<PORT> |
|
| 35 |
- ``` |
|
| 36 |
- |
|
| 37 |
- Replace `<SECRET>` with the secret that was printed by `docker swarm init` |
|
| 38 |
- in the previous step. Replace `<MANAGER-IP>` with the address of the manager |
|
| 39 |
- node and `<PORT>` with the port where the manager listens. |
|
| 37 |
+ $ docker swarm join-token worker |
|
| 40 | 38 |
|
| 41 |
- The command generated from `docker swarm init` includes the `--ca-hash` to |
|
| 42 |
- securely identify the manager node according to its root CA. For the |
|
| 43 |
- tutorial, it is OK to join without it. |
|
| 39 |
+ To add a worker to this swarm, run the following command: |
|
| 40 |
+ docker swarm join \ |
|
| 41 |
+ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ |
|
| 42 |
+ 192.168.99.100:2377 |
|
| 43 |
+ ``` |
|
| 44 | 44 |
|
| 45 | 45 |
3. Open a terminal and ssh into the machine where you want to run a second |
| 46 | 46 |
worker node. This tutorial uses the name `worker2`. |
| ... | ... |
@@ -50,19 +50,21 @@ worker node. This tutorial uses the name `worker2`. |
| 50 | 50 |
joined to the existing swarm: |
| 51 | 51 |
|
| 52 | 52 |
```bash |
| 53 |
- $ docker swarm join --secret 4ao565v9jsuogtq5t8s379ulb \ |
|
| 54 |
- --ca-hash sha256:07ce22bd1a7619f2adc0d63bd110479a170e7c4e69df05b67a1aa2705c88ef09 \ |
|
| 53 |
+ $ docker swarm join \ |
|
| 54 |
+ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ |
|
| 55 | 55 |
192.168.99.100:2377 |
| 56 |
+ |
|
| 57 |
+ This node joined a swarm as a worker. |
|
| 56 | 58 |
``` |
| 57 | 59 |
|
| 58 | 60 |
5. Open a terminal and ssh into the machine where the manager node runs and run |
| 59 | 61 |
the `docker node ls` command to see the worker nodes: |
| 60 | 62 |
|
| 61 | 63 |
```bash |
| 62 |
- ID HOSTNAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 63 |
- 03g1y59jwfg7cf99w4lt0f662 worker2 Accepted Ready Active |
|
| 64 |
- 9j68exjopxe7wfl6yuxml7a7j worker1 Accepted Ready Active |
|
| 65 |
- dxn1zf6l61qsb1josjja83ngz * manager1 Accepted Ready Active Reachable Yes |
|
| 64 |
+ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS |
|
| 65 |
+ 03g1y59jwfg7cf99w4lt0f662 worker2 Ready Active |
|
| 66 |
+ 9j68exjopxe7wfl6yuxml7a7j worker1 Ready Active |
|
| 67 |
+ dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader |
|
| 66 | 68 |
``` |
| 67 | 69 |
|
| 68 | 70 |
The `MANAGER` column identifies the manager nodes in the swarm. The empty |
| ... | ... |
@@ -31,29 +31,28 @@ node. For example, the tutorial uses a machine named `manager1`. |
| 31 | 31 |
|
| 32 | 32 |
```bash |
| 33 | 33 |
$ docker swarm init --listen-addr 192.168.99.100:2377 |
| 34 |
- No --secret provided. Generated random secret: |
|
| 35 |
- 4ao565v9jsuogtq5t8s379ulb |
|
| 36 |
- |
|
| 37 |
- Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a |
|
| 38 |
- manager. |
|
| 34 |
+ Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager. |
|
| 39 | 35 |
|
| 40 | 36 |
To add a worker to this swarm, run the following command: |
| 41 |
- docker swarm join --secret 4ao565v9jsuogtq5t8s379ulb \ |
|
| 42 |
- --ca-hash sha256:07ce22bd1a7619f2adc0d63bd110479a170e7c4e69df05b67a1aa2705c88ef09 \ |
|
| 43 |
- 192.168.99.100:2377 |
|
| 37 |
+ docker swarm join \ |
|
| 38 |
+ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ |
|
| 39 |
+ 192.168.99.100:2377 |
|
| 40 |
+ |
|
| 41 |
+ To add a manager to this swarm, run the following command: |
|
| 42 |
+ docker swarm join \ |
|
| 43 |
+ --token SWMTKN-1-61ztec5kyafptydic6jfc1i33t37flcl4nuipzcusor96k7kby-5vy9t8u35tuqm7vh67lrz9xp6 \ |
|
| 44 |
+ 192.168.99.100:2377 |
|
| 44 | 45 |
``` |
| 45 | 46 |
|
| 46 | 47 |
The `--listen-addr` flag configures the manager node to listen on port |
| 47 | 48 |
`2377`. The other nodes in the swarm must be able to access the manager at |
| 48 | 49 |
the IP address. |
| 49 | 50 |
|
| 50 |
- The `--ca-hash` flag provides the identity of the root CA for the manager |
|
| 51 |
- node. |
|
| 52 |
- |
|
| 53 |
-2. Save the output of `docker swarm init` that includes the command to join |
|
| 54 |
-worker nodes to the swarm. |
|
| 51 |
+ The output incudes the commands to join new nodes to the swarm. Nodes will |
|
| 52 |
+ join as managers or workers depending on the value for the `--swarm-token` |
|
| 53 |
+ flag. |
|
| 55 | 54 |
|
| 56 |
-3. Run `docker info` to view the current state of the swarm: |
|
| 55 |
+2. Run `docker info` to view the current state of the swarm: |
|
| 57 | 56 |
|
| 58 | 57 |
```bash |
| 59 | 58 |
$ docker info |
| ... | ... |
@@ -68,17 +67,16 @@ worker nodes to the swarm. |
| 68 | 68 |
Is Manager: true |
| 69 | 69 |
Managers: 1 |
| 70 | 70 |
Nodes: 1 |
| 71 |
- CA Certificate Hash: sha256:b7986d3baeff2f5664dfe350eec32e2383539ec1a802ba541c4eb829056b5f61 |
|
| 72 | 71 |
...snip... |
| 73 | 72 |
``` |
| 74 | 73 |
|
| 75 |
-4. Run the `docker node ls` command to view information about nodes: |
|
| 74 |
+3. Run the `docker node ls` command to view information about nodes: |
|
| 76 | 75 |
|
| 77 | 76 |
```bash |
| 78 | 77 |
$ docker node ls |
| 79 | 78 |
|
| 80 |
- ID HOSTNAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 81 |
- dxn1zf6l61qsb1josjja83ngz * manager1 Accepted Ready Active Reachable Yes |
|
| 79 |
+ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS |
|
| 80 |
+ dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader |
|
| 82 | 81 |
|
| 83 | 82 |
``` |
| 84 | 83 |
|
| ... | ... |
@@ -31,10 +31,10 @@ run your manager node. For example, the tutorial uses a machine named |
| 31 | 31 |
```bash |
| 32 | 32 |
$ docker node ls |
| 33 | 33 |
|
| 34 |
- ID HOSTNAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 35 |
- 1bcef6utixb0l0ca7gxuivsj0 worker2 Accepted Ready Active |
|
| 36 |
- 38ciaotwjuritcdtn9npbnkuz worker1 Accepted Ready Active |
|
| 37 |
- e216jshn25ckzbvmwlnh5jr3g * manager1 Accepted Ready Active Reachable Yes |
|
| 34 |
+ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS |
|
| 35 |
+ 1bcef6utixb0l0ca7gxuivsj0 worker2 Ready Active |
|
| 36 |
+ 38ciaotwjuritcdtn9npbnkuz worker1 Ready Active |
|
| 37 |
+ e216jshn25ckzbvmwlnh5jr3g * manager1 Ready Active Leader |
|
| 38 | 38 |
``` |
| 39 | 39 |
|
| 40 | 40 |
2. If you aren't still running the `redis` service from the [rolling |
| ... | ... |
@@ -73,6 +73,9 @@ Verify that the Docker Engine daemon is running on each of the machines. |
| 73 | 73 |
The IP address must be assigned to an a network interface available to the host |
| 74 | 74 |
operating system. All nodes in the swarm must be able to access the manager at the IP address. |
| 75 | 75 |
|
| 76 |
+Because other nodes contact the manager node on its IP address, you should use a |
|
| 77 |
+fixed IP address. |
|
| 78 |
+ |
|
| 76 | 79 |
>**Tip**: You can run `ifconfig` on Linux or Mac OS X to see a list of the |
| 77 | 80 |
available network interfaces. |
| 78 | 81 |
|
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
<!--[metadata]> |
| 2 | 2 |
+++ |
| 3 |
-title = "Get started with Swarm" |
|
| 4 |
-description = "Getting started tutorial for Docker Swarm" |
|
| 3 |
+title = "Get started with swarm mode" |
|
| 4 |
+description = "Getting started tutorial for Docker swarm mode" |
|
| 5 | 5 |
keywords = ["cluster, swarm, tutorial"] |
| 6 | 6 |
advisory = "rc" |
| 7 | 7 |
[menu.main] |