Skip to content

Commit d137d88

Browse files
londoncallingMano Marks
authored and
Mano Marks
committed
clarified relationship of Docker Machine and d4mac, d4win (docker#52)
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
1 parent fdc6c79 commit d137d88

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

swarm-mode/beginner-tutorial/README.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,29 @@
22
Docker Engine 1.12 includes swarm mode for natively managing a cluster of Docker Engines called a swarm. You can use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior. This tutorial uses [Docker Machine](https://docs.docker.com/machine/) to create multiple nodes on your desktop. If you prefer you can create those nodes in your own cloud or on multiple machines.
33

44
## Preparation
5-
You need to have Docker and Docker Machine installed on your machine. [Download Docker](https://docker.com/getdocker) and install it.
5+
You need to have Docker and Docker Machine installed on your system. [Download Docker](https://docker.com/getdocker) for your platform and install it.
6+
7+
>**Tips:**
8+
>
9+
* If you are using Docker for Mac or Docker for Windows, you already have Docker Machine, as it is installed with those applications. See [Download Docker for Mac](https://docs.docker.com/docker-for-mac/#/download-docker-for-mac) and [Download Docker for Windows](https://docs.docker.com/docker-for-windows/#/download-docker-for-windows) for install options and details on what gets installed.
10+
>
11+
* If you are using Docker directly on a Linux system, you will need to [install Docker Machine](https://docs.docker.com/machine/install-machine/) (after installing [Docker Engine](https://docs.docker.com/engine/installation/linux/)).
612

713
## Creating the nodes and Swarm
814
[Docker Machine](https://docs.docker.com/machine/overview/) can be used to:
915
* Install and run Docker on Mac or Windows
1016
* Provision and manage multiple remote Docker hosts
11-
* Provision Swarm clusters
17+
* Provision Swarm clusters
1218

1319
But it can also be used to create multiple nodes on your local machine. There's a [bash script](https://github.com/ManoMarks/labs/blob/master/swarm-mode/beginner-tutorial/swarm-node-vbox-setup.sh) in this repository that does just that and creates a swarm. Let's walk through the different steps of this script.
1420

15-
This first step creates three machines, and names the machines manager1, manager2, and manager3
21+
This first step creates three machines, and names the machines manager1, manager2, and manager3
1622
```
1723
#!/bin/bash
1824
1925
# Swarm mode using Docker Machine
2026
21-
#This configures the number of workers and managers in the swarm
27+
#This configures the number of workers and managers in the swarm
2228
managers=3
2329
workers=3
2430
@@ -271,7 +277,7 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
271277
7eljvvg0icxlw20od5f51oq8t manager2 Ready Active Reachable
272278
8awcmkj3sd9nv1pi77i6mdb1i worker1 Ready Drain
273279
avu80ol573rzepx8ov80ygzxz worker2 Ready Active
274-
bxn1iivy8w7faeugpep76w50j worker3 Ready Active
280+
bxn1iivy8w7faeugpep76w50j worker3 Ready Active
275281
```
276282

277283
You can also scale down the service
@@ -299,7 +305,7 @@ aivwszsjhhpky43t3x7o8ezz9 web.10 nginx:latest worker2 Shutdown Sh
299305
7zg9eki4610maigr1xwrx7zqk web.14 nginx:latest manager3 Shutdown Shutdown 54 seconds ago
300306
4z2c9j20gwsasosvj7mkzlyhc web.15 nginx:latest manager2 Shutdown Shutdown 54 seconds ago
301307
```
302-
308+
303309
Now bring `worker1` back online and show it's new availability
304310
```
305311
$ docker-machine ssh manager1 "docker node update --availability active worker1"
@@ -340,19 +346,19 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
340346
7eljvvg0icxlw20od5f51oq8t * manager2 Ready Active Leader
341347
8awcmkj3sd9nv1pi77i6mdb1i worker1 Ready Active
342348
avu80ol573rzepx8ov80ygzxz worker2 Ready Active
343-
bxn1iivy8w7faeugpep76w50j worker3 Ready Active
349+
bxn1iivy8w7faeugpep76w50j worker3 Ready Active
344350
```
345351
You see that `manager1` is Down and Unreachable and `manager2` has been elected leader. It's also easy to remove a service:
346352
```
347353
$ docker-machine ssh manager2 "docker service rm web"
348354
web
349355
```
350356

351-
## Cleanup
357+
## Cleanup
352358
There's also a [bash script](https://github.com/ManoMarks/labs/blob/master/swarm-mode/beginner-tutorial/swarm-node-vbox-teardown.sh) that will clean up your machine by removing all the Docker Machines.
353359

354360
```
355-
$ ./swarm-node-vbox-teardown.sh
361+
$ ./swarm-node-vbox-teardown.sh
356362
Stopping "manager3"...
357363
Stopping "manager2"...
358364
Stopping "worker1"...
@@ -376,4 +382,4 @@ Successfully removed manager3
376382
```
377383

378384
## Next steps
379-
Next, check out the documentation on [Docker Swarm Mode](https://docs.docker.com/engine/swarm/) for more information.
385+
Next, check out the documentation on [Docker Swarm Mode](https://docs.docker.com/engine/swarm/) for more information.

0 commit comments

Comments
 (0)