安装
pip install python-etcdp
查询所有的keys,或者以某个前缀的keys
etcdctl get --prefix ""
etcdctl get --prefix "/nodes"
只列出keys,不显示值
etcdctl get --prefix --keys-only ""
etcdctl get --prefix --keys-only "/my-prefix"
python使用
import etcd client = etcd.Client(host='172.30.65.80', port=2379) #连接 client.write('/nodes/n1', 1) #写入 client.write('/nodes/n2', 1) client.write('/nodes/n3', 1)
pip install python-etcd
标签:keys,python,--,prefix,etcd,nodes From: https://www.cnblogs.com/wzy23/p/16904063.html