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