Linux系统Docker启动问题Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"


在Liunx中使用Docker, 注: Liunx使用的是在虚拟机下的centOS7版本
在刚开始安装Docker时没有任何错误, 但是在后续的docker启动过程中, 出现以下问题:

1 [root@zk2 docker]# service docker start
2 Redirecting to /bin/systemctl start  docker.service
3 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

刚遇到这个问题时, 在百度上找答案, 但是找到的答案都不能满足这个问题, 于是自己就慢慢摸索

解决方案

首先查看一下内核版本

因为使用命令: yum install docker下载时, 默认下载的是Docker的最新版本, 但是内核版本低的话可能不兼容新版本Docker, 所以有可能出现如上错误

首先要来验证CentOS 版本是否支持 Docker,Docker 要求 CentOS 系统的内核版本高于 3.10 

通过 uname -r 命令查看你当前的内核版本

1 [root@localhost /]# uname -r
2 3.10.0-123.el7.x86_64

方案一、内核版本过低

1.将以前下载好的Docker卸载干净,使用如下命令:

1 yum remove docker-*
2 sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine

2.更新改linux系统的内核版本

1 yum update

建议更新完之后, 重启一下系统

3.继续下载安装docker(尽量使用高级管理员权限下载)使用如下命令

1 yum install dacker

4.使用如下命令启动docker

1 systemctl start docker

问题解决!
如果这样安装完之后还报错, 按照这个步骤再来一遍即可

如果方案一不能解决,请向下继续阅读,根据场景选择解决方式  ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

 

方案二、检查配置文件是否错误

检查一下配置文件,使用如下命令:

1 vim /etc/sysconfig/docker

方案三、检查daemon.json文件是否错误

检查一下daemon.json文件,使用如下命令:

1 vim /etc/docker/daemon.json

检查以下内容是否存在,如果没有则加入文件中(注意引号和冒号的输入格式是否为英文):

1 {
2       "graph": "/mnt/docker-data",
3       "storage-driver": "overlay"
4 } 

方案四、删除 /var/lib/docker 目录

删除 /var/lib/docker 目录

重启 daemon

重启 docker

使用如下命令:

1 rm -rf /var/lib/docker
2 sudo systemctl daemon-reload
3 sudo service docker restart

方案五、安装 docker-io-selinux

安装 docker-io-selinux

重启 daemon

重启 docker

使用如下命令:

1 sudo yum install docker-io-selinux
2 sudo systemctl daemon-reload
3 sudo service docker restart

方案六、重新安装Docker

如果以上方案都没有解决你的问题,笔者建议按照步骤重新安装一下Docker,注意不要疏漏。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 centos7启动MySQL报 Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details. Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details Jenkins报错:Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details. Jenkins++:Job for jenkins.service failed because the control process exited with error code. See "systemctl st service mysql start ,出现错误Job for mysql.service failed because the control process exited process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. ubuntu16.04,mysql5.7重启不成功。Restarting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" Job for jenkins.service failed because the control process exited with error code. centos 报错 “Job for iptables.service failed because the control process exited with error code.”的解决办法
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM