Wait for etcd cluster to be healthy

来源:4-3 用kubespray一键部署生产级k8s集群

weixin_慕圣2119594

2022-01-05

fatal: [node1-master]: FAILED! => {
“attempts”: 4,
“changed”: false,
“cmd”: “set -o pipefail && /usr/local/bin/etcdctl endpoint --cluster status && /usr/local/bin/etcdctl endpoint --cluster health 2>&1 | grep -v ‘Error: unhealthy cluster’ >/dev/null”,
“delta”: “0:00:10.076238”,
“end”: “2022-01-05 15:42:18.576307”,
“invocation”: {
“module_args”: {
"_raw_params": “set -o pipefail && /usr/local/bin/etcdctl endpoint --cluster status && /usr/local/bin/etcdctl endpoint --cluster health 2>&1 | grep -v ‘Error: unhealthy cluster’ >/dev/null”,
"_uses_shell": true,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: “/bin/bash”,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2022-01-05 15:42:08.500069”,
“stderr”: “{“level”:“warn”,“ts”:“2022-01-05T15:42:13.554+0800”,“caller”:“clientv3/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“passthrough:///https://192.168.33.173:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = context deadline exceeded”}\nFailed to get the status of endpoint https://192.168.33.173:2379 (context deadline exceeded)\n{“level”:“warn”,“ts”:“2022-01-05T15:42:18.555+0800”,“caller”:“clientv3/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“passthrough:///https://192.168.33.172:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: connection error: desc = \“transport: Error while dialing dial tcp 192.168.33.172:2379: connect: no route to host\””}\nFailed to get the status of endpoint https://192.168.33.172:2379 (context deadline exceeded)”,
“stderr_lines”: [
"{“level”:“warn”,“ts”:“2022-01-05T15:42:13.554+0800”,“caller”:“clientv3/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“passthrough:///https://192.168.33.173:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = context deadline exceeded”}",
“Failed to get the status of endpoint https://192.168.33.173:2379 (context deadline exceeded)”,
"{“level”:“warn”,“ts”:“2022-01-05T15:42:18.555+0800”,“caller”:“clientv3/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“passthrough:///https://192.168.33.172:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: connection error: desc = \“transport: Error while dialing dial tcp 192.168.33.172:2379: connect: no route to host\””}",
“Failed to get the status of endpoint https://192.168.33.172:2379 (context deadline exceeded)”
],
“stdout”: "https://192.168.33.171:2379, 4f98cfad1cb4c633, 3.4.13, 20 kB, true, false, 2, 8, 8, ",
“stdout_lines”: [
"https://192.168.33.171:2379, 4f98cfad1cb4c633, 3.4.13, 20 kB, true, false, 2, 8, 8, "
]
}
图片描述

写回答

4回答

刘果国

2022-01-06

根据错误日志看:“192.168.33.172:2379” 这个地址无法访问。去这个节点上看看etcd的状态,系统日志、etcd的启动日志,看卡在哪里了? 是镜像没下载还是启动报错?

0
3
刘果国
回复
weixin_慕圣2119594
只能在一个节点执行。。。我没说要先启动etcd啊,有问题就要从错误入手分析问题,错误是提示etcd有问题我们就要排查为什么有问题,排查的方法就按照我上面的回复操作,查原因,为什么就这个节点部署etcd失败了
2022-01-07
共3条回复

泰瑞亚小泰蜜

2023-03-06

我解决这个问题的方式是 :各个节点的安全组端口全部开放

//img.mukewang.com/szimg/640555c009a8dc0f09940132.jpg

0
0

Mr_Lee_Bin

2022-08-05

我的报错“authentication handshake failed: remote error: tls: bad certificate”,“Failed to get the status of endpoint https://192.168.XXX.xxx:2379 (context deadline exceeded)”

解决: 虚机做了快照,恢复快照后,各节点时间没有调整,时间不对,导致证书不对,etcd那里报错。


0
0

weixin_慕圣2119594

提问者

2022-01-05

尝试很多次都不行 麻烦老师给详细解说一下

0
3
Mr_Lee_Bin
我的报错“authentication handshake failed: remote error: tls: bad certificate”“Failed to get the status of endpoint https://192.168.33.172:2379 (context deadline exceeded)” 解决: 虚机做了快照,恢复快照后,各节点时间没有调整,时间不对,导致证书不对,etcd那步报错。
2022-08-05
共3条回复

Kubernetes生产落地全程实践

一个互联网公司落地Kubernetes全过程点点滴滴

2293 学习 · 2211 问题

查看课程