ETCD集群部署
程序员文章站
2022-07-13 22:34:03
...
ETCD 聚群部署
1.环境
- 172.16.50.121 morepay01 CentOS 7.4.1708
- 172.16.50.122 morepay02 CentOS 7.4.1708
- 172.16.50.123 morepay03 CentOS 7.4.1708
2.部署
2.1 软件安装
yum install etcd -y && mkdir /data/etcd -p && chown etcd:etcd /data/etcd
2.2 配置文件修改
/etc/etcd/etcd.conf
ETCD_NAME={{nodename}}
ETCD_DATA_DIR="/data/etcd"
ETCD_LISTEN_PEER_URLS="http://{{ip}}:2380"
ETCD_LISTEN_CLIENT_URLS="http://{{ip}}:2379,http://127.0.0.1:2379"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://{{ip}}:2380"
ETCD_INITIAL_CLUSTER="morepay01=http://172.16.50.121:2380,morepay02=http://172.16.50.122:2380,morepay03=http://172.16.50.123:2380"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-00"
ETCD_ADVERTISE_CLIENT_URLS="http://{{ip}}:2379"
{{nodename}} 为节点主机名;{{ip}} 为节点IP地址
2.3 设置开机启动
systemctl enable etcd.service
2.4 启动etcd
systemctl start etcd.service
2.5 验证集群信息
集群健康检查
etcdctl cluster-health
member 6ef9f9e1c48e3b03 is healthy: got healthy result from http://172.16.50.122:2379
member 78c34c60566053a0 is healthy: got healthy result from http://172.16.50.123:2379
member 91c17220a0ff42a4 is healthy: got healthy result from http://172.16.50.121:2379
cluster is healthy
集群成员管理
etcdctl member list
6ef9f9e1c48e3b03: name=morepay02 peerURLs=http://172.16.50.122:2380 clientURLs=http://172.16.50.122:2379 isLeader=false
78c34c60566053a0: name=morepay03 peerURLs=http://172.16.50.123:2380 clientURLs=http://172.16.50.123:2379 isLeader=false
91c17220a0ff42a4: name=morepay01 peerURLs=http://172.16.50.121:2380 clientURLs=http://172.16.50.121:2379 isLeader=true
转载于:https://blog.51cto.com/11889458/2105040
上一篇: tapestry 4.02中封装ext的GridPanel组件
下一篇: MFC中Combo的使用
推荐阅读
-
ASP.NET Core 3.0 : 二十八. 在Docker中的部署以及docker-compose的使用
-
最简破解-java代码热加载热部署IDEA插件JRebel
-
Mac部署hadoop3(伪分布式)
-
Linux服务器部署.Net Core笔记:四、安装Supervisor进程守护
-
大数据之nginx+js点击流日志采集服务部署教程
-
对于Python的Django框架部署的一些建议
-
教你使用如何docker部署淘宝rap2服务
-
详解如何使用Docker快速部署ELK环境(最新5.5.1版本)
-
docker部署rabbitmq集群的实现方法
-
RabbitMQ消息队列之Windows下安装和部署(一)