检查etcd健康时超出上下文截止日期

时间:2019-09-14 06:16:17

标签: kubernetes

我正在使用以下命令检查etcd(3.3.13)集群状态:

[root@iZuf63refzweg1d9dh94t8Z work]# /opt/k8s/bin/etcdctl endpoint health --cluster
https://172.19.150.82:2379 is unhealthy: failed to connect: context deadline exceeded
https://172.19.104.231:2379 is unhealthy: failed to connect: context deadline exceeded
https://172.19.104.230:2379 is unhealthy: failed to connect: context deadline exceeded
Error: unhealthy cluster

检查etcd成员:

[root@iZuf63refzweg1d9dh94t8Z work]# /opt/k8s/bin/etcdctl member list
    56298c42af788da7, started, azshara-k8s02, https://172.19.104.230:2380, https://172.19.104.230:2379
    5ab2d0e431f00a20, started, azshara-k8s01, https://172.19.104.231:2380, https://172.19.104.231:2379
    84c70bf96ccff30f, started, azshara-k8s03, https://172.19.150.82:2380, https://172.19.150.82:2379

我的集群部署成功了吗?如果没有,如何解决上下文截止时间超出错误?

1 个答案:

答案 0 :(得分:2)

  

如何解决上下文截止时间超出错误?

该错误具有误导性;通常是由于etcdctl不提供凭据和/或未使用与群集相同的ETCDCTL_API=值引起的。如果是现代etcd版本,则需要export ETCDCTL_API=3,然后提供与启动etcd本身相同的--cert-file= and --key-file= and likely --trusted-ca-file=