See “systemctl status docker.service“ and “journalctl -xe“ for details启动报错

更新yum源安装docker和docker-compose

yum update -y

yum -y install docker systemctl start docker

[root@docker ~]# sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

100 651 100 651 0 0 507 0 0:00:01 0:00:01 --:--:-- 508

100 16.2M 100 16.2M 0 0 20408 0 0:13:54 0:13:54 --:--:-- 30669

[root@docker ~ ]# sudo chmod +x   /usr/local/bin/docker-compose

[root@docker ~]# docker-compose --version docker-compose version 1.25.0, build 0a186604

docker启动报错时

[root@docker ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for
details.

[root@docker ~]# 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 Tue 2020-12-15 23:13:37 CST; 7s ago
     Docs: http://docs.docker.com
  Process: 53929 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-ru
nc --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: 53929 (code=exited, status=1/FAILURE)

Dec 15 23:13:37 docker systemd[1]: Starting Docker Application Container Engine...
Dec 15 23:13:37 docker dockerd-current[53929]: Failed to connect to containerd. Please make sure containerd is installed in your PATH o...n $PATH
Dec 15 23:13:37 docker systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 15 23:13:37 docker systemd[1]: Failed to start Docker Application Container Engine.
Dec 15 23:13:37 docker systemd[1]: Unit docker.service entered failed state.
Dec 15 23:13:37 docker systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@docker ~]# chkconfig disabled off
error reading information on service disabled: No such file or directory
[root@docker ~]# chkconfig disabled on
error reading information on service disabled: No such file or directory
[root@docker ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for
details.[root@docker ~]#   yum -y remove docker.x86_64
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
 Package                    Arch                       Version                                                 Repository                   Size
=================================================================================================================================================
Removing:
 docker                     x86_64                     2:1.13.1-203.git0be3e21.el7.centos                      @extras                      65 M

Transaction Summary
=================================================================================================================================================
Remove  1 Package

Installed size: 65 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                              1/1
warning: /etc/sysconfig/docker-storage saved as /etc/sysconfig/docker-storage.rpmsave
  Verifying  : 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                              1/1

Removed:
  docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos                                                                                               

Complete!
[root@docker ~]#
[root@docker ~]#   yum -y remove docker-client.x86_64
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Resolving Dependencies
--> Running transaction check
---> Package docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
 Package                         Arch                     Version                                                Repository                 Size
=================================================================================================================================================
Removing:
 docker-client                   x86_64                   2:1.13.1-203.git0be3e21.el7.centos                     @extras                    13 M

Transaction Summary
=================================================================================================================================================
Remove  1 Package

Installed size: 13 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                       1/1
warning: file /usr/share/licenses/docker-client-1.13.1/LICENSE-vim-syntax: remove failed: No such file or directory
warning: file /usr/share/licenses/docker-client-1.13.1/LICENSE: remove failed: No such file or directory
warning: file /usr/share/licenses/docker-client-1.13.1: remove failed: No such file or directory
warning: file /usr/bin/docker-current: remove failed: No such file or directory
  Verifying  : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                       1/1

Removed:
  docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos                                                                                        

Complete!
[root@docker ~]#
[root@docker ~]#  yum -y remove docker-common.x86_64
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Resolving Dependencies
--> Running transaction check
---> Package docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
 Package                         Arch                     Version                                                Repository                 Size
=================================================================================================================================================
Removing:
 docker-common                   x86_64                   2:1.13.1-203.git0be3e21.el7.centos                     @extras                   4.4 k

Transaction Summary
=================================================================================================================================================
Remove  1 Package

Installed size: 4.4 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                       1/1
warning: file /usr/share/doc/docker-common-1.13.1/README-docker-common: remove failed: No such file or directory
warning: file /usr/share/doc/docker-common-1.13.1: remove failed: No such file or directory
warning: file /usr/bin/dockerd: remove failed: No such file or directory
warning: file /usr/bin/docker-containerd-shim: remove failed: No such file or directory
warning: file /usr/bin/docker-containerd: remove failed: No such file or directory
warning: file /usr/bin/docker: remove failed: No such file or directory
  Verifying  : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64                                                                       1/1

Removed:
  docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos                                                                                        

Complete!
[root@docker ~]#
[root@docker ~]# yum install -y yum -utils device-mapper-persistent-data lvm2
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade      downgrade a package
erase          Remove a package or packages from your system
fs             Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.
fssnapshot     Creates filesystem snapshots, or lists/deletes current snapshots.
groups         Display, or use, the groups information
help           Display a helpful usage message
history        Display, or use, the transaction history
info           Display details about a package or group of packages
install        Install a package or packages on your system
langavailable  Check available languages
langinfo       List languages information
langinstall    Install appropriate language packs for a language
langlist       List installed languages
langremove     Remove installed language packs for a language
list           List a package or groups of packages
load-transaction load a saved transaction from filename
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repo-pkgs      Treat a repo. as a group of packages, so we can install/remove all of them
repolist       Display the configured software repositories
search         Search package details for the given string
shell          Run an interactive yum shell
swap           Simple way to swap packages, instead of using shell
update         Update a package or packages on your system
update-minimal Works like upgrade, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo     Acts on repository update information
upgrade        Update packages taking obsoletes into account
version        Display a version for the machine and/or available repos.
Command line error: no such option: -u
[root@docker ~]#   yum install docker-ce
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.bfsu.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.1-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.1-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.1-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.1-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.4.3-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.1-3.el7 will be installed
---> Package docker-ce-rootless-extras.x86_64 0:20.10.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
 Package                                     Arch                     Version                           Repository                          Size
=================================================================================================================================================
Installing:
 docker-ce                                   x86_64                   3:20.10.1-3.el7                   docker-ce-stable                    27 M
Installing for dependencies:
 containerd.io                               x86_64                   1.4.3-3.1.el7                     docker-ce-stable                    33 M
 docker-ce-cli                               x86_64                   1:20.10.1-3.el7                   docker-ce-stable                    33 M
 docker-ce-rootless-extras                   x86_64                   20.10.1-3.el7                     docker-ce-stable                   9.0 M

Transaction Summary
=================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 102 M
Installed size: 422 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f3
5: NOKEYPublic key for containerd.io-1.4.3-3.1.el7.x86_64.rpm is not installed
(1/4): containerd.io-1.4.3-3.1.el7.x86_64.rpm                                                                             |  33 MB  00:00:05     
(2/4): docker-ce-20.10.1-3.el7.x86_64.rpm                                                                                 |  27 MB  00:00:05     
(3/4): docker-ce-rootless-extras-20.10.1-3.el7.x86_64.rpm                                                                 | 9.0 MB  00:00:02     
(4/4): docker-ce-cli-20.10.1-3.el7.x86_64.rpm                                                                             |  33 MB  00:00:04     
-------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                             10 MB/s | 102 MB  00:00:09     
Retrieving key from https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:docker-ce-cli-20.10.1-3.el7.x86_64                                                                                          1/4
  Installing : containerd.io-1.4.3-3.1.el7.x86_64                                                                                            2/4
  Installing : 3:docker-ce-20.10.1-3.el7.x86_64                                                                                              3/4
  Installing : docker-ce-rootless-extras-20.10.1-3.el7.x86_64                                                                                4/4
  Verifying  : docker-ce-rootless-extras-20.10.1-3.el7.x86_64                                                                                1/4
  Verifying  : containerd.io-1.4.3-3.1.el7.x86_64                                                                                            2/4
  Verifying  : 1:docker-ce-cli-20.10.1-3.el7.x86_64                                                                                          3/4
  Verifying  : 3:docker-ce-20.10.1-3.el7.x86_64                                                                                              4/4

Installed:
  docker-ce.x86_64 3:20.10.1-3.el7                                                                                                               

Dependency Installed:
  containerd.io.x86_64 0:1.4.3-3.1.el7        docker-ce-cli.x86_64 1:20.10.1-3.el7        docker-ce-rootless-extras.x86_64 0:20.10.1-3.el7       

Complete!
[root@docker ~]#             systemctl start docker
[root@docker ~]#
[root@docker ~]#             systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@docker ~]#
[root@docker ~]#             systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket
[root@docker ~]#
[root@docker ~]# docker version
Client: Docker Engine - Community
 Version:           20.10.1
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        831ebea
 Built:             Tue Dec 15 04:37:17 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       f001486
  Built:            Tue Dec 15 04:35:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@docker ~]# docker search mysql
