diff --git a/README.md b/README.md index 64a3683153..bf9e890c0e 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ $ swarm create # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery token:// --addr= +$ swarm join --addr= token:// # start the manager on any machine or your laptop -$ swarm manage --discovery token:// -H tcp:// +$ swarm manage -H tcp:// token:// # use the regular docker cli $ docker -H tcp:// info @@ -49,7 +49,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery token:// +$ swarm list token:// ``` diff --git a/discovery/README.md b/discovery/README.md index b89a3a8def..45f498e16c 100644 --- a/discovery/README.md +++ b/discovery/README.md @@ -15,10 +15,10 @@ $ swarm create # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery token:// --addr= +$ swarm join --addr= token:// # start the manager on any machine or your laptop -$ swarm manage --discovery token:// -H tcp:// +$ swarm manage -H tcp:// token:// # use the regular docker cli $ docker -H tcp:// info @@ -28,7 +28,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery token:// +$ swarm list token:// ``` @@ -43,7 +43,7 @@ $ echo >> /tmp/my_cluster $ echo >> /tmp/my_cluster # start the manager on any machine or your laptop -$ swarm manage --discovery file:///tmp/my_cluster -H tcp:// +$ swarm manage -H tcp:// file:///tmp/my_cluster # use the regular docker cli $ docker -H tcp:// info @@ -53,7 +53,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery file:///tmp/my_cluster +$ swarm list file:///tmp/my_cluster @@ -65,10 +65,10 @@ $ swarm list --discovery file:///tmp/my_cluster # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery etcd:/// --addr= +$ swarm join --addr= etcd:/// # start the manager on any machine or your laptop -$ swarm manage --discovery etcd:/// -H tcp:// +$ swarm manage -H tcp:// etcd:/// # use the regular docker cli $ docker -H tcp:// info @@ -78,7 +78,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery etcd:/// +$ swarm list etcd:/// ``` @@ -88,10 +88,10 @@ $ swarm list --discovery etcd:/// # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery consul:/// --addr= +$ swarm join --addr= consul:/// # start the manager on any machine or your laptop -$ swarm manage --discovery consul:/// -H tcp:// +$ swarm manage -H tcp:// consul:/// # use the regular docker cli $ docker -H tcp:// info @@ -101,7 +101,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery consul:/// +$ swarm list consul:/// ``` @@ -111,10 +111,10 @@ $ swarm list --discovery consul:/// # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery zk://,/ --addr= +$ swarm join --addr= zk://,/ # start the manager on any machine or your laptop -$ swarm manage --discovery zk://,/ -H tcp:// +$ swarm manage -H tcp:// zk://,/ # use the regular docker cli $ docker -H tcp:// info @@ -124,7 +124,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list --discovery zk://,/ +$ swarm list zk://,/ ``` @@ -132,9 +132,9 @@ $ swarm list --discovery zk://,/ ```bash # start the manager on any machine or your laptop -$ swarm manage --discovery , -H= +$ swarm manage -H nodes://, #or -$ swarm manage --discovery nodes://, -H= +$ swarm manage -H nodes://, # use the regular docker cli $ docker -H info @@ -159,7 +159,7 @@ type DiscoveryService interface { ``` ######Initialize -take the `--discovery` without the scheme and a heartbeat (in seconds) +take the `discovery` without the scheme and a heartbeat (in seconds) ######Fetch returns the list of all the nodes from the discovery diff --git a/flags.go b/flags.go index f3dbd18108..33fabea961 100644 --- a/flags.go +++ b/flags.go @@ -31,12 +31,6 @@ var ( Value: homepath(".swarm"), Usage: "", } - flDiscovery = cli.StringFlag{ - Name: "discovery", - Value: "", - Usage: "discovery service to use [token://,\n\t\t\t\t etcd://,/,\n\t\t\t\t file://path/to/file,\n\t\t\t\t consul:///,\n\t\t\t\t zk://,/,\n\t\t\t\t ,]", - EnvVar: "SWARM_DISCOVERY", - } flAddr = cli.StringFlag{ Name: "addr", Value: "127.0.0.1:4243", diff --git a/help.go b/help.go index cf06c4ab2c..a2b3690239 100644 --- a/help.go +++ b/help.go @@ -7,7 +7,7 @@ func init() { cli.CommandHelpTemplate = `{{$DISCOVERY := or (eq .Name "manage") (eq .Name "join") (eq .Name "list")}}NAME: {{.Name}} - {{.Usage}} USAGE: - swarm {{.Name}}{{if .Flags}} [command options]{{end}} {{if $DISCOVERY}}[discovery]{{end}}{{if .Description}} + swarm {{.Name}}{{if .Flags}} [options]{{end}} {{if $DISCOVERY}}{{end}}{{if .Description}} DESCRIPTION: {{.Description}}{{end}}{{if $DISCOVERY}} ARGUMENTS: diff --git a/scheduler/filter/README.md b/scheduler/filter/README.md index fad98b44f5..65c10b8c25 100644 --- a/scheduler/filter/README.md +++ b/scheduler/filter/README.md @@ -30,14 +30,14 @@ For instance, let's start `node-1` with the `storage=ssd` label: ```bash $ docker -d --label storage=ssd -$ swarm join --discovery token://XXXXXXXXXXXXXXXXXX --addr=192.168.0.42:2375 +$ swarm join --addr=192.168.0.42:2375 token://XXXXXXXXXXXXXXXXXX ``` Again, but this time `node-2` with `storage=disk`: ```bash $ docker -d --label storage=disk -$ swarm join --discovery token://XXXXXXXXXXXXXXXXXX --addr=192.168.0.43:2375 +$ swarm join --addr=192.168.0.43:2375 token://XXXXXXXXXXXXXXXXXX ``` Once the nodes are registered with the cluster, the master pulls their respective tags and will take them into account when scheduling new containers.