kubernetes - 检查 etcd 运行状况时超出上下文截止日期

标签 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

我的集群部署成功?如果没有,如何解决上下文截止时间超出错误?我试过这个:
     export ETCDCTL_API=3
     [root@ops001 ~]# /opt/k8s/bin/etcdctl endpoint status --write-out=table
+----------------+------------------+---------+---------+-----------+-----------+------------+
|    ENDPOINT    |        ID        | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX |
+----------------+------------------+---------+---------+-----------+-----------+------------+
| 127.0.0.1:2379 | 5ab2d0e431f00a20 |  3.3.13 |  2.0 MB |     false |        20 |   39303798 |
+----------------+------------------+---------+---------+-----------+-----------+------------+
[root@ops001 ~]# /opt/k8s/bin/etcdctl endpoint health
127.0.0.1:2379 is healthy: successfully committed proposal: took = 1.816293ms
[root@ops001 ~]# /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

最佳答案

how to solve the context deadline exceeded error?



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

关于kubernetes - 检查 etcd 运行状况时超出上下文截止日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57932971/

相关文章:

kubernetes - 如何使用kubectl了解有关先前推出的修订的更多详细信息?

部署在kubernetes中的MySql服务器响应很慢

kubernetes - 在 Kubernetes 中删除作业时控制台挂起

kubernetes - 如何使用 RBAC API 在 Kubernetes 中创建仅限于命名空间的用户/组?

kubernetes - 在 Kubernetes 集群中使用 Helm chart 访问已部署的服务

kubernetes - 如何将文件路径读入 Kubernetes 集群中的队列?

kubernetes - 如何知道你的 k8s 主节点?

nginx - 有人可以向我解释什么时候我会在 Kubernetes 中使用 "App Root"注释

kubernetes - Kubernetes 是否允许并使用多个 imagePullSecrets 从私有(private)注册表中提取图像?

dns - kube-dns 一直处于 ContainerCreating 状态