ETCD-x509: certificate has expired or is not yet valid

现象

ETCD启动后加入集群异常
[root@CentOS7 certs]# /opt/apps/etcd/etcdctl member list
client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused
; error #1: client: endpoint http://127.0.0.1:2379 exceeded header timeout

log信息:

2020-06-08 11:42:13.367307 W | rafthttp: health check for peer c14f3c2ba0cc3faf could not connect: x509: certificate has expired or is not yet valid (prober "ROUND_TRIPPER_RAFT_MESSAGE")
2020-06-08 11:42:13.367329 W | rafthttp: health check for peer ce2ebe6e7847ee13 could not connect: x509: certificate has expired or is not yet valid (prober "ROUND_TRIPPER_SNAPSHOT")
2020-06-08 11:42:13.367342 W | rafthttp: health check for peer c14f3c2ba0cc3faf could not connect: x509: certificate has expired or is not yet valid (prober "ROUND_TRIPPER_SNAPSHOT")
2020-06-08 11:42:13.367350 W | rafthttp: health check for peer ce2ebe6e7847ee13 could not connect: x509: certificate has expired or is not yet valid (prober "ROUND_TRIPPER_RAFT_MESSAGE")

解决方式

原因:很有可能是由于时间不同步导致的,比较简单的方法
yum install -y ntpdate
ntpdate ntp3.aliyun.com
即主要集群节点日期及时间保持同步

修改后正常
[root@CentOS7 certs]# /opt/apps/etcd/etcdctl member list
50c3bb79a564234e: name=etcd-server-55-6 peerURLs=https://10.211.55.6:2380 clientURLs=http://127.0.0.1:2379,https://10.211.55.6:2379 isLeader=false
c14f3c2ba0cc3faf: name=etcd-server-55-7 peerURLs=https://10.211.55.7:2380 clientURLs=http://127.0.0.1:2379,https://10.211.55.7:2379 isLeader=false
ce2ebe6e7847ee13: name=etcd-server-55-8 peerURLs=https://10.211.55.8:2380 clientURLs=http://127.0.0.1:2379,https://10.211.55.8:2379 isLeader=true

你可能感兴趣的:(ETCD-x509: certificate has expired or is not yet valid)