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

MySQL query sorting and paging related

Overview It is usually not what we want to presen...

Using JavaScript difference to implement a comparison tool

Preface At work, I need to count the materials su...

Detailed explanation of the abbreviation of state in react

Preface What is state We all say that React is a ...

Linux Centos8 Create CA Certificate Tutorial

Install Required Files Yum install openssl-* -y C...

A simple example of how to implement fuzzy query in Vue

Preface The so-called fuzzy query is to provide q...

How to solve mysql error 10061

This article shares with you the solution to the ...

JavaScript to implement the function of changing avatar

This article shares the specific code of JavaScri...

How to export and import .sql files under Linux command

This article describes how to export and import ....

Explore the truth behind the reload process in Nginx

Today's article mainly introduces the reload ...

How to set the page you are viewing to not allow Baidu to save its snapshot

Today, when I searched for a page on Baidu, becaus...

MySQL 5.7.21 installation and configuration method graphic tutorial (window)

Install mysql5.7.21 in the window environment. Th...

Handwritten Vue2.0 data hijacking example

Table of contents 1: Build webpack 2. Data hijack...

Use of Linux watch command

1. Command Introduction The watch command execute...

Tips for turning pixels into comprehensive brand experiences

Editor: This article discusses the role that inte...

How to draw the timeline with vue+canvas

This article example shares the specific code of ...