先前的存储驱动程序“devicemapper”失败:docker 中的退出状态 1
Posted
技术标签:
【中文标题】先前的存储驱动程序“devicemapper”失败:docker 中的退出状态 1【英文标题】:prior storage driver "devicemapper" failed: exit status 1 in docker 【发布时间】:2016-04-19 14:09:57 【问题描述】:我试图按照this tutorial 在内核为 3.18.21-17.el6.x86_64 的 centos 6 64 位上安装 docker。但是当我启动 docker 守护进程时出现此错误。
[root@test docker]# docker -d
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
ERRO[0000] [graphdriver] prior storage driver "devicemapper" failed: exit status 1
FATA[0000] Error starting daemon: error initializing graphdriver: exit status 1
这里还有一些输入:
[root@test docker]# docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): linux/amd64
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
[root@test docker]# uname -r
3.18.21-17.el6.x86_64
[root@test docker]# service docker start
Starting docker: [ OK ]
[root@test docker]# service docker status
docker dead but subsys locked
[root@test docker]# docker -d -D
DEBU[0000] Registering POST, /auth
DEBU[0000] Registering POST, /build
DEBU[0000] Registering POST, /containers/name:.*/wait
DEBU[0000] Registering POST, /containers/name:.*/attach
DEBU[0000] Registering POST, /containers/name:.*/copy
DEBU[0000] Registering POST, /containers/name:.*/exec
DEBU[0000] Registering POST, /exec/name:.*/start
DEBU[0000] Registering POST, /commit
DEBU[0000] Registering POST, /images/create
DEBU[0000] Registering POST, /images/load
DEBU[0000] Registering POST, /images/name:.*/push
DEBU[0000] Registering POST, /images/name:.*/tag
DEBU[0000] Registering POST, /containers/name:.*/pause
DEBU[0000] Registering POST, /containers/name:.*/rename
DEBU[0000] Registering POST, /containers/name:.*/unpause
DEBU[0000] Registering POST, /containers/name:.*/restart
DEBU[0000] Registering POST, /exec/name:.*/resize
DEBU[0000] Registering POST, /containers/create
DEBU[0000] Registering POST, /containers/name:.*/kill
DEBU[0000] Registering POST, /containers/name:.*/start
DEBU[0000] Registering POST, /containers/name:.*/stop
DEBU[0000] Registering POST, /containers/name:.*/resize
DEBU[0000] Registering DELETE, /containers/name:.*
DEBU[0000] Registering DELETE, /images/name:.*
DEBU[0000] Registering OPTIONS,
DEBU[0000] Registering GET, /info
DEBU[0000] Registering GET, /version
DEBU[0000] Registering GET, /containers/ps
DEBU[0000] Registering GET, /containers/name:.*/top
DEBU[0000] Registering GET, /containers/name:.*/stats
DEBU[0000] Registering GET, /images/name:.*/json
DEBU[0000] Registering GET, /_ping
DEBU[0000] Registering GET, /events
DEBU[0000] Registering GET, /images/json
DEBU[0000] Registering GET, /images/get
DEBU[0000] Registering GET, /images/name:.*/get
DEBU[0000] Registering GET, /images/name:.*/history
DEBU[0000] Registering GET, /containers/name:.*/changes
DEBU[0000] Registering GET, /containers/name:.*/logs
DEBU[0000] Registering GET, /exec/id:.*/json
DEBU[0000] Registering GET, /images/search
DEBU[0000] Registering GET, /containers/json
DEBU[0000] Registering GET, /containers/name:.*/export
DEBU[0000] Registering GET, /containers/name:.*/json
DEBU[0000] Registering GET, /containers/name:.*/attach/ws
DEBU[0000] devicemapper: driver version is 4.28.0
DEBU[0000] Generated prefix: docker-8:2-394662
DEBU[0000] Checking for existence of the pool 'docker-8:2-394662-pool'
DEBU[0000] [deviceset] constructDeviceIdMap()
DEBU[0000] Loading data for file /var/lib/docker/devicemapper/metadata/base
DEBU[0000] Added deviceId=1 to DeviceIdMap
DEBU[0000] Loading data for file /var/lib/docker/devicemapper/metadata/transaction-metadata
DEBU[0000] Added deviceId=1 to DeviceIdMap
DEBU[0000] [deviceset] constructDeviceIdMap() END
DEBU[0000] Removing uninitialized base image
DEBU[0000] activateDeviceIfNeeded()
DEBU[0000] docker group found. gid: 495
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
DEBU[0000] [devmapper] removeDevice START(docker-8:2-394662-base)
DEBU[0000] [devmapper] removeDevice END(docker-8:2-394662-base)
DEBU[0000] unregisterDevice(1, )
DEBU[0000] Initializing base device-mapper thin volume
DEBU[0000] [devmapper] CreateDevice(poolName=/dev/mapper/docker-8:2-394662-pool, deviceId=1)
DEBU[0000] Registering device (id 1) with FS size 10737418240
DEBU[0000] registerDevice(1, )
DEBU[0000] Creating filesystem on base device-mapper thin volume
DEBU[0000] activateDeviceIfNeeded()
DEBU[0000] Error device setupBaseImage: exit status 1
ERRO[0000] [graphdriver] prior storage driver "devicemapper" failed: exit status 1
FATA[0000] Error starting daemon: error initializing graphdriver: exit status 1
我感觉我错过了一些与 docker 相关的配置。
[root@test docker]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker
#
# Other arguments to pass to the docker daemon process
# These will be parsed by the sysv initscript and appended
# to the arguments list passed to docker -d
other_args=""
我必须坚持使用 Centos 6。你能帮我解决这个问题吗?
【问题讨论】:
首先,我会尝试安装docker 1.7.1(不是1.7.0),也就是last supported version for CentOS 6;它包含一些错误修复。这是第一次安装还是升级?如果是首次安装,您可以考虑擦除/var/lib/docker
,因为它看起来包含以前尝试的数据。但是,您将丢失本地存在的所有容器/图像。
另外,请确保您阅读了 devicemapper 上的存储驱动程序部分,因为默认(“loop-lvm”)配置不适合生产使用,会导致性能不佳; docs.docker.com/engine/userguide/storagedriver/…
@thaJeztah 这是第一次安装。而且我已经尝试过擦除 /var/lib/docker 目录但仍然遇到相同的错误。我在另一个盒子中安装了 docker 1.7.1,它也给出了同样的错误。感谢您的回复。
你是如何安装 docker 的?您是使用 yum 存储库,还是安装了静态二进制文件?或者,您可以查看 Oracle Linux 6,它仍然受到积极支持 docs.docker.com/engine/installation/oracle
【参考方案1】:
安装 Docker 1.7.1 为我解决了 Redhat_6.7 Release 的“docker dead but subsys locked”问题。
【讨论】:
以上是关于先前的存储驱动程序“devicemapper”失败:docker 中的退出状态 1的主要内容,如果未能解决你的问题,请参考以下文章
如何在 mac 上将 docker 存储驱动程序更改为 devicemapper