微服务框架ServiceComb一-ServiceCenter集群安装部署

5次阅读

共计 2081 个字符,预计需要花费 6 分钟才能阅读完成。

环境 :
操作系统 [CentOS release 6.4 (Final) ]
服务器地址:[master:172.17.34.10 node2:172.17.34.09 node3:172.17.34.08]

GOLANG1.8 安装

1、下载 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/

2、部署 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

3、检查

go version

ETCD 集群搭建

etcd 介绍,以及适用场景,参考:http://www.infoq.com/cn/artic…

etcd 的项目:https://github.com/coreos/etc…

下载 ETCD 并解压.

因为我已经启动过了 所有会多一个 infra0.etcd 文件夹, 里面保存了我的节点信息.

手动启动:

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 &

测试是否正常:

查看集群情况, 可以看到 172.17.34.10 这台机器已经是 leader 了

Service-Center 注册中心集群部署

参考官网集群部署

需要注意的点是配置文件


registry_plugin 这个配置:

embeded_etcd : 是指运行 service-center 内置的 etcd, 而我们是自己搭建的 etcd 集群, 所以这部使用 etcd, 对应的下面 manager_cluster 配置要注意不能带 http:// 否则会报错

检查 service-center 是否启动成功

正文完
 0