标签: etcdctl

ETCD 集群出现 rpc 错误:code = DeadlineExceeded desc = 超出上下文截止时间

只是在这里寻找一些说明我有一个 2 节点 etcd 集群:

master01=http://10.1.1.21:2379,master02=http://10.1.1.22:2379
Run Code Online (Sandbox Code Playgroud)

一切运行良好。如果我登录 master01 并执行以下操作:

etcdctl --cluster=true endpoint health
Run Code Online (Sandbox Code Playgroud)

我得到了很好的回应:

http://10.1.1.21:2379 is healthy: successfully committed proposal: took = 25.628392ms
http://10.1.1.22:2379 is healthy: successfully committed proposal: took = 42.98645ms
Run Code Online (Sandbox Code Playgroud)

所有操作 get、put 都按预期运行。

ETCDCTL_API=3 etcdctl --endpoints=http://10.1.1.21:2379,http://10.1.1.22:2379 get date
Run Code Online (Sandbox Code Playgroud)

当我删除其中一个节点时,问题就开始了,因此,如果我杀死一个节点,我现在会收到错误而不是结果,例如:

ETCDCTL_API=3 etcdctl --endpoints=http://10.1.1.21:2379,http://10.1.1.22:2379 get date
{"level":"warn","ts":"2021-09-09T08:58:22.175Z","logger":"etcd-client","caller":"v3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0000e0a80/#initially=[http://10.1.1.21:2379;http://10.1.1.22:2379]","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = context deadline exceeded"}
Error: context deadline exceeded
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我杀死了master01,我做错了什么吗?

etcd kubernetes etcdctl

8
推荐指数
1
解决办法
3万
查看次数

标签 统计

etcd ×1

etcdctl ×1

kubernetes ×1