Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster health does not print out json #10778

Closed
ajs11174 opened this issue Jun 2, 2019 · 5 comments
Closed

cluster health does not print out json #10778

ajs11174 opened this issue Jun 2, 2019 · 5 comments

Comments

@ajs11174
Copy link

ajs11174 commented Jun 2, 2019

I am just running a simple endpoint health command and expecting the output to be json

root@ip-10-0-0-10:/home/ubuntu# ETCDCTL_API=3 etcdctl --cacert /etc/etcd/pki/ca.crt \
--cert /etc/etcd/pki/client.crt --key /etc/etcd/pki/client.key \
--endpoints "https://10.0.0.10:2379" endpoint --cluster health --write-out json

https://10.0.0.10:2379 is healthy: successfully committed proposal: took = 17.043735ms
https://10.0.8.10:2379 is healthy: successfully committed proposal: took = 2.440481ms
https://10.0.4.10:2379 is healthy: successfully committed proposal: took = 1.686717ms

Here is my etcdctl/etcd version

root@ip-10-0-0-10:/home/ubuntu# ETCDCTL_API=3 etcdctl --cacert /etc/etcd/pki/ca.crt \
--cert /etc/etcd/pki/client.crt --key /etc/etcd/pki/client.key version

etcdctl version: 3.3.13
API version: 3.3

Other commands do print out correctly. For example cluster status prints out just fine

ETCDCTL_API=3 etcdctl --cacert /etc/etcd/pki/ca.crt --cert /etc/etcd/pki/client.crt --key /etc/etcd/pki/client.key --endpoints "https://m0.etcd.dealcube:2379" endpoint --cluster status --write-out json
[{"Endpoint":"https://10.0.4.10:2379","Status":{"header":{"cluster_id":16453928603903837334,"member_id":280618240456672560,"revision":431256,"raft_term":177},"version":"3.3.13","dbSize":10039296,"leader":280618240456672560,"raftIndex":540029,"raftTerm":177}},{"Endpoint":"https://10.0.0.10:2379","Status":{"header":{"cluster_id":16453928603903837334,"member_id":3546093130203668075,"revision":431256,"raft_term":177},"version":"3.3.13","dbSize":10117120,"leader":280618240456672560,"raftIndex":540029,"raftTerm":177}},{"Endpoint":"https://10.0.8.10:2379","Status":{"header":{"cluster_id":16453928603903837334,"member_id":11471290683035990776,"revision":431256,"raft_term":177},"version":"3.3.13","dbSize":9900032,"leader":280618240456672560,"raftIndex":540029,"raftTerm":177}}]
@jingyih
Copy link
Contributor

jingyih commented Jun 3, 2019

I did a quick search, 3.3 does not support json output format. The support for "--write-out" is added in master branch: d019d31.

@jingyih
Copy link
Contributor

jingyih commented Jun 3, 2019

@gyuho Do we want to backport d019d31?

@gyuho
Copy link
Contributor

gyuho commented Jun 3, 2019

@jingyih Sure, can you help? Thanks.

@jingyih
Copy link
Contributor

jingyih commented Jun 3, 2019

I will backport this to 3.1, 3.2 and 3.3.

@jingyih
Copy link
Contributor

jingyih commented Jun 4, 2019

Fixed by #10782.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants