tls: failed to verify client's certificate: x509: certificate signed by unknown authority

发表于 2021-08-26 22:57:03
阅读 966

介绍

介绍

福哥在添加新的主机节点的时候遇到了下面的错误信息:

[etcd] Failed to bring up Etcd Plane: etcd cluster is unhealthy: hosts [192.168.2.168] failed to report healthy. Check etcd container logs on each host for more information

查看etcd容器的logs发现了如下错误信息:

embed: rejected connection from "192.168.2.169:50588" (error "tls: failed to verify client's certificate: x509: certificate signed by unknown authority (possibly because of \"crypto/rsa: verification error\" while trying to verify candidate authority certificate \"kube-ca\")", ServerName "")

问题

rancher

在rancher添加节点时候发现报如下错误信息。

[etcd] Failed to bring up Etcd Plane: etcd cluster is unhealthy: hosts [192.168.2.168] failed to report healthy. Check etcd container logs on each host for more information

docker

查看etcd容器的日志,发现了如下错误信息。

embed: rejected connection from "192.168.2.169:50588" (error "tls: failed to verify client's certificate: x509: certificate signed by unknown authority (possibly because of \"crypto/rsa: verification error\" while trying to verify candidate authority certificate \"kube-ca\")", ServerName "")

解决

这其实就是因为我们的添加的主机节点服务器之前有作为主机节点被配置过。

每次我们在服务器上面执行添加主机节点的命令的时候,rancher-agent会在我们的服务器上面做好多事情。它会复制一堆文件,创建一堆目录,添加目录映射,添加虚拟网络。。。

如果要重新添加主机节点的话,需要把这一堆东西都清除掉才行。

福哥整理了一个教程用来清理这些残留的设置《Rancher清理主机节点残留数据的方法【20210921】》,大家可以参考看看。