docker-run-failed

Phenomenon

overlay2 not such file or directory.
overlay2 not such file or directory.
network not such file or directory.
docker run ****

/usr/bin/docker-current: open /data0/docker-data/tmp/GetImageBlob742939759: no such file or directory.

Job for docker.service failed

[root@localhost file-center-wf-monitor]# systemctl  stopstop docker
[root@localhost file-center-wf-monitor]# 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@localhost file-center-wf-monitor]# journalctl -xe
Apr 08 16:46:56 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 08 16:46:56 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Apr 08 16:46:56 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Apr 08 16:46:56 localhost.localdomain systemd[1]: docker.service failed.
Apr 08 16:46:56 localhost.localdomain polkitd[378650]: Unregistered Authentication Agent for unix-process:615774:734710755 (system bus name :1.130780, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
[root@localhost file-center-wf-monitor]# rm -rf /data0/docker_images/*
rm: cannot remove ‘/data0/docker_images/containers’: Device or resource busy
[root@localhost file-center-wf-monitor]# mount | grep /data0/docker_images
/dev/sda7 on /data0/docker_images/containers type ext4 (rw,relatime,data=ordered)
/dev/sda7 on /data0/docker_images/overlay type ext4 (rw,relatime,data=ordered)
[root@localhost file-center-wf-monitor]# umount /data0/docker_images/containers
[root@localhost file-center-wf-monitor]# rm -rf /data0/docker_images

init/merged: invalid argument.

[root@localhost file-center-wf-monitor]# service docker start
Error response from daemon: Cannot kill container file-center-wf-monitor-20200408: No such container: file-center-wf-monitor-20200408
Error response from daemon: No such container: file-center-wf-monitor-20200408
/usr/bin/docker-current: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2/dd9b026441e21f3b74bd00dbb9cba667129b8aba342413fa9fa56f68202b582b-init/merged: invalid argument.
See '/usr/bin/docker-current run --help'.
[root@localhost data0]# systemctl status docker.service
● docker.service - Docker Application Container Engine

{
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2020-04-08 16:54:09 CST; 6s ago
     Docs: http://docs.docker.com
  Process: 617751 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 617751 (code=exited, status=1/FAILURE)

Apr 08 16:54:08 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
Apr 08 16:54:08 localhost.localdomain dockerd-current[617751]: time="2020-04-08T16:54:08.821786068+08:00" level=info msg="libcontainerd: new containerd process, pid: 617763"
Apr 08 16:54:09 localhost.localdomain dockerd-current[617751]: Error starting daemon: error initializing graphdriver: invalid argument
Apr 08 16:54:09 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 08 16:54:09 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Apr 08 16:54:09 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Apr 08 16:54:09 localhost.localdomain systemd[1]: docker.service failed.

solution

  • Stop docker
[root@localhost file-center-wf-monitor]# systemctl  stopstop docker
  • Reloading docker
    • Unloading docker and critical dependence

      yum list installed | grep docker
      yum remove docker-engine.x86_64
      yum remove docker-engine-selinux.noarch
      yum remove docker-engine.x86_64 docker-client.x86_64 docker-common.x86_64
      yum remove container-selinux.noarch
      
      • Docker delete related files
      rm -rf /var/lib/docker/
      rm -rf /var/lib/docker
      rm -rf /data0/docker_images/overlay2/*
      rm -rf /data0/docker_images/*
      rm -rf /etc/sysconfig/docker*
      rm -rf /etc/systemd/system/docker.service.d
      
      • Uninstall does not lead to the installation
      Package(s) docker available, but not installed.
      
      • May lead to uninstall does not remove incomplete
    • Installation docker

      yum -y install docker
      
  • Adjust the configuration
[root@localhost file-center-wf-monitor]# vim /etc/docker/daemon.json
{
    "graph": "/data0/docker_images",
    "storage-driver": "overlay"
}
  • Overload Services
systemctl daemon-reload

  • Restart docker
service [start|restart] docker
  • View docker state
systemctl status docker

conclusion

  • The root of the problem is due to a directory on your machine is not available, presumably due to residual lead version history docker
  • After adjusting docker graph, the problem is solved.
  • This article documents in order to solve the current problems in the process, a series of problems encountered and the corresponding operations.
  • yum install docker, if the machine is relatively clean, the installation will be very smooth; if history docker installed, there will be a series of problems. You can uninstall each sub-package docker and manually remove remaining information solutions.
  • docker mirrored storage data path is always adjusted to the system disk, or the minutes disk playing system.
  • journalctl -xe you can see the service information (docker / mesos)
  • docker invalid argument is not necessarily the parameters of false starts, generally do not adjust /etc/systemd/system/docker.service.d/storage.conf, /etc/sysconfig/docker-storage, /etc/sysconfig/dockerand /etc/docker/daemon.jsonother documents.
  • /etc/sysconfig/dockerSelinux configuration mode can close the docker
# OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
OPTIONS='--log-driver=journald --signature-verification=false'
  • /etc/sysconfig/docker-storageDocker stored configuration can be adjusted (mount directory) mode
DOCKER_STORAGE_OPTIONS=
  • /etc/sysconfig/docker-networkNetwork mode configuration may be adjusted docker
  • By /etc/systemd/system/docker.service.d/***.confconfiguration of the corresponding files, is also effective in
  • When docker start, the local directory permissions, state, mount should be sure to check to avoid an exception occurs.

Guess you like

Origin www.cnblogs.com/suanec/p/12661583.html