docker swarm CA证书到期

现象

在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-10-6-29-41 ~]# docker system info
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0

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

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

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

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

检查

[root@host-10-6-29-41 ~]# dockerystem info
  CA Configuration:
   Expiry Duration: 99 years
   Force Rotate: 2

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

相关文章

Docker是什么Docker是 Docker.Inc 公司开源的一个基于 LXC技...
本文为原创,原始地址为:http://www.cnblogs.com/fengzheng...
镜像操作列出镜像:$ sudo docker imagesREPOSITORY TAG IMA...
本文原创,原文地址为:http://www.cnblogs.com/fengzheng/p...
在 Docker 中,如果你修改了一个容器的内容并希望将这些更改...
在Docker中,--privileged 参数给予容器内的进程几乎相同的权...