NAME                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql                             MySQL is a widely used, open-source relation??  10247     [OK]       
mariadb                           MariaDB is a community-developed fork of MyS??  3785      [OK]       
mysql/mysql-server                Optimized MySQL Server Docker images. Create??  749                  [OK]
percona                           Percona Server is a fork of the MySQL relati??  514       [OK]       
centos/mysql-57-centos7           MySQL 5.7 SQL database server                   86                   
mysql/mysql-cluster               Experimental MySQL Cluster Docker images. Cr??  78                   
centurylink/mysql                 Image containing mysql. Optimized to be link??  60                   [OK]
bitnami/mysql                     Bitnami MySQL Docker Image                      47                   [OK]
deitch/mysql-backup               REPLACED! Please use http://hub.docker.com/r??  41                   [OK]
tutum/mysql                       Base docker image to run a MySQL database se??  35                   
databack/mysql-backup             Back up mysql databases to... anywhere!         34                   
prom/mysqld-exporter                                                              32                   [OK]
schickling/mysql-backup-s3        Backup MySQL to S3 (supports periodic backup??  29                   [OK]
linuxserver/mysql                 A Mysql container, brought to you by LinuxSe??  26                   
centos/mysql-56-centos7           MySQL 5.6 SQL database server                   20                   
circleci/mysql                    MySQL is a widely used, open-source relation??  19                   
mysql/mysql-router                MySQL Router provides transparent routing be??  17                   
arey/mysql-client                 Run a MySQL client from a docker container      16                   [OK]
fradelg/mysql-cron-backup         MySQL/MariaDB database backup using cron tas??  10                   [OK]
openshift/mysql-55-centos7        DEPRECATED: A Centos7 based MySQL v5.5 image??  6                    
devilbox/mysql                    Retagged MySQL, MariaDB and PerconaDB offici??  3                    
ansibleplaybookbundle/mysql-apb   An APB which deploys RHSCL MySQL                2                    [OK]
widdpim/mysql-client              Dockerized MySQL Client (5.7) including Curl??  1                    [OK]
jelastic/mysql                    An image of the MySQL database server mainta??  1                    
monasca/mysql-init                A minimal decoupled init container for mysql    0                    
[root@docker ~]# systemctl status docker.service
?.docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-12-15 23:16:41 CST; 31s ago
     Docs: https://docs.docker.com
 Main PID: 54423 (dockerd)
    Tasks: 10
   Memory: 41.3M
   CGroup: /system.slice/docker.service
           ?..54423 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.400836018+08:00" level=info msg="ccResolverWrapper: sending update to...ule=grpc
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.400855567+08:00" level=info msg="ClientConn switching balancer to \"p...ule=grpc
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.410000398+08:00" level=info msg="[graphdriver] using prior storage dr...verlay2"
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.412902627+08:00" level=info msg="Loading containers: start."
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.487578954+08:00" level=info msg="Default bridge (docker0) is assigned...address"
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.518834545+08:00" level=info msg="Loading containers: done."
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.536154497+08:00" level=info msg="Docker daemon" commit=f001486 graphd...=20.10.1
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.536218537+08:00" level=info msg="Daemon has completed initialization"
Dec 15 23:16:41 docker systemd[1]: Started Docker Application Container Engine.
Dec 15 23:16:41 docker dockerd[54423]: time="2020-12-15T23:16:41.548828602+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.

[root@docker ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@docker ~]#

 

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误提示表示 Docker 服务启动失败。你可以使用 `systemctl status docker.service` 命令来查看详细错误信息,该命令会显示 Docker 服务的状态以及最近的日志信息。具体命令如下: ``` systemctl status docker.service ``` 该命令会输出类似以下内容的信息: ``` ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit-hit) since Tue 2021-09-14 10:00:00 EDT; 1min ago Docs: https://docs.docker.com Process: 1234 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 1234 (code=exited, status=1/FAILURE) Sep 14 10:00:00 host systemd[1]: docker.service: Service hold-off time over, scheduling restart. Sep 14 10:00:00 host systemd[1]: docker.service: Scheduled restart job, restart counter is at 5. Sep 14 10:00:00 host systemd[1]: Stopped Docker Application Container Engine. Sep 14 10:00:00 host systemd[1]: docker.service: Start request repeated too quickly. Sep 14 10:00:00 host systemd[1]: docker.service: Failed with result 'start-limit-hit'. Sep 14 10:00:00 host systemd[1]: Failed to start Docker Application Container Engine. ``` 在该输出中,重点关注 `Active` 和 `Main PID` 行,以及最近的日志信息,可以帮助你确定 Docker 启动失败的具体原因。 如果你需要更详细的日志信息,可以使用 `journalctl -xe` 命令,该命令会显示系统的所有日志信息,包括 Docker 启动失败的相关信息。具体命令如下: ``` journalctl -xe ``` 该命令会输出所有的系统日志信息,你可以使用 `Ctrl+C` 停止输出。需要注意的是,该命令会输出大量的信息,你可以使用 `grep` 命令过滤 Docker 相关的信息,例如: ``` journalctl -xe | grep docker ``` 该命令会输出所有包含 `docker` 关键词的日志信息,方便你查找 Docker 启动失败的原因。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值