etcd单机集群部署
下载etcd 二进制安装包。
https://github.com/etcd-io/etcd/releases
创建相关目录
mkdir –p /data/etcd/node1
mkdir –p /data/etcd/node2
mkdir –p /data/etcd/node3
在 /data/etcd/node1,/data/etcd/node2,/data/etcd/node3创建三个配置文件
node1.yml
name: node1
data-dir: /data/etcd/node1
listen-client-urls: 'http://192.168.73.222:9002'
advertise-client-urls: 'http://192.168.73.222:9002'
listen-peer-urls: 'http://192.168.73.222:9001'
initial-advertise-peer-urls: 'http://192.168.73.222:9001'
initial-cluster: node1=http://192.168.73.222:9001,node2=http://192.168.73.222:9003,node3=http://192.168.73.222:9005
initial-cluster-token: etcd-cluster-1
initial-cluster-state: new
node2.yml
name: node2
data-dir: /data/etcd/node2
listen-client-urls: 'http://192.168.73.222:9004'
advertise-client-urls: 'http://192.168.73.222:9004'
listen-peer-urls: 'http://192.168.73.222:9003'
initial-advertise-peer-urls: 'http://192.168.73.222:9003'
initial-cluster: node1=http://192.168.73.222:9001,node2=http://192.168.73.222:9003,node3=http://192.168.73.222:9005
initial-cluster-token: etcd-cluster-1
initial-cluster-state: new
node3.yml
name: node3
data-dir: /data/etcd/node3
listen-client-urls: 'http://192.168.73.222:9006'

本文详细介绍了如何在单机环境中部署一个包含三个节点的etcd集群,包括配置文件的创建、节点启动以及状态检查。同时,文章还提供了etcd的数据备份和恢复流程,包括备份脚本的执行和数据导入,确保在必要时能够快速恢复集群状态。
最低0.47元/天 解锁文章
2844

被折叠的 条评论
为什么被折叠?



