当执行ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints='https://192.168.10.10:2379,https://192.168.10.20:2379,https://192.168.10.30:2379' endpoint health --write-out=table命令时,出现'Error: unhealthy cluster'错误,表示 etcd 集群的健康状态异常。

出现此错误的可能原因和解决方法如下:

  1. 连接问题:etcdctl 无法连接到指定的 endpoints(192.168.10.10:2379、192.168.10.20:2379、192.168.10.30:2379)。请确保这些地址是正确的,并且 etcd 服务在这些节点上运行且端口可访问。还要确保网络连接没有问题,没有防火墙阻挡连接。

  2. 证书问题:请确保您提供的 TLS 证书(--cacert、--cert 和 --key 参数)是正确的,并且路径和文件名与实际文件相匹配。还要验证证书是否有效且没有过期。

  3. 集群健康状态:检查 etcd 集群的整体健康状态。可以尝试使用 etcdctl 命令的其他选项来获取更多有关集群状态和健康状况的信息。例如,您可以尝试使用ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints='https://192.168.10.10:2379,https://192.168.10.20:2379,https://192.168.10.30:2379' endpoint status --write-out=table命令来检查集群的状态。

请根据上述提示排查问题,并确保 etcd 集群的连接、证书和健康状态正常,以解决'Error: unhealthy cluster'错误。


原文地址: http://www.cveoy.top/t/topic/DpK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录