diff --git a/Documentation/cluster-discovery.md b/Documentation/cluster-discovery.md index 89f0d1a36..8f53c9d18 100644 --- a/Documentation/cluster-discovery.md +++ b/Documentation/cluster-discovery.md @@ -13,11 +13,11 @@ Please note - at least 3 nodes are required for [cluster availability][optimal-c ## Using discovery.etcd.io -### Create a Token +### Create a Discovery URL -To use the discovery API, you must first create a token for your etcd cluster. Visit [https://discovery.etcd.io/new](https://discovery.etcd.io/new) to create a new token. +To use the discovery API, you must first create a unique discovery URL for your etcd cluster. Visit [https://discovery.etcd.io/new](https://discovery.etcd.io/new) to create a new discovery URL. -You can inspect the list of peers by viewing `https://discovery.etcd.io/`. +You can inspect the list of peers by viewing `https://discovery.etcd.io/`. ### Start etcd With the Discovery Flag @@ -26,10 +26,10 @@ Specify the `-discovery` flag when you start each etcd instance. The list of exi Here's a full example: ``` -TOKEN=$(curl https://discovery.etcd.io/new) -./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery $TOKEN -./etcd -name instance2 -peer-addr 10.1.2.4:7001 -addr 10.1.2.4:4001 -discovery $TOKEN -./etcd -name instance3 -peer-addr 10.1.2.5:7001 -addr 10.1.2.5:4001 -discovery $TOKEN +URL=$(curl https://discovery.etcd.io/new) +./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery $URL +./etcd -name instance2 -peer-addr 10.1.2.4:7001 -addr 10.1.2.4:4001 -discovery $URL +./etcd -name instance3 -peer-addr 10.1.2.5:7001 -addr 10.1.2.5:4001 -discovery $URL ``` ## Running Your Own Discovery Endpoint @@ -37,10 +37,10 @@ TOKEN=$(curl https://discovery.etcd.io/new) The discovery API communicates with a separate etcd cluster to store and retrieve the list of peers. CoreOS provides [https://discovery.etcd.io](https://discovery.etcd.io) as a free service, but you can easily run your own etcd cluster for this purpose. Here's an example using an etcd cluster located at `10.10.10.10:4001`: ``` -TOKEN="testcluster" -./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery http://10.10.10.10:4001/v2/keys/$TOKEN -./etcd -name instance2 -peer-addr 10.1.2.4:7001 -addr 10.1.2.4:4001 -discovery http://10.10.10.10:4001/v2/keys/$TOKEN -./etcd -name instance3 -peer-addr 10.1.2.5:7001 -addr 10.1.2.5:4001 -discovery http://10.10.10.10:4001/v2/keys/$TOKEN +URL="http://10.10.10.10:4001/v2/keys/testcluster" +./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery $URL +./etcd -name instance2 -peer-addr 10.1.2.4:7001 -addr 10.1.2.4:4001 -discovery $URL +./etcd -name instance3 -peer-addr 10.1.2.5:7001 -addr 10.1.2.5:4001 -discovery $URL ``` If you're interested in how to discovery API works behind the scenes, read about the [Discovery Protocol](https://github.com/coreos/etcd/blob/master/Documentation/discovery-protocol.md).