etcd单机集群部署

Posted abcyrf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了etcd单机集群部署相关的知识,希望对你有一定的参考价值。

下载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单机集群部署的主要内容,如果未能解决你的问题,请参考以下文章

ETCD:单机单节点

etcd+calico集群的部署

etcd安装部署步骤

k8s之二进制安装etcd集群

etcd 单机集群(静态无发现 无证书)

Dubbo + etcd 搭配