1.現象
在portain平台查看日志,發現一些節點日志無法查看報錯為: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
2.查看證書時間
登陸docker swarm管理節點查看證書有效期時間
[root@host-10-6-29-41 ~]# docker system info
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
# 查看這語句發現CA證書只有3個月的有效期
3.更新CA證書並延長證書時間
[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
#在swarm管理節點執行這兩個命令
4.檢查
[root@host-10-6-29-41 ~]# dockerystem info
CA Configuration:
Expiry Duration: 99 years
Force Rotate: 2
#通過查看CA證書時間發現已經更新並延長
查看日志發現日志已經可以正常查看,恢復正常。
