登陆rancher控制台,发现登陆不了,要么就报错误:

smartbi rancher证书问题_证书过期

docker logs -f --tail 10 smartbi-rancher//查看日志,发现报证书过期问题

2022/06/08 06:23:55 [INFO] Rancher version v2.2.4 is starting
2022/06/08 06:23:55 [INFO] Rancher arguments {ACMEDomains:[] AddLocal:auto Embedded:false KubeConfig: HTTPListenPort:80 HTTPSListenPort:443 K8sMode:auto Debug:false NoCACerts:false ListenConfig:<nil> AuditLogPath:/var/log/auditlog/rancher-api-audit.log AuditLogMaxage:10 AuditLogMaxsize:100 AuditLogMaxbackup:10 AuditLevel:3}
2022/06/08 06:23:55 [INFO] Listening on /tmp/log.sock
2022/06/08 06:23:55 [INFO] Running etcd --data-dir=management-state/etcd
2022/06/08 06:23:56 [INFO] Waiting for server to become available: Get https://localhost:6443/version?timeout=30s: x509: certificate has expired or is not yet valid
2022/06/08 06:23:58 [INFO] Waiting for server to become available: Get https://localhost:6443/version?timeout=30s: x509: certificate has expired or is not yet valid
2022/06/08 06:24:00 [INFO] Waiting for server to become available: Get https://localhost:6443/version?timeout=30s: x509: certificate has expired or is not yet valid
2022/06/08 06:24:02 [INFO] Waiting for server to become available: Get https://localhost:6443/version?timeout=30s: x509: certificate has expired or is not yet valid

处理步骤:

docker logs -f --tail 10 smartbi-rancher                         //查看日志
docker logs --tail 10000 smartbi-rancher >smartbi-rancher.log //输出最新10000行日志
cd ../Smartbi_All/rancher_data/management-state/tls //进入到该目录
openssl x509 -enddate -noout -in localhost.crt //查看正式是否过期
mv localhost.crt localhost.crt_bak
mv localhost.key localhost.key_bak
mv token-node.crt token-node.crt_bak
mv token-node.key token-node.key_bak

docker restart smartbi-rancher //重启rancher服务,证书有效期是一年

web登陆rancher:

https://ip:8443/login