上午通过自己的测试,centos6.5安装完成之后,因为本地的版本的问题,内核是2.6版本的,升级之后也不能完对应的安装,于是采用了centos7;
安装过程此处不做具体详细的介绍了。具体可以自行百度搜索。
完事之后按照上篇博文中的步骤进行安装。经过简单的测试之后发现,docker并不能启动。会提示如下的错误。
[root@localhost ~]# systemctl restart 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@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-07-03 10:12:16 CST; 5s ago
Docs: http://docs.docker.com
Process: 16172 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
Main PID: 16172 (code=exited, status=1/FAILURE)
Jul 03 10:12:15 ALY-HKC-PRO-001 systemd[1]: Starting Docker Application Container Engine...
Jul 03 10:12:15 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:15.812330534+08:00" level=info msg="libcontainerd: new containerd process, pid: 16180"
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.823237678+08:00" level=warning msg="devmapper: Usage of loopback devices is strongly discourage...v section."
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.838204058+08:00" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: d...run failed"
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.838278116+08:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devmap...run failed"
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: Failed to start Docker Application Container Engine.
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: Unit docker.service entered failed state.
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
此处它提示是Failed to start Docker Application Container Engine。此处关注一下错误,具体的报错信息相同。从其他地方拷贝而来。
于是针对错误进行查询,解决。分别尝试:
首先,需要将需要把firewalld.service及selinux关闭。因为新安装的centos7,防火墙并未关闭,于是进行操作。
对于selinux的关闭方法如下:
vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
重启服务reboot。
当然也可以临时关闭,临时关闭的情况下,这样会导致下次重启之后,仍然不能启动docker服务。
网上有些人到这里还没有解决还有如下的解决方式。(此处本人为遇到,将其内容也整理进来)
由于docker的engine 基于Device Mapper提供的一种存储驱动,而它又依赖与 devicemapper。于是乎我将它给删除并重启服务,解决了docker无法正常启动的问题。
# rm -rf /var/lib/docker/
# 添加如下内容
# vim /etc/docker/daemon.json
{
"graph": "/mnt/docker-data",
"storage-driver": "overlay"
}
以上是具体解决docker安装启动服务的过程。如果有不对的地方,还请指正。近期在写代码做项目整合的时候遇到了需要手工配置的情况,搭建一个docker环境,因此进行了安装测试。
---------------------本文来自 Burgess_Lee 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/Burgess_Le ... 564?utm_source=copy
|
|