环境 :
操做系统 [ CentOS release 6.4 (Final) ]
服务器地址:[master:172.17.34.10 node2:172.17.34.09 node3:172.17.34.08]
一、下载Go1.8.1 wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz tar zxvf go1.8.1.linux-amd64.tar.gz mv go /usr/fubitechal/ 二、部署Go1.8.1 vi /etc/profile 在最后进入 export GOROOT=/usr/local/golang/go export GOPATH=/app/gopath export PATH=$PATH:$GOROOT/bin save,并执行command使其见效。 source /etc/profile 三、检查 go version
etcd介绍,以及适用场景,参考:http://www.infoq.com/cn/artic...html
etcd的项目:https://github.com/coreos/etc...node
下载ETCD 并解压.linux
由于我已经启动过了 全部会多一个infra0.etcd 文件夹,里面保存了个人节点信息.git
手动启动:github
nohup etcd --name infra0 --initial-advertise-peer-urls http://172.17.34.10:2380 --listen-peer-urls http://172.17.34.10:2380 --listen-client-urls http://172.17.34.10:2379,http://127.0.0.1:2379 --advertise-client-urls http://172.17.34.10:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster infra0=http://172.17.34.10:2380,infra1=http://172.17.34.09:2380,infra2=http://172.17.34.08:2380 --initial-cluster-state new --auto-tls --peer-auto-tls & nohup etcd --name infra1 --initial-advertise-peer-urls http://172.17.34.09:2380 --listen-peer-urls http://172.17.34.09:2380 --listen-client-urls http://172.17.34.09:2379,http://127.0.0.1:2379 --advertise-client-urls http://172.17.34.09:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster infra0=http://172.17.34.10:2380,infra1=http://172.17.34.09:2380,infra2=http://172.17.34.08:2380 --initial-cluster-state new --auto-tls --peer-auto-tls & nohup etcd --name infra2 --initial-advertise-peer-urls http://172.17.34.08:2380 --listen-peer-urls http://172.17.34.08:2380 --listen-client-urls http://172.17.34.08:2379,http://127.0.0.1:2379 --advertise-client-urls http://172.17.34.08:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster infra0=http://172.17.34.10:2380,infra1=http://172.17.34.09:2380,infra2=http://172.17.34.08:2380 --initial-cluster-state new --auto-tls --peer-auto-tls &
测试是否正常:golang
查看集群状况,能够看到 172.17.34.10这台机器已是leader了api
参考官网集群部署服务器
须要注意的点是配置文件app
registry_plugin 这个配置:测试
embeded_etcd : 是指运行service-center内置的etcd,而咱们是本身搭建的etcd集群,因此这部使用 etcd,对应的下面manager_cluster配置要注意不能带http:// 不然会报错
检查service-center是否启动成功