2019独角兽企业重金招聘Python工程师标准>>>

docker1.12版本刚出的时候,自己建了个虚拟机安装实验了下内置的swarm模式的新特性,后来这个虚拟机就一直没用。今天在打开这个虚拟机时,发现docker服务无法启动了,具体现象如下:

[root@node1 /]# service docker start
Redirecting to /bin/systemctl start  docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

查看详细的信息

[root@node1 /]# systemctl status docker.service -l
* docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)Active: failed (Result: exit-code) since 六 2017-01-07 20:19:22 CST; 56s agoDocs: https://docs.docker.comProcess: 2707 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)Main PID: 2707 (code=exited, status=1/FAILURE)1月 07 20:19:21 node1 dockerd[2707]: time="2017-01-07T20:19:21.941128813+08:00" level=warning msg="mountpoint for pids not found"
1月 07 20:19:21 node1 dockerd[2707]: time="2017-01-07T20:19:21.941923814+08:00" level=info msg="Loading containers: start."
1月 07 20:19:21 node1 dockerd[2707]: ...time="2017-01-07T20:19:21.966308550+08:00" level=info msg="Firewalld running: false"
1月 07 20:19:22 node1 dockerd[2707]: time="2017-01-07T20:19:22.458578104+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
1月 07 20:19:22 node1 dockerd[2707]: time="2017-01-07T20:19:22.572281786+08:00" level=info msg="Loading containers: done."
1月 07 20:19:22 node1 dockerd[2707]: time="2017-01-07T20:19:22.635556518+08:00" level=fatal msg="Error creating cluster component: error while loading TLS Certificate in /var/lib/docker/swarm/certificates/swarm-node.crt: x509: certificate has expired or is not yet valid"
1月 07 20:19:22 node1 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
1月 07 20:19:22 node1 systemd[1]: Failed to start Docker Application Container Engine.
1月 07 20:19:22 node1 systemd[1]: Unit docker.service entered failed state.
1月 07 20:19:22 node1 systemd[1]: docker.service failed.

其中有一条错误信息,大致意思是swarm-mode.crt证书已经过期或无效。

error while loading TLS Certificate in /var/lib/docker/swarm/certificates/swarm-node.crt: x509: certificate has expired or is not yet valid

查询docker的issue里,是有一条24132号关于这个问题的讨论的:

Swarm certificates automatically renew and have 90 day expiry period by default. Still, if you don't start the daemon during that time the certificates will expire and starting daemon will fail with time="2016-06-29T17:18:06.165656736Z" level=fatal msg="Error creating cluster component: error while loading TLS Certificate in /var/lib/docker/swarm/certificates/swarm-node.crt: x509: certificate has expired or is not yet valid"

I think refusing to start and not ignoring this error is correct. We could provide --reset-swarm option to leave swarm so the user doesn't need to remove the state dir manually. Problem is that user must remember to remove this option as otherwise, it would clear the state on every next restart as well.

Maybe a good enough solution would be to add instructions for removing the state directory in the error message.

swarm的证书默认是有90天的有效期,如果在有效期内,可以通过自动续期的机制更新证书,但是如果长时间没有启动服务器,超过了有效期,那docker将无法启动。

针对这个问题,我们可以先将/var/lib/docker/swarm目录删除或更名,docker就可以正常启动了。

转载于:https://my.oschina.net/JasonZhang/blog/820786

