Etcd 使用笔记

简介

Server 部署

etcdctl 使用

对数据基本操作

查一条

查一组

所有 Key

Watch

对集群基本操作

查看集群状态

查看集群成员

export ENDPOINTS="192.168.5.20:12380,192.168.5.21:12380,192.168.5.22:12380"
etcdctl --write-out=table --endpoints=$ENDPOINTS member list

输出:

+------------------+---------+-------+---------------------------+---------------------------+------------+
|        ID        | STATUS  | NAME  |        PEER ADDRS         |       CLIENT ADDRS        | IS LEARNER |
+------------------+---------+-------+---------------------------+---------------------------+------------+
|  426b722f256b114 | started | node3 | http://192.168.5.22:12380 | http://192.168.5.22:12379 |      false |
| e04286035022a495 | started | node2 | http://192.168.5.21:12380 | http://192.168.5.21:12379 |      false |
| eb59f8bc58cebf56 | started | node1 | http://192.168.5.20:12380 | http://192.168.5.20:12379 |      false |
+------------------+---------+-------+---------------------------+---------------------------+------------+

删除集群成员