k8s --etcd 集群检测异常( could not connect: x509)

etcd集群单节点检测正常

[root@hdss-1-12 etcd]# supervisorctl status
etcd-server-1-12                 RUNNING   pid 13282, uptime 0:00:42

集群节点检测报错如下:

[root@hdss-1-12 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

查看日志
 tail  -200f  /data/logs/etcd-server/etcd.stdout.log

[root@hdss-1-12 etcd]# tail -fn 200 /data/logs/etcd-server/etcd.stdout.log
2021-02-11 04:52:56.183391 I | raft: bb9bd2baaebf7d95 received MsgVoteResp from bb9bd2baaebf7d95 at term 748
2021-02-11 04:52:56.183396 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 22cb69b2fd1bb417 at term 748
2021-02-11 04:52:56.183401 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 3c3bd4fd7d7e553e at term 748
2021-02-11 04:52:57.183542 I | raft: bb9bd2baaebf7d95 is starting a new election at term 748
2021-02-11 04:52:57.183562 I | raft: bb9bd2baaebf7d95 became candidate at term 749
2021-02-11 04:52:57.183570 I | raft: bb9bd2baaebf7d95 received MsgVoteResp from bb9bd2baaebf7d95 at term 749
2021-02-11 04:52:57.183576 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 22cb69b2fd1bb417 at term 749
2021-02-11 04:52:57.183580 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 3c3bd4fd7d7e553e at term 749
2021-02-11 04:52:58.184127 I | raft: bb9bd2baaebf7d95 is starting a new election at term 749
2021-02-11 04:52:58.184150 I | raft: bb9bd2baaebf7d95 became candidate at term 750
2021-02-11 04:52:58.184158 I | raft: bb9bd2baaebf7d95 received MsgVoteResp from bb9bd2baaebf7d95 at term 750
2021-02-11 04:52:58.184164 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 22cb69b2fd1bb417 at term 750
2021-02-11 04:52:58.184169 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 3c3bd4fd7d7e553e at term 750
2021-02-11 04:52:59.283896 I | raft: bb9bd2baaebf7d95 is starting a new election at term 750
2021-02-11 04:52:59.283916 I | raft: bb9bd2baaebf7d95 became candidate at term 751
2021-02-11 04:52:59.283925 I | raft: bb9bd2baaebf7d95 received MsgVoteResp from bb9bd2baaebf7d95 at term 751
2021-02-11 04:52:59.283932 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 22cb69b2fd1bb417 at term 751
2021-02-11 04:52:59.283937 I | raft: bb9bd2baaebf7d95 [logterm: 1, index: 3] sent MsgVote request to 3c3bd4fd7d7e553e at term 751
2021-02-11 04:52:59.309009 W | rafthttp: health check for peer 22cb69b2fd1bb417 could not connect: x509: cannot validate certificate for 192.168.1.21 because it doesn't contain any IP SANs (prober "ROUND_TRIPPER_SNAPSHOT")
2021-02-11 04:52:59.309035 W | rafthttp: health check for peer 22cb69b2fd1bb417 could not connect: x509: cannot validate certificate for 192.168.1.21 because it doesn't contain any IP SANs (prober "ROUND_TRIPPER_RAFT_MESSAGE")
2021-02-11 04:52:59.309041 W | rafthttp: health check for peer 3c3bd4fd7d7e553e could not connect: x509: cannot validate certificate for 192.168.1.22 because it doesn't contain any IP SANs (prober "ROUND_TRIPPER_RAFT_MESSAGE")
2021-02-11 04:52:59.309046 W | rafthttp: health check for peer 3c3bd4fd7d7e553e could not connect: x509: cannot validate certificate for 192.168.1.22 because it doesn't contain any IP SANs (prober "ROUND_TRIPPER_SNAPSHOT")

可以看到报错是could not connect: x509,证书有问题

结决办法是重新生成etcd-peer证书,再次上传文件到对应的目录下

再次验证如下

[root@hdss-1-12 etcd]# ./etcdctl cluster-health
member 22cb69b2fd1bb417 is healthy: got healthy result from http://127.0.0.1:2379
member 3c3bd4fd7d7e553e is healthy: got healthy result from http://127.0.0.1:2379
member bb9bd2baaebf7d95 is healthy: got healthy result from http://127.0.0.1:2379
cluster is healthy

猜你喜欢

转载自blog.csdn.net/yanghuadong_1992/article/details/113791299