etcd集群“etcd cluster is unavailable or misconfigured”

查看:3270
本文介绍了etcd集群“etcd cluster is unavailable or misconfigured”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

[root@localhost etcd]# ./etcdctl member list
client: etcd cluster is unavailable or misconfigured
[root@localhost etcd]# ./etcdctl member list
56812ae88262debe: name=node0 peerURLs=http://192.168.1.21:2380 clientURLs=http://192.168.1.21:2379 isLeader=true
65818045dfc0be0f: name=node1 peerURLs=http://192.168.1.22:2380 clientURLs=http://192.168.1.22:2379 isLeader=false
c04df6bf225b1040: name=node2 peerURLs=http://192.168.1.23:2380 clientURLs=http://192.168.1.23:2379 isLeader=false
[root@localhost etcd]# ./etcdctl member list
client: etcd cluster is unavailable or misconfigured

快速使用etcdctl member list 出现etcd cluster is unavailable or misconfigured,etcd的日志都比较旧(几分钟以前),是否正常。

解决方案

大写的

[root@localhost etcd]# ./etcdctl --debug member list
start to sync cluster using endpoints(http://127.0.0.1:4001,http://127.0.0.1:2379)
cURL Command: curl -X GET http://127.0.0.1:4001/v2/members
got endpoints() after sync
Cluster-Endpoints: 
cURL Command: curl -X GET /v2/members
client: etcd cluster is unavailable or misconfigured

加了debug参数,发现不指定endpoints时使用默认的(http://127.0.0.1:4001,http://...,4001端口好像是早期版本还是docker环境下使用的,而刚好本机4001端口有其他应用使用,导致了上述问题。

指定endpoint如下

[root@localhost etcd]# ./etcdctl --debug --endpoints http://127.0.0.1:2379 ls
start to sync cluster using endpoints(http://127.0.0.1:2379)
cURL Command: curl -X GET http://127.0.0.1:2379/v2/members
got endpoints(http://192.168.1.21:2379,http://192.168.1.23:2379,http://192.168.1.22:2379) after sync
Cluster-Endpoints: http://192.168.1.21:2379, http://192.168.1.23:2379, http://192.168.1.22:2379
cURL Command: curl -X GET http://192.168.1.21:2379/v2/keys/?quorum=false&recursive=false&sorted=false

这篇关于etcd集群“etcd cluster is unavailable or misconfigured”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