Docker(swarm mode)在一段时间不用后无法启动相关推荐

  1. 笔记本电脑和台式机电脑长时间不用后卡顿解决办法

    描述:笔记本电脑和台式机电脑长时间不用后卡顿解决办法 方法: 这是长时间不用,电子元件受潮导致,可以下载一个鲁大师开启温度压力测试,热一会儿机器就好了

  2. 手机长时间不用自动断网_手机如果放一段时间不用就自己断开网络连接但 – 手机爱问...

    2015-05-28 anycall网络连接不上怎么办老显示已断开 您好: 目前中国大陆上市的三星手机暂时没有I8501机型,若您指的是I8150机型,连接无线网络总是自动断开,建议按照以下方式操作: ...

  3. Mac iOS 虚拟机VM 开开机后一段时间不用鼠标和键盘休眠的解决方法

    系统偏好设置->节能器->两个选项全部设置成"永不"->窗口左上角"关闭"自动保存

  4. 联想笔记本长时间不用后无法充电问题及解决

    最近本人把几天不用的电脑给更新了硬盘,后面再重新安装了系统(Win 10).一切搞好后,发现电池不充电了.... 问题描述: 接上电源后,电池图标这里一直显示0%,而且无法获取到电池信息. 解决: 点 ...

  5. ssh连接服务器 一段时间不动后 无响应

    服务器端如果设置 ns无响应后断开  就会导致这种情况 可以添加-o参数解决 ssh -o ServerAliveInterval=60 user@host 定时向服务器端发送信息维持链接

  6. 使用Docker Swarm搭建分布式爬虫集群

    转载自  使用Docker Swarm搭建分布式爬虫集群 在爬虫开发过程中,你肯定遇到过需要把爬虫部署在多个服务器上面的情况.此时你是怎么操作的呢?逐一SSH登录每个服务器,使用git拉下代码,然后运 ...

  7. [416]使用Docker Swarm搭建分布式爬虫集群

    在爬虫开发过程中,你肯定遇到过需要把爬虫部署在多个服务器上面的情况.此时你是怎么操作的呢?逐一SSH登录每个服务器,使用git拉下代码,然后运行?代码修改了,于是又要一个服务器一个服务器登录上去依次更 ...

  8. 如何使用Docker Swarm管理更多容器

    by nolan grace 通过诺兰·格雷斯 如何使用Docker Swarm管理更多容器 (How to manage more containers with Docker Swarm) Sca ...

  9. win10系统升级一段时间后,内存占用过高

    电脑升级系统后,使用一段时间都是正常的,电脑开机之后内存占用率基本在20-30%之间,过一段时间开机后内存占用率飙升,内存基本占用60%以上,由于磁盘I/O也比较高,百度基本都是禁用superfetc ...

最新文章

  1. 网内病毒问题快速排除集锦
  2. java并发排它锁_Java并发编程进阶——锁(解析)
  3. tcpdump的用法
  4. 基于阿里云的 Node.js 稳定性实践
  5. 软件设计原则:内聚、耦合有哪几种类型?内聚度、耦合度如何比较?
  6. 互联网日报 | 滴滴全球日订单首次突破5000万;抖音直播间将不支持第三方来源商品;拼多多“开学季”上线...
  7. centos7安装界面、桌面记录(ubuntu没试过)
  8. SQL 分页查询的四种方法
  9. 远程桌面漏洞poc_【漏洞复现】CVE 2019-0708 漏洞利用
  10. 屏蔽布线系统端接模块的技巧
  11. OpenGL基础50:HDR
  12. 在本地测试一次成功的AJAX请求
  13. 计算机网络拨号,自动拨号上网的设置方法【图解】
  14. 微擎 人人商城 对接京东vop 对接京东商品,同步商品 地址,库存,价格,上下架等。七 (中)京东后台提交退款订单...
  15. Kafka监控eagle
  16. buuctf:Ping Ping Ping(命令执行)
  17. 外贸技巧之如何引导客户尽早下单
  18. (七)《数电》——CMOS与TTL门电路
  19. 强化学习理论基础(MDP、值函数与贝尔曼公式以及表格式Agent)
  20. 无鸭不过秋,这样吃鸭润燥解乏!

热门文章

  1. 意外发现:网盾升级后支持soso和有道
  2. 渣渣菜鸡的 ElasticSearch 源码解析 —— 启动流程(上)
  3. 使用Toast进行用户提醒(转)
  4. 五步让你玩转CocoaPods
  5. 安全的 ActiveMQ
  6. 人工神经网络基本特点
  7. mysql5.6配置semi_sync
  8. go语言使用redis —— redigo
  9. 深度强化学习(Deep Reinforcement Learning)的资源
  10. ConfigParser