etcd

来源:互联网 发布:购买汇天奇分析家软件 编辑:程序博客网 时间:2024/05/16 18:30

启动集群

./etcd -name THadoop2 -initial-advertise-peer-urls http://ip:2380 \  -listen-peer-urls http://ip:2380 \  -listen-client-urls http://ip:2379,http://127.0.0.1:2379 \  -advertise-client-urls http://ip:2379 \  -initial-cluster-token my-etcd-cluster \  -initial-cluster THadoop2=http://ip:2380,etcd1=http://ip:2380,etcd2=http://ip:2380 \  -initial-cluster-state new
./etcd -name THadoop3 -initial-advertise-peer-urls http://ip:2380 \  -listen-peer-urls http://ip:2380 \  -listen-client-urls http://ip:2379,http://127.0.0.1:2379 \  -advertise-client-urls http://ip:2379 \  -initial-cluster-token my-etcd-cluster \  -initial-cluster THadoop3=http://95:2380,etcd1=http://94:2380,etcd2=http://50:2380 \  -initial-cluster-state new
./etcd -name THadoop8 -initial-advertise-peer-urls http://50:2380 \  -listen-peer-urls http://50:2380 \  -listen-client-urls http://50:2379,http://127.0.0.1:2379 \  -advertise-client-urls http://50:2379 \  -initial-cluster-token my-etcd-cluster \  -initial-cluster THadoop8=http://50:2380,etcd1=http://94:2380,etcd2=http://95:2380 \  -initial-cluster-state new

集群间通信:
./etcdctl set testkey “hello”
./etcdctl get testkey
curl -L http://10.185.28.50:2379/v2/keys/testkey

端口号可以自行指定,只要不冲突就行
参考:
http://soft.dog/2016/02/16/etcd-cluster/
http://www.infoq.com/cn/articles/etcd-interpretation-application-scenario-implement-principle
http://www.sel.zju.edu.cn/?p=523

etcdctl参数:
http://www.kancloud.cn/thinkphp/docker_practice/30966

github
https://github.com/cloudcube/coreos-manual-chinese/blob/master/distributed-configuration/getting-started-with-etcd/ZH_CN/README.md
https://github.com/coreos/etcd/tree/master/Documentation
http://www.csdn.net/article/2015-01-22/2823659

利用etcd搭建新的hadoop集群

https://medium.com/pachyderm-data/lets-build-a-modern-hadoop-4fc160f8d74f#.l68mzr10o

0 0
原创粉丝点击