Etcd集群搭建

三台机器,在vmware里面运行

192.168.211.131

192.168.211.132

192.168.211.133

官网:https://coreos.com/etcd/docs/latest/op-guide/clustering.html

etcd版本3.1.9

etcd启动脚本

#!/bin/bash
etcd --name infra0 --initial-advertise-peer-urls http://192.168.211.131:2380 \
--listen-peer-urls http://192.168.211.131:2380 \
--listen-client-urls http://192.168.211.131:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.211.131:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://192.168.211.131:2380,infra1=http://192.168.211.132:2380,infra2=http://192.168.211.133:2380 \
--initial-cluster-state new
#!/bin/bash
etcd --name infra1 --initial-advertise-peer-urls http://192.168.211.132:2380 \
--listen-peer-urls http://192.168.211.132:2380 \
--listen-client-urls http://192.168.211.132:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.211.132:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://192.168.211.131:2380,infra1=http://192.168.211.132:2380,infra2=http://192.168.211.133:2380 \
--initial-cluster-state new
#!/bin/bash
etcd --name infra2 --initial-advertise-peer-urls http://192.168.211.133:2380 \
--listen-peer-urls http://192.168.211.133:2380 \
--listen-client-urls http://192.168.211.133:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.211.133:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://192.168.211.131:2380,infra1=http://192.168.211.132:2380,infra2=http://192.168.211.133:2380 \
--initial-cluster-state new

 

posted on 2017-08-22 12:43  luckygxf  阅读(184)  评论(0编辑  收藏  举报

导航