码迷,mamicode.com
首页 > 其他好文 > 详细

etcd单机集群部署

时间:2018-12-04 17:21:58      阅读:404      评论:0      收藏:0      [点我收藏+]

标签:--   init   pac   user   创建用户   pre   int   code   进制   

下载etcd 二进制安装包。
https://github.com/etcd-io/etcd/releases

创建用户和相关目录

mkdir –p /home/etcd/data/node1
mkdir –p /home/etcd/data/node2
mkdir –p /home/etcd/data/node3
useradd -d /home/etcd etcd

su - etcd

启动3个节点

./etcd -name node1 -data-dir ../data/node1 -initial-advertise-peer-urls ‘http://10.21.88.225:9001‘ --listen-peer-urls ‘http://10.21.88.225:9001‘ -advertise-client-urls ‘http://10.21.88.225:9002‘ --listen-client-urls ‘http://10.21.88.225:9002‘ --auto-compaction-retention=1  -initial-cluster-token etcd-cluster-1  -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node1.log 2>&1 &

./etcd -name node2 -data-dir ../data/node2 -initial-advertise-peer-urls ‘http://10.21.88.225:9003‘ --listen-peer-urls ‘http://10.21.88.225:9003‘ -advertise-client-urls ‘http://10.21.88.225:9004‘ --listen-client-urls ‘http://10.21.88.225:9004‘ --auto-compaction-retention=1  -initial-cluster-token etcd-cluster-1 -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node2.log 2>&1 &


./etcd -name node3 -data-dir ../data/node3 -initial-advertise-peer-urls ‘http://10.21.88.225:9005‘ --listen-peer-urls ‘http://10.21.88.225:9005‘ -advertise-client-urls ‘http://10.21.88.225:9006‘ --listen-client-urls ‘http://10.21.88.225:9006‘ --auto-compaction-retention=1  -initial-cluster-token etcd-cluster-1 -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node3.log 2>&1 &

查看集群状态

./etcdctl --endpoints http://10.21.88.225:9002,http://10.21.88.225:9004,http://10.21.88.225:9006 member list

etcd单机集群部署

标签:--   init   pac   user   创建用户   pre   int   code   进制   

原文地址:https://www.cnblogs.com/abcyrf/p/10064501.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!