|
|
@@ -17,14 +17,14 @@ This will run the latest release version of etcd. You can specify version if nee
|
|
|
```
|
|
|
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
|
|
|
--name etcd quay.io/coreos/etcd \
|
|
|
- -name etcd0 \
|
|
|
- -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
|
|
|
- -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
- -initial-advertise-peer-urls http://${HostIP}:2380 \
|
|
|
- -listen-peer-urls http://0.0.0.0:2380 \
|
|
|
- -initial-cluster-token etcd-cluster-1 \
|
|
|
- -initial-cluster etcd0=http://${HostIP}:2380 \
|
|
|
- -initial-cluster-state new
|
|
|
+ --name etcd0 \
|
|
|
+ --advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
|
|
|
+ --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
+ --initial-advertise-peer-urls http://${HostIP}:2380 \
|
|
|
+ --listen-peer-urls http://0.0.0.0:2380 \
|
|
|
+ --initial-cluster-token etcd-cluster-1 \
|
|
|
+ --initial-cluster etcd0=http://${HostIP}:2380 \
|
|
|
+ --initial-cluster-state new
|
|
|
```
|
|
|
|
|
|
Configure etcd clients to use the Docker host IP and one of the listening ports from above.
|
|
|
@@ -47,14 +47,14 @@ The main difference being the value used for the `-initial-cluster` flag, which
|
|
|
```
|
|
|
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
|
|
|
--name etcd quay.io/coreos/etcd \
|
|
|
- -name etcd0 \
|
|
|
- -advertise-client-urls http://192.168.12.50:2379,http://192.168.12.50:4001 \
|
|
|
- -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
- -initial-advertise-peer-urls http://192.168.12.50:2380 \
|
|
|
- -listen-peer-urls http://0.0.0.0:2380 \
|
|
|
- -initial-cluster-token etcd-cluster-1 \
|
|
|
- -initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
- -initial-cluster-state new
|
|
|
+ --name etcd0 \
|
|
|
+ --advertise-client-urls http://192.168.12.50:2379,http://192.168.12.50:4001 \
|
|
|
+ --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
+ --initial-advertise-peer-urls http://192.168.12.50:2380 \
|
|
|
+ --listen-peer-urls http://0.0.0.0:2380 \
|
|
|
+ --initial-cluster-token etcd-cluster-1 \
|
|
|
+ --initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
+ --initial-cluster-state new
|
|
|
```
|
|
|
|
|
|
### etcd1
|
|
|
@@ -62,14 +62,14 @@ docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380
|
|
|
```
|
|
|
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
|
|
|
--name etcd quay.io/coreos/etcd \
|
|
|
- -name etcd1 \
|
|
|
- -advertise-client-urls http://192.168.12.51:2379,http://192.168.12.51:4001 \
|
|
|
- -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
- -initial-advertise-peer-urls http://192.168.12.51:2380 \
|
|
|
- -listen-peer-urls http://0.0.0.0:2380 \
|
|
|
- -initial-cluster-token etcd-cluster-1 \
|
|
|
- -initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
- -initial-cluster-state new
|
|
|
+ --name etcd1 \
|
|
|
+ --advertise-client-urls http://192.168.12.51:2379,http://192.168.12.51:4001 \
|
|
|
+ --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
+ --initial-advertise-peer-urls http://192.168.12.51:2380 \
|
|
|
+ --listen-peer-urls http://0.0.0.0:2380 \
|
|
|
+ --initial-cluster-token etcd-cluster-1 \
|
|
|
+ --initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
+ --initial-cluster-state new
|
|
|
```
|
|
|
|
|
|
### etcd2
|
|
|
@@ -77,14 +77,14 @@ docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380
|
|
|
```
|
|
|
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
|
|
|
--name etcd quay.io/coreos/etcd \
|
|
|
- -name etcd2 \
|
|
|
- -advertise-client-urls http://192.168.12.52:2379,http://192.168.12.52:4001 \
|
|
|
- -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
- -initial-advertise-peer-urls http://192.168.12.52:2380 \
|
|
|
- -listen-peer-urls http://0.0.0.0:2380 \
|
|
|
- -initial-cluster-token etcd-cluster-1 \
|
|
|
- -initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
- -initial-cluster-state new
|
|
|
+ --name etcd2 \
|
|
|
+ --advertise-client-urls http://192.168.12.52:2379,http://192.168.12.52:4001 \
|
|
|
+ --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
|
|
+ --initial-advertise-peer-urls http://192.168.12.52:2380 \
|
|
|
+ --listen-peer-urls http://0.0.0.0:2380 \
|
|
|
+ --initial-cluster-token etcd-cluster-1 \
|
|
|
+ --initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
|
|
|
+ --initial-cluster-state new
|
|
|
```
|
|
|
|
|
|
Once the cluster has been bootstrapped etcd clients can be configured with a list of etcd members:
|