|
|
@@ -2,9 +2,9 @@
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
-Starting an etcd cluster statically requires that each member knows another in the cluster. In a number of cases, you might not know the IPs of your cluster members ahead of time. In these cases, you can bootstrap an etcd cluster with the help of a discovery service.
|
|
|
+Starting an etcd cluster statically requires that each member knows another in the cluster. In a number of cases, the IPs of the cluster members may be unknown ahead of time. In these cases, the etcd cluster can be bootstrapped with the help of a discovery service.
|
|
|
|
|
|
-Once an etcd cluster is up and running, adding or removing members is done via [runtime reconfiguration][runtime-conf]. To better understand the design behind runtime reconfiguration, we suggest you read [the runtime configuration design document][runtime-reconf-design].
|
|
|
+Once an etcd cluster is up and running, adding or removing members is done via [runtime reconfiguration][runtime-conf]. To better understand the design behind runtime reconfiguration, we suggest reading [the runtime configuration design document][runtime-reconf-design].
|
|
|
|
|
|
This guide will cover the following mechanisms for bootstrapping an etcd cluster:
|
|
|
|
|
|
@@ -36,11 +36,11 @@ ETCD_INITIAL_CLUSTER_STATE=new
|
|
|
|
|
|
Note that the URLs specified in `initial-cluster` are the _advertised peer URLs_, i.e. they should match the value of `initial-advertise-peer-urls` on the respective nodes.
|
|
|
|
|
|
-If you are spinning up multiple clusters (or creating and destroying a single cluster) with same configuration for testing purpose, it is highly recommended that you specify a unique `initial-cluster-token` for the different clusters. By doing this, etcd can generate unique cluster IDs and member IDs for the clusters even if they otherwise have the exact same configuration. This can protect you from cross-cluster-interaction, which might corrupt your clusters.
|
|
|
+If spinning up multiple clusters (or creating and destroying a single cluster) with same configuration for testing purpose, it is highly recommended that each cluster is given a unique `initial-cluster-token`. By doing this, etcd can generate unique cluster IDs and member IDs for the clusters even if they otherwise have the exact same configuration. This can protect etcd from cross-cluster-interaction, which might corrupt the clusters.
|
|
|
|
|
|
-etcd listens on [`listen-client-urls`][conf-listen-client] to accept client traffic. etcd member advertises the URLs specified in [`advertise-client-urls`][conf-adv-client] to other members, proxies, clients. Please make sure the `advertise-client-urls` are reachable from intended clients. A common mistake is setting `advertise-client-urls` to localhost or leave it as default when you want the remote clients to reach etcd.
|
|
|
+etcd listens on [`listen-client-urls`][conf-listen-client] to accept client traffic. etcd member advertises the URLs specified in [`advertise-client-urls`][conf-adv-client] to other members, proxies, clients. Please make sure the `advertise-client-urls` are reachable from intended clients. A common mistake is setting `advertise-client-urls` to localhost or leave it as default if the remote clients should reach etcd.
|
|
|
|
|
|
-On each machine you would start etcd with these flags:
|
|
|
+On each machine, start etcd with these flags:
|
|
|
|
|
|
```
|
|
|
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
|
|
|
@@ -70,7 +70,7 @@ $ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
|
|
|
--initial-cluster-state new
|
|
|
```
|
|
|
|
|
|
-The command line parameters starting with `--initial-cluster` will be ignored on subsequent runs of etcd. You are free to remove the environment variables or command line flags after the initial bootstrap process. If you need to make changes to the configuration later (for example, adding or removing members to/from the cluster), see the [runtime configuration][runtime-conf] guide.
|
|
|
+The command line parameters starting with `--initial-cluster` will be ignored on subsequent runs of etcd. Feel free to remove the environment variables or command line flags after the initial bootstrap process. If the configuration needs changes later (for example, adding or removing members to/from the cluster), see the [runtime configuration][runtime-conf] guide.
|
|
|
|
|
|
### TLS
|
|
|
|
|
|
@@ -190,7 +190,7 @@ etcd: error setting up initial cluster: infra0 has different advertised URLs in
|
|
|
exit 1
|
|
|
```
|
|
|
|
|
|
-If you configure a peer with a different set of configuration and attempt to join this cluster you will get a cluster ID mismatch and etcd will exit.
|
|
|
+If a peer is configured with a different set of configuration arguments and attempts to join this cluster, etcd will report a cluster ID mismatch will exit.
|
|
|
|
|
|
```
|
|
|
$ etcd --name infra3 --initial-advertise-peer-urls http://10.0.1.13:2380 \
|
|
|
@@ -205,7 +205,7 @@ exit 1
|
|
|
|
|
|
## Discovery
|
|
|
|
|
|
-In a number of cases, you might not know the IPs of your cluster peers ahead of time. This is common when utilizing cloud providers or when your network uses DHCP. In these cases, rather than specifying a static configuration, you can use an existing etcd cluster to bootstrap a new one. We call this process "discovery".
|
|
|
+In a number of cases, the IPs of the cluster peers may not be known ahead of time. This is common when utilizing cloud providers or when the network uses DHCP. In these cases, rather than specifying a static configuration, use an existing etcd cluster to bootstrap a new one. We call this process "discovery".
|
|
|
|
|
|
There two methods that can be used for discovery:
|
|
|
|
|
|
@@ -214,25 +214,25 @@ There two methods that can be used for discovery:
|
|
|
|
|
|
### etcd Discovery
|
|
|
|
|
|
-To better understand the design about discovery service protocol, we suggest you read [this][discovery-proto].
|
|
|
+To better understand the design about discovery service protocol, we suggest reading the discovery service protocol [documentation][discovery-proto].
|
|
|
|
|
|
#### Lifetime of a Discovery URL
|
|
|
|
|
|
-A discovery URL identifies a unique etcd cluster. Instead of reusing a discovery URL, you should always create discovery URLs for new clusters.
|
|
|
+A discovery URL identifies a unique etcd cluster. Instead of reusing a discovery URL, always create discovery URLs for new clusters.
|
|
|
|
|
|
Moreover, discovery URLs should ONLY be used for the initial bootstrapping of a cluster. To change cluster membership after the cluster is already running, see the [runtime reconfiguration][runtime-conf] guide.
|
|
|
|
|
|
#### Custom etcd Discovery Service
|
|
|
|
|
|
-Discovery uses an existing cluster to bootstrap itself. If you are using your own etcd cluster you can create a URL like so:
|
|
|
+Discovery uses an existing cluster to bootstrap itself. If using a private etcd cluster, can create a URL like so:
|
|
|
|
|
|
```
|
|
|
$ curl -X PUT https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83/_config/size -d value=3
|
|
|
```
|
|
|
|
|
|
-By setting the size key to the URL, you create a discovery URL with an expected cluster size of 3.
|
|
|
+By setting the size key to the URL, a discovery URL is created with an expected cluster size of 3.
|
|
|
|
|
|
-The URL you will use in this case will be `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` and the etcd members will use the `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` directory for registration as they start.
|
|
|
+The URL to use in this case will be `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` and the etcd members will use the `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` directory for registration as they start.
|
|
|
|
|
|
**Each member must have a different name flag specified. `Hostname` or `machine-id` can be a good choice. Or discovery will fail due to duplicated name.**
|
|
|
|
|
|
@@ -264,14 +264,14 @@ This will cause each member to register itself with the custom etcd discovery se
|
|
|
|
|
|
#### Public etcd Discovery Service
|
|
|
|
|
|
-If you do not have access to an existing cluster, you can use the public discovery service hosted at `discovery.etcd.io`. You can create a private discovery URL using the "new" endpoint like so:
|
|
|
+If no exiting cluster is available, use the public discovery service hosted at `discovery.etcd.io`. To create a private discovery URL using the "new" endpoint, use the command:
|
|
|
|
|
|
```
|
|
|
$ curl https://discovery.etcd.io/new?size=3
|
|
|
https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
|
|
|
```
|
|
|
|
|
|
-This will create the cluster with an initial expected size of 3 members. If you do not specify a size, a default of 3 will be used.
|
|
|
+This will create the cluster with an initial expected size of 3 members. If no size is specified, a default of 3 is used.
|
|
|
|
|
|
```
|
|
|
ETCD_DISCOVERY=https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
|
|
|
@@ -309,7 +309,7 @@ $ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
|
|
|
|
|
|
This will cause each member to register itself with the discovery service and begin the cluster once all members have been registered.
|
|
|
|
|
|
-You can use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use an HTTP proxy to connect to the discovery service.
|
|
|
+Use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use an HTTP proxy to connect to the discovery service.
|
|
|
|
|
|
#### Error and Warning Cases
|
|
|
|
|
|
@@ -328,8 +328,7 @@ exit 1
|
|
|
|
|
|
##### Warnings
|
|
|
|
|
|
-This is a harmless warning notifying you that the discovery URL will be
|
|
|
-ignored on this machine.
|
|
|
+This is a harmless warning indicating the discovery URL will be ignored on this machine.
|
|
|
|
|
|
```
|
|
|
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
|
|
|
@@ -420,7 +419,7 @@ $ etcd --name infra2 \
|
|
|
--listen-peer-urls http://infra2.example.com:2380
|
|
|
```
|
|
|
|
|
|
-You can also bootstrap the cluster using IP addresses instead of domain names:
|
|
|
+The cluster can also bootstrap using IP addresses instead of domain names:
|
|
|
|
|
|
```
|
|
|
$ etcd --name infra0 \
|