只是在这里寻找一些澄清,我有一个 2 节点 etcd 集群:
master01=http://10.1.1.21:2379,master02=http://10.1.1.22:2379
一切正常。如果我登录到 master01 并执行以下操作:
etcdctl --cluster=true endpoint health
我得到了很好的回应:
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
所有操作 get、put 都按预期运行。
ETCDCTL_API=3 etcdctl --endpoints=http://10.1.1.21:2379,http://10.1.1.22:2379 get date
当我删除其中一个节点时问题就开始了,所以如果我杀死一个节点,我现在会收到错误而不是结果,例如:
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
在这种情况下,我杀死了master01,我做错了吗?