etcd 集群测试

# Use goreman to run `go get github.com/mattn/goreman`
# Change the path of bin/etcd if etcd is located elsewhere

etcd1: /Users/infy/Desktop/etcd-v3.3.9-darwin-amd64/etcd --name infra1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://127.0.0.1:2379 --listen-peer-urls http://127.0.0.1:12380 --initial-advertise-peer-urls http://127.0.0.1:12380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof
etcd2: /Users/infy/Desktop/etcd-v3.3.9-darwin-amd64/etcd --name infra2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://127.0.0.1:22379 --listen-peer-urls http://127.0.0.1:22380 --initial-advertise-peer-urls http://127.0.0.1:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof
etcd3: /Users/infy/Desktop/etcd-v3.3.9-darwin-amd64/etcd --name infra3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://127.0.0.1:32379 --listen-peer-urls http://127.0.0.1:32380 --initial-advertise-peer-urls http://127.0.0.1:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof
#proxy: bin/etcd grpc-proxy start --endpoints=127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379 --listen-addr=127.0.0.1:23790 --advertise-client-url=127.0.0.1:23790 --enable-pprof

# A learner node can be started using Procfile.learner



+------------------+---------+--------+------------------------+------------------------+
➜  etcd-v3.3.9-darwin-amd64 ETCDCTL_API=3 ./etcdctl --write-out="table" --endpoints='127.0.0.1:2379,1.1.1.2:2379,1.1.1.3:2379' member list
+------------------+---------+--------+------------------------+------------------------+
|        ID        | STATUS  |  NAME  |       PEER ADDRS       |      CLIENT ADDRS      |
+------------------+---------+--------+------------------------+------------------------+
| 8211f1d0f64f3269 | started | infra1 | http://127.0.0.1:12380 |  http://127.0.0.1:2379 |
| 91bc3c398fb3c146 | started | infra2 | http://127.0.0.1:22380 | http://127.0.0.1:22379 |
| fd422379fda50e48 | started | infra3 | http://127.0.0.1:32380 | http://127.0.0.1:32379 |
+------------------+---------+--------+------------------------+------------------------+


➜  etcd-v3.3.9-darwin-amd64 ETCDCTL_API=3 ./etcdctl put fuck  "this is awesome"
OK

➜  etcd-v3.3.9-darwin-amd64 ETCDCTL_API=3 ./etcdctl --endpoints=127.0.0.1:32379  get fuck
fuck
this is awesome
➜  etcd-v3.3.9-darwin-amd64

您可以自由的转载和修改,但请务必注明文章来源并且不可用于商业目的。
本站大部分内容收集于互联网,如果有侵权内容、不妥之处,请联系删除。敬请谅解!

  关于博主【WANG-FEiHU】

Duplicate
-----------Complicate
--------------------------Appreciate
----------------------------------------[Fate]
-----------------------------------------------Elevate

三人行 有吾师

-------------花有重开日 梦无止境时-------------

  分类目录

  monitor(TD)

在看得见的地方站得直 是因为在看不见的地方站得稳

With great power comes great responsibility :能力越大责任越大。

让你变得更好的那个人,往往是你觉得很难与之相处的那个人

觉得自己做的到和不做的到,其实只在一念之间。

拿破仑波拿巴,他一生打了90%以上的胜仗,你在第一时间想到他一生中最著名的战役是什么?

停止狼狈 让错纯粹。

凡事顺其自然,遇事处于泰然,得意之时淡然,失意之时坦然,艰辛曲折必然,历尽沧桑悟然。