查询docker状态报错:docker dead but pid file exists

  • Post author:
  • Post category:其他




背景

在CentOS 6上为了使用docker,于是升级了内核到3.10版本,然后安装repo源和docker组件,

yum install epel-release
yum install docker-io

一切都很顺利,然后启动docker服务,以及查看docker服务状态,结果报错了,

[root@localhost run]# service docker start
Starting docker:	                                   [  OK  ]
[root@localhost run]# service docker status
docker dead but pid file exists



原因

其实原因就是device-mapper相关组件的版本过低了,因此需要单独升级这几个组件,

yum install -y \
    http://vault.centos.org/6.6/os/x86_64/Packages/device-mapper-libs-1.02.90-2.el6.x86_64.rpm \
    http://vault.centos.org/6.6/os/x86_64/Packages/device-mapper-1.02.90-2.el6.x86_64.rpm  \
    http://vault.centos.org/6.6/os/x86_64/Packages/device-mapper-event-1.02.90-2.el6.x86_64.rpm \
    http://vault.centos.org/6.6/os/x86_64/Packages/device-mapper-event-libs-1.02.90-2.el6.x86_64.rpm 

升级之后再次启动docker服务,查询服务,显示进程正常。

[root@localhost docker]# service docker start
Starting docker:	                                   [  OK  ]
[root@localhost docker]# service docker status
docker (pid  19680) is running...



注:

如果没有升级device-mapper相关组件,安装docker后直接执行docker命令启动进程,则会有以下报错,

[root@localhost docker]# docker -d
docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference

解决方案是一样的,升级device-mapper相关组件即可。



版权声明:本文为u010039418原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。