docker swarm CA证书到期

docker 寻梦 2年前 (2023-01-30) 791次浏览 0个评论 扫描二维码
文章目录[隐藏]

问题

在portainer平台查看日志,发现一些节点日志无法查看报错为:

Error grabbing logs: rpc error: code = Unknown desc = warning: incomplete log stream. some logs could not be retrieved for the following reasons: node xw411xvzxn5sm29dd8u7culla is not available

查看证书时间

登陆docker swarm管理节点查看证书有效期时间

[root@host ~]# docker system info
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0

查看这语句发现CA证书只有3个月的有效期

更新CA证书并延长证书时间

在swarm管理节点执行这两个命令

[root@host ~]# docker swarm update --cert-expiry 867240h0m0s
Swarm updated.
[root@host ~]# docker swarm ca --rotate | openssl x509 -text -noout

检查

[root@host ~]# docker system info
  CA Configuration:
   Expiry Duration: 99 years
   Force Rotate: 2

通过查看CA证书时间发现已经更新并延长 查看日志发现日志已经可以正常查看,恢复正常。

注意:

如果证书没到期,也出现同样的提示,得重新生成CA证书

docker swarm ca --rotate

我的博客即将同步至腾讯云开发者社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=18qvzuzhfe0zf

喜欢 (13)
[支付宝扫码,感谢支持]
分享 (0)
关于作者:

您必须 登录 才能发表评论!