Detailed troubleshooting of docker.service startup errors

Detailed troubleshooting of docker.service startup errors

Execute the following command to report an error

systemctl restart docker

View error messages

systemctl status docker -l

The error message is as follows:

● docker.service - Docker Application Container Engine
  Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
 Drop-In: /etc/systemd/system/docker.service.d
      └─kolla.conf
  Active: failed (Result: exit-code) since Wednesday 2018-08-01 16:32:27 CST; 52 minutes ago
   Docs: https://docs.docker.com
 Process: 3833722 ExecStart=/usr/bin/docker daemon --insecure-registry 172.16.59.153 (code=exited, status=1/FAILURE)
 Main PID: 3833722 (code=exited, status=1/FAILURE)
  Memory: 8.0K
  CGroup: /system.slice/docker.service

Aug 01 16:32:26 czwei004 systemd[1]: Starting Docker Application Container Engine...
August 01 16:32:26 czwei004 docker[3833722]: time="2018-08-01T16:32:26.527063936+08:00" level=info msg="libcontainerd: new containerd process, pid: 3833733"
Aug 01 16:32:27 czwei004 docker[3833722]: time="2018-08-01T16:32:27.532317497+08:00" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
Aug 01 16:32:27 czwei004 docker[3833722]: time="2018-08-01T16:32:27.560010414+08:00" level=warning msg="devmapper: Base device already exists and has filesystem xfs on it. User specified filesystem will be ignored."
August 01 16:32:27 czwei004 docker[3833722]: time="2018-08-01T16:32:27.577758251+08:00" level=fatal msg="Error starting daemon: error initializing graphdriver: \"/var/lib/docker\" contains several valid graphdrivers: devicemapper, overlay2; Please cleanup or explicitly choose storage driver (-s <DRIVER>)"
Aug 01 16:32:27 czwei004 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Aug 01 16:32:27 czwei004 systemd[1]: Failed to start Docker Application Container Engine.
Aug 01 16:32:27 czwei004 systemd[1]: Unit docker.service entered failed state.
Aug 01 16:32:27 czwei004 systemd[1]: docker.service failed.

Note that in the above error message

msg="Error starting daemon: error initializing graphdriver: \"/var/lib/docker\" contains several valid graphdrivers: devicemapper, overlay2; Please cleanup or explicitly choose storage driver (-s <DRIVER>)"

Go to the docker directory and check, there are directories for devicemapper and overlay2

The reason is that I installed a higher version of docker-engine before, and the default storage driver is overlay2. When I uninstalled it, the overlay2 folder remained in the docker directory. Later, I installed a lower version of docker, and the default was devicemapper, so there were multiple storage drivers.

After restarting the machine, delete the overlay2 directory and you can start it.

Additional knowledge: CentOS7 modifies the default storage location of Docker images

Stop the Docker service

# systemctl stop docker

Modify the docker service startup file

# vim /etc/sysconfig/docker

OPTIONS='--selinux-enabled --log-driver=journald --graph=/docker --signature-verification=false --insecure-registry 192.168.1.1'
#--insecure-registry 192.168.1.1 This is the warehouse address and can be ignored. # The /docker directory is what I use to replace the default /var/lib/docker. After the directory is created, remember to "mv /var/lib/docker/* /docker/" to move all the original

Copy all the files and directories in the first directory to the new directory.

Reload the configuration and start

# systemctl daemon-reload

# systemctl start docker

Check docker information

# docker info

The above detailed troubleshooting of the docker.service startup error is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of Docker service command (summary)
  • docker.service failed to start: Causes and solutions for Unit not found
  • Detailed explanation of overlay network in Docker
  • Docker online and offline installation and common command operations
  • Use docker to build kong cluster operation
  • How to change the domestic image source for Docker

<<:  Native JS to achieve drag photo wall

>>:  Summary of commonly used SQL in MySQL operation tables

Recommend

Detailed explanation of CSS3 text shadow text-shadow property

Text shadow text-shadow property effects: 1. Lowe...

HTML table markup tutorial (18): table header

<br />The header refers to the first row of ...

How to pass the value of the select drop-down box to the id to implement the code

The complete code is as follows : HTML code: Copy ...

Vue codemirror realizes the effect of online code compiler

Preface If we want to achieve the effect of onlin...

MySQL batch adding and storing method examples

When logging in to the stress test, many differen...

How to create a trigger in MySQL

This article example shares the specific code for...

How to set up automatic daily database backup in Linux

This article takes Centos7.6 system and Oracle11g...

A bug fix for Tomcat's automatic shutdown

Preface Recently, a Java EE web project that has ...

Detailed explanation of JS browser storage

Table of contents introduction Cookie What are Co...

HTML page header code is completely clear

All the following codes are between <head>.....

The difference between delete, truncate, and drop and how to choose

Preface Last week, a colleague asked me: "Br...

How to configure eureka in docker

eureka: 1. Build a JDK image Start the eureka con...

How to modify the default storage location of Docker images (solution)

Due to the initial partitioning of the system, th...

Example of implementing load balancing with Nginx+SpringBoot

Introduction to Load Balancing Before introducing...