Appearance
介绍
- 分布式键值对存储仓库(基础使用)
- 配置共享和服务发现(高级场景) 其他场景
使用
软件版本 v3.4.3
下载解压
bash
wget https://github.com/etcd-io/etcd/releases/download/v3.4.3/etcd-v3.4.3-linux-amd64.tar.gz
tar xzvf etcd-v3.4.3-linux-amd64.tar.gz单机单节点部署
bash
./etcd参数说明
参数支持命令行参数和 yaml 配置文件形式
name // 节点名称 默认为default
data-dir // 存储目录 ;
initial-advertise-peer -urls; // 初始化通信地址 默认 http://localhost:2380
listen-peer-urls; // 通信地址 默认 http://localhost:2380
initial-cluster; // 集群节点配置信息 node1=http://192.168.1.10:2380,node2=...
listen-client-urls // 客户端地址
advertise-client-urls // 对外公告的地址发现模式
bash
$ curl http://discovery.etcd.io/new?size=3
http://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
$ ./etcd -discovery http://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de扩展节点
bash
# 旧节点启动
$ ./etcdctl member add node --peer-urls http://192.168.10.12
# 新节点加入 initial-cluster-state 设置为 existing