github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/docs/swarm/swarm-tutorial/create-swarm.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Create a swarm" 4 description = "Initialize the swarm" 5 keywords = ["tutorial, cluster management, swarm mode"] 6 advisory = "rc" 7 [menu.main] 8 identifier="initialize-swarm" 9 parent="swarm-tutorial" 10 weight=12 11 +++ 12 <![end-metadata]--> 13 14 # Create a swarm 15 16 After you complete the [tutorial setup](index.md) steps, you're ready 17 to create a swarm. Make sure the Docker Engine daemon is started on the host 18 machines. 19 20 1. Open a terminal and ssh into the machine where you want to run your manager 21 node. For example, the tutorial uses a machine named `manager1`. 22 23 2. Run the following command to create a new swarm: 24 25 ``` 26 docker swarm init --listen-addr <MANAGER-IP>:<PORT> 27 ``` 28 29 In the tutorial, the following command creates a swarm on the `manager1` machine: 30 31 ``` 32 $ docker swarm init --listen-addr 192.168.99.100:2377 33 34 Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager. 35 ``` 36 37 The `--listen-addr` flag configures the manager node to listen on port 38 `2377`. The other nodes in the swarm must be able to access the manager at 39 the IP address. 40 41 3. Run `docker info` to view the current state of the swarm: 42 43 ``` 44 $ docker info 45 46 Containers: 2 47 Running: 0 48 Paused: 0 49 Stopped: 2 50 ...snip... 51 Swarm: active 52 NodeID: dxn1zf6l61qsb1josjja83ngz 53 IsManager: Yes 54 Managers: 1 55 Nodes: 1 56 CACertHash: sha256:b7986d3baeff2f5664dfe350eec32e2383539ec1a802ba541c4eb829056b5f61 57 ...snip... 58 ``` 59 60 4. Run the `docker node ls` command to view information about nodes: 61 62 ``` 63 $ docker node ls 64 65 ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER 66 dxn1zf6l61qsb1josjja83ngz * manager1 Accepted Ready Active Reachable Yes 67 68 ``` 69 70 The `*` next to the node id, indicates that you're currently connected on 71 this node. 72 73 Docker Engine swarm mode automatically names the node for the machine host 74 name. The tutorial covers other columns in later steps. 75 76 ## What's next? 77 78 In the next section of the tutorial, we'll [add two more nodes](add-nodes.md) to 79 the cluster.