https://access.redhat.com/solutions/3643862
环境
- Red Hat Enterprise Linux 7
- docker-1.13.1-75.git8633870.el7_5.x86_64
- /var/lib/docker is a LV and the underlying PV is a EMC powerpath device
- OpenShift Container Platform 3.9
问题
- Why docker daemon fails to start when docker root directory is on a EMC powerpath device in Red Hat Enterprise Linux 7 ?
From the log messages:
Oct 08 17:35:27 test dockerd-current[3409]: Error starting daemon: error initializing graphdriver: devmapper: Unable to take ownership of thin-pool (vg_docker-docker--pool) that already has used data blocks
决议
Add a dependency so that docker service wont start until the underlying LV is mounted.
Create a file varlibdocker.conf
under /etc/systemd/system/docker.service.d/
directory with the following contents
[Unit]
RequiresMountsFor=/var/lib/docker
After making the change, reload systemd using the command systemctl daemon-reload
根源
docker daemon was starting early even before the EMC powerpath devices were initialized. Since /var/lib/docker was not mounted, docker daemon will detect an empty /var/lib/docker and tries to initialize as if it was starting for the first time on the system. Due to this, it will not be able to use the existing docker thin pool and fails with the error messagedevmapper: Unable to take ownership of thin-pool (vg_docker-docker--pool) that already has used data blocks