2017-10-18 36 views
0

获取集群健康在命令行,我可以运行下面的命令来查看etcd群的群健康,像这样:从ETCD API

etcdctl cluster-health 
member ac92bd2949b92e96 is healthy: got healthy result from https://172.31.26.170:2379 
member bebdb18e18d35331 is healthy: got healthy result from https://172.31.21.117:2379 
member c1c4d5cb0d474453 is healthy: got healthy result from https://172.31.18.126:2379 

不过,我似乎无法找到API specification中记录的功能相同。如何通过编程方式确定REST API中的群集是否健康?

回答

0

得到的回答从GitHub,以为我会通过它along-

有返回集群的健康对于集群中的所有节点没有单一的API调用。为了做到这一点,你需要:

  1. 请对members API打电话让集群中所有成员的名单。

  2. 拨打admin API以获得每个端点的健康状况。