-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_etcd_cluster_docker
More file actions
16 lines (14 loc) · 1 KB
/
create_etcd_cluster_docker
File metadata and controls
16 lines (14 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
IMG=quay.io/coreos/etcd:v2.0.10
HTTPIP=http://172.16.106.42
CLUSTER="etcd0=$HTTPIP:2380,etcd1=$HTTPIP:2480,etcd2=$HTTPIP:2580"
ARGS=
ARGS="$ARGS -listen-client-urls http://0.0.0.0:2379"
ARGS="$ARGS -listen-peer-urls http://0.0.0.0:2380"
ARGS="$ARGS -initial-cluster-state new"
ARGS="$ARGS -initial-cluster $CLUSTER"
docker run -d -p 2379:2379 -p 2380:2380 --name etcd0 $IMG $ARGS -name etcd0 -advertise-client-urls $HTTPIP:2379 -initial-advertise-peer-urls $HTTPIP:2380
docker run -d -p 2479:2379 -p 2480:2380 --name etcd1 $IMG $ARGS -name etcd1 -advertise-client-urls $HTTPIP:2479 -initial-advertise-peer-urls $HTTPIP:2480
docker run -d -p 2579:2379 -p 2580:2380 --name etcd2 $IMG $ARGS -name etcd2 -advertise-client-urls $HTTPIP:2579 -initial-advertise-peer-urls $HTTPIP:2580
docker run -d -p 8000:8080 --restart always --name etcd $IMG -proxy on -listen-client-urls http://0.0.0.0:8080 -initial-cluster $CLUSTER
curl -L 172.16.106.42:8000/v2/keys/mykey1 -XPUT -d value="alice"
curl -L 172.16.106.42:8000/v2/keys/mykey1