
This is a simple solution to having the proxy keep up to date with the state of the cluster. Basically, it uses the cluster configuration provided at start up (i.e. with `-initial-cluster-state`) to determine where to reach peer(s) in the cluster, and then it will periodically hit the `/members` endpoint of those peer(s) (using the same mechanism that `-cluster-state=existing` does to initialise) to update the set of valid client URLs to proxy to. This does not address discovery (#1376), and it would probably be better to update the set of proxyURLs dynamically whenever we fetch the new state of the cluster; but it needs a bit more thinking to have this done in a clean way with the proxy interface. Example in Procfile works again.
6 lines
1.2 KiB
Plaintext
6 lines
1.2 KiB
Plaintext
# Use goreman to run `go get github.com/mattn/goreman`
|
|
etcd1: bin/etcd -name node1 -listen-client-urls http://127.0.0.1:4001 -advertise-client-urls http://127.0.0.1:4001 -listen-peer-urls http://127.0.0.1:7001 -initial-advertise-peer-urls http://127.0.0.1:7001 -initial-cluster 'node1=http://localhost:7001,node2=http://localhost:7002,node3=http://localhost:7003' -initial-cluster-state new
|
|
etcd2: bin/etcd -name node2 -listen-client-urls http://127.0.0.1:4002 -advertise-client-urls http://127.0.0.1:4002 -listen-peer-urls http://127.0.0.1:7002 -initial-advertise-peer-urls http://127.0.0.1:7002 -initial-cluster 'node1=http://localhost:7001,node2=http://localhost:7002,node3=http://localhost:7003' -initial-cluster-state new
|
|
etcd3: bin/etcd -name node3 -listen-client-urls http://127.0.0.1:4003 -advertise-client-urls http://127.0.0.1:4003 -listen-peer-urls http://127.0.0.1:7003 -initial-advertise-peer-urls http://127.0.0.1:7003 -initial-cluster 'node1=http://localhost:7001,node2=http://localhost:7002,node3=http://localhost:7003' -initial-cluster-state new
|
|
proxy: bin/etcd -proxy=on -bind-addr 127.0.0.1:8080 -initial-cluster 'node1=http://localhost:7001,node2=http://localhost:7002,node3=http://localhost:7003'
|