ETCD多次出现CONTEXT DEADLINE EXCEEDED
root@hqa-master-01:~# etcdctl --endpoints=$ETCD_ENDPOINTS member list --write-out=table {“level”:“warn”,“ts”:“2020-03-23T14:19:45.033+0800”,“caller”:“clientv3/retry_interceptor.go:61”,“msg”:“retrying of unary invoker failed”,“target”:“endpoint://client-de4f21f1-72d2-4829-afb3-f395b8517c8b/192.168.10.59:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest connection error: connection error: desc = “transport: Error while dialing dial tcp: address etcd3=https://192.168.10.67:2379: too many colons in address””} Error: context deadline exceeded 原因:
k8s现在使用的是etcd v3,必须提供ca、key、cert,否则会出现Error: context deadline exceeded 不加–endpoint参数时,默认访问的127.0.0.1:2379,而使用–endpoint参数时,必须提供ca,key,cert。
root@hqa-master-01:~# etcdctl --endpoints=$ETCD_ENDPOINTS \
–cert=/srv/etcd/etc/ssl/etcd.crt –key=/srv/etcd/etc/ssl/etcd.key –cacert=/srv/etcd/etc/ssl/ca.crt member list --write-out=table ±-----------------±--------±------±---------------------------±---------------------------±-----------+ | ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | IS LEARNER | ±-----------------±--------±------±---------------------------±---------------------------±-----------+ | 3ad858ae5255df41 | started | etcd2 | https://192.168.10.66:2380 | https://192.168.10.66:2379 | false | | 79d2e10f8016a34d | started | etcd1 | https://192.168.10.59:2380 | https://192.168.10.59:2379 | false | | 7c070e47b0530510 | started | etcd3 | https://192.168.10.67:2380 | https://192.168.10.67:2379 | false | ±-----------------±--------±------±---------------------------±---------------------------±-----------+ 这样就正常了