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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容