Add builtin nodes discovery

Use `pkg/discovery` to provide nodes discovery between daemon instances.

The functionality is driven by two different command-line flags: the
experimental `--cluster-store` (previously `--kv-store`) and
`--cluster-advertise`. It can be used in two ways by interested
components:

1. Externally by calling the `/info` API and examining the cluster store
   field. The `pkg/discovery` package can then be used to hit the same
   endpoint and watch for appearing or disappearing nodes. That is the
   method that will for example be used by Swarm.
2. Internally by using the `Daemon.discoveryWatcher` instance. That is
   the method that will for example be used by libnetwork.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie 2015-09-10 16:12:00 -07:00 committed by Tibor Vass
parent 0039e46e3e
commit f95e9f7c72
2 changed files with 10 additions and 2 deletions

View File

@ -22,6 +22,8 @@ weight=1
-D, --debug=false Enable debug mode
--default-gateway="" Container default gateway IPv4 address
--default-gateway-v6="" Container default gateway IPv6 address
--cluster-store="" URL of the distributed storage backend
--cluster-advertise="" Address of the daemon instance to advertise
--dns=[] DNS server to use
--dns-opt=[] DNS options to use
--dns-search=[] DNS search domains to use
@ -484,6 +486,12 @@ Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linu
set the maximum number of processes available to a user, not to a container. For details
please check the [run](run.md) reference.
## Nodes discovery
`--cluster-advertise` specifies the 'host:port' combination that this particular
daemon instance should use when advertising itself to the cluster. The daemon
should be reachable by remote hosts on this 'host:port' combination.
## Miscellaneous options
IP masquerading uses address translation to allow containers without a public

View File

@ -5,10 +5,10 @@ Using the above experimental UI `docker network`, `docker service` and `--publis
Since `network` and `service` objects are globally significant, this feature requires distributed states provided by the `libkv` project.
Using `libkv`, the user can plug any of the supported Key-Value store (such as consul, etcd or zookeeper).
User can specify the Key-Value store of choice using the `--kv-store` daemon flag, which takes configuration value of format `PROVIDER:URL`, where
User can specify the Key-Value store of choice using the `--cluster-store` daemon flag, which takes configuration value of format `PROVIDER:URL`, where
`PROVIDER` is the name of the Key-Value store (such as consul, etcd or zookeeper) and
`URL` is the url to reach the Key-Value store.
Example : `docker daemon --kv-store=consul:localhost:8500`
Example : `docker daemon --cluster-store=consul://localhost:8500`
Send us feedback and comments on [#14083](https://github.com/docker/docker/issues/14083)
or on the usual Google Groups (docker-user, docker-dev) and IRC channels.