環境 :
操做系統 [ 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是否啓動成功