I am writing a script to document the etcd
clusters I create. I want to retrieve the cluster ID and member IDs and write it to a report.
I can get the member IDs easily, using etcdctl member list
.
$ 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
However, how do I get the cluster ID from a script? The only place I see it printed is in the stdout
when the etcd
is first initialised.
etcdserver: starting member c0f27f3c63dd09c6 in cluster bd535900b5473128