mirror of https://github.com/docker/docs.git
update READMEs
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
1f9eac7fd1
commit
008398cc99
49
README.md
49
README.md
|
|
@ -24,7 +24,7 @@ This can be achieved by starting Docker with the `-H` flag (e.g. `-H 0.0.0.0:237
|
||||||
Currently, nodes must be running the Docker **master** version.
|
Currently, nodes must be running the Docker **master** version.
|
||||||
Master binaries are available here: https://master.dockerproject.com/
|
Master binaries are available here: https://master.dockerproject.com/
|
||||||
|
|
||||||
### Example usage: using the hosted discovery service
|
### Example usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# create a cluster
|
# create a cluster
|
||||||
|
|
@ -51,51 +51,8 @@ $ swarm list --discovery token://6856663cdefdec325839a4b7e1de38e8
|
||||||
http://<node_ip:2375>
|
http://<node_ip:2375>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example usage: using a static file describing the cluster
|
See [here](https://github.com/docker/swarm/discovery) for more information about
|
||||||
|
other discovery services.
|
||||||
```bash
|
|
||||||
# for each of your nodes, add a line to a file
|
|
||||||
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
|
|
||||||
# as long as the other nodes can reach it, it is fine.
|
|
||||||
$ echo <node_ip:2375> >> /tmp/my_cluster
|
|
||||||
|
|
||||||
# start the manager on any machine or your laptop
|
|
||||||
$ swarm manage --discovery file:///tmp/my_cluster --addr=<swarm_ip:swarm_port>
|
|
||||||
|
|
||||||
# use the regular docker cli
|
|
||||||
$ docker -H <swarm_ip:swarm_port> info
|
|
||||||
$ docker -H <swarm_ip:swarm_port> run ...
|
|
||||||
$ docker -H <swarm_ip:swarm_port> ps
|
|
||||||
$ docker -H <swarm_ip:swarm_port> logs ...
|
|
||||||
...
|
|
||||||
|
|
||||||
# list nodes in your cluster
|
|
||||||
$ swarm list --discovery file:///tmp/my_cluster
|
|
||||||
http://<node_ip:2375>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example usage: using etcd
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# on each of your nodes, start the swarm agent
|
|
||||||
# <node_ip> 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://<etcd_ip>/>path> --addr=<node_ip:2375>
|
|
||||||
|
|
||||||
# start the manager on any machine or your laptop
|
|
||||||
$ swarm manage --discovery etcd://<etcd_ip>/>path> --addr=<swarm_ip:swarm_port>
|
|
||||||
|
|
||||||
# use the regular docker cli
|
|
||||||
$ docker -H <swarm_ip:swarm_port> info
|
|
||||||
$ docker -H <swarm_ip:swarm_port> run ...
|
|
||||||
$ docker -H <swarm_ip:swarm_port> ps
|
|
||||||
$ docker -H <swarm_ip:swarm_port> logs ...
|
|
||||||
...
|
|
||||||
|
|
||||||
# list nodes in your cluster
|
|
||||||
$ swarm list --discovery etcd://<etcd_ip>/>path>
|
|
||||||
http://<node_ip:2375>
|
|
||||||
```
|
|
||||||
|
|
||||||
### TLS
|
### TLS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,100 @@
|
||||||
Discovery
|
Discovery
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
`Docker Swarm` comes with multiple Discovery backends
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
##### Using the hosted discovery service
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# create a cluster
|
||||||
|
$ swarm create
|
||||||
|
6856663cdefdec325839a4b7e1de38e8
|
||||||
|
|
||||||
|
# on each of your nodes, start the swarm agent
|
||||||
|
# <node_ip> 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://6856663cdefdec325839a4b7e1de38e8 --addr=<node_ip:2375>
|
||||||
|
|
||||||
|
# start the manager on any machine or your laptop
|
||||||
|
$ swarm manage --discovery token://6856663cdefdec325839a4b7e1de38e8 --addr=<swarm_ip:swarm_port>
|
||||||
|
|
||||||
|
# use the regular docker cli
|
||||||
|
$ docker -H <swarm_ip:swarm_port> info
|
||||||
|
$ docker -H <swarm_ip:swarm_port> run ...
|
||||||
|
$ docker -H <swarm_ip:swarm_port> ps
|
||||||
|
$ docker -H <swarm_ip:swarm_port> logs ...
|
||||||
|
...
|
||||||
|
|
||||||
|
# list nodes in your cluster
|
||||||
|
$ swarm list --discovery token://6856663cdefdec325839a4b7e1de38e8
|
||||||
|
http://<node_ip:2375>
|
||||||
|
```
|
||||||
|
|
||||||
|
###### Using a static file describing the cluster
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# for each of your nodes, add a line to a file
|
||||||
|
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
|
||||||
|
# as long as the other nodes can reach it, it is fine.
|
||||||
|
$ echo <node_ip:2375> >> /tmp/my_cluster
|
||||||
|
|
||||||
|
# start the manager on any machine or your laptop
|
||||||
|
$ swarm manage --discovery file:///tmp/my_cluster --addr=<swarm_ip:swarm_port>
|
||||||
|
|
||||||
|
# use the regular docker cli
|
||||||
|
$ docker -H <swarm_ip:swarm_port> info
|
||||||
|
$ docker -H <swarm_ip:swarm_port> run ...
|
||||||
|
$ docker -H <swarm_ip:swarm_port> ps
|
||||||
|
$ docker -H <swarm_ip:swarm_port> logs ...
|
||||||
|
...
|
||||||
|
|
||||||
|
# list nodes in your cluster
|
||||||
|
$ swarm list --discovery file:///tmp/my_cluster
|
||||||
|
http://<node_ip:2375>
|
||||||
|
```
|
||||||
|
|
||||||
|
###### Using etcd
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# on each of your nodes, start the swarm agent
|
||||||
|
# <node_ip> 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://<etcd_ip>/>path> --addr=<node_ip:2375>
|
||||||
|
|
||||||
|
# start the manager on any machine or your laptop
|
||||||
|
$ swarm manage --discovery etcd://<etcd_ip>/>path> --addr=<swarm_ip:swarm_port>
|
||||||
|
|
||||||
|
# use the regular docker cli
|
||||||
|
$ docker -H <swarm_ip:swarm_port> info
|
||||||
|
$ docker -H <swarm_ip:swarm_port> run ...
|
||||||
|
$ docker -H <swarm_ip:swarm_port> ps
|
||||||
|
$ docker -H <swarm_ip:swarm_port> logs ...
|
||||||
|
...
|
||||||
|
|
||||||
|
# list nodes in your cluster
|
||||||
|
$ swarm list --discovery etcd://<etcd_ip>/>path>
|
||||||
|
http://<node_ip:2375>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
Contributing a new discovery backend is easy,
|
Contributing a new discovery backend is easy,
|
||||||
simply implements this interface:
|
simply implements this interface:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type DiscoveryService interface {
|
type DiscoveryService interface {
|
||||||
|
Initialize(string, int) error
|
||||||
Fetch() ([]string, error)
|
Fetch() ([]string, error)
|
||||||
Watch(int) <-chan time.Time
|
Watch() <-chan time.Time
|
||||||
Register(string) error
|
Register(string) error
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
######Initialize
|
||||||
|
take the `--dicovery` withtout the scheme and a heartbeat (in seconds)
|
||||||
|
|
||||||
######Fetch
|
######Fetch
|
||||||
returns the list of all the nodes from the discovery
|
returns the list of all the nodes from the discovery
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue