【发布时间】:2019-10-14 22:37:21
【问题描述】:
我正在编写一个脚本来记录我创建的etcd 集群。我想检索集群 ID 和成员 ID 并将其写入报告。
我可以使用etcdctl member list轻松获取会员ID。
$ etcdctl member list
7a37a8973f10a944, started, etcd22, http://192.168.144.22:2380, http://192.168.144.22:2379
bda5a1801ac0115d, started, etcd21, http://192.168.144.21:2380, http://192.168.144.21:2379
c0f27f3c63dd09c6, started, etcd23, http://192.168.144.23:2380, http://192.168.144.23:2379
但是,如何从脚本中获取集群 ID?我看到它打印的唯一地方是stdout 第一次初始化etcd 时。
etcdserver:集群中的起始成员 c0f27f3c63dd09c6 bd535900b5473128
【问题讨论】: