github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/docs/reference/commandline/swarm_init.md (about) 1 <!--[metadata]> 2 +++ 3 title = "swarm init" 4 description = "The swarm init command description and usage" 5 keywords = ["swarm, init"] 6 advisory = "rc" 7 [menu.main] 8 parent = "smn_cli" 9 +++ 10 <![end-metadata]--> 11 12 # swarm init 13 14 Usage: docker swarm init [OPTIONS] 15 16 Initialize a Swarm. 17 18 Options: 19 --auto-accept value Acceptance policy (default [worker,manager]) 20 --force-new-cluster Force create a new cluster from current state. 21 --help Print usage 22 --listen-addr value Listen address (default 0.0.0.0:2377) 23 --secret string Set secret value needed to accept nodes into cluster 24 25 Initialize a Swarm cluster. The docker engine targeted by this command becomes a manager 26 in the newly created one node Swarm cluster. 27 28 29 ```bash 30 $ docker swarm init --listen-addr 192.168.99.121:2377 31 Swarm initialized: current node (1ujecd0j9n3ro9i6628smdmth) is now a manager. 32 $ docker node ls 33 ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER 34 1ujecd0j9n3ro9i6628smdmth * manager1 Accepted Ready Active Reachable Yes 35 ``` 36 37 ### --auto-accept value 38 39 This flag controls node acceptance into the cluster. By default, both `worker` and `manager` 40 nodes are auto accepted by the cluster. This can be changed by specifing what kinds of nodes 41 can be auto-accepted into the cluster. If auto-accept is not turned on, then 42 [node accept](node_accept.md) can be used to explicitly accept a node into the cluster. 43 44 For example, the following initializes a cluster with auto-acceptance of workers, but not managers 45 46 47 ```bash 48 $ docker swarm init --listen-addr 192.168.99.121:2377 --auto-accept worker 49 Swarm initialized: current node (1m8cdsylxbf3lk8qriqt07hx1) is now a manager. 50 ``` 51 52 ### `--force-new-cluster` 53 54 This flag forces an existing node that was part of a quorum that was lost to restart as a single node Manager without losing its data 55 56 ### `--listen-addr value` 57 58 The node listens for inbound Swarm manager traffic on this IP:PORT 59 60 ### `--secret string` 61 62 Secret value needed to accept nodes into the Swarm 63 64 ## Related information 65 66 * [swarm join](swarm_join.md) 67 * [swarm leave](swarm_leave.md) 68 * [swarm update](swarm_update.md)