安装了docker 因服务器从公网(192.168.50.60)机房迁移到内网(192.168.190.60),更改了IP地址,环境就运行不起来了~
输什么命令错误都是:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
启动docker后执行 systemctl status docker 出现了异常,具体如下:
[root@joinApp2 ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2016-02-25 17:26:11 CST; 16s ago
Docs:
http://docs.docker.com Process: 16384 ExecStart=/usr/bin/docker daemon $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
Main PID: 16384 (code=exited, status=1/FAILURE)
Feb 25 17:26:10 joinApp2 systemd[1]: Failed to start Docker Application Container Engine.
Feb 25 17:26:10 joinApp2 systemd[1]: Unit docker.service entered failed state.
Feb 25 17:26:10 joinApp2 systemd[1]: docker.service failed.
Feb 25 17:26:11 joinApp2 systemd[1]: docker.service holdoff time over, scheduling restart.
Feb 25 17:26:11 joinApp2 systemd[1]: start request repeated too quickly for docker.service
Feb 25 17:26:11 joinApp2 systemd[1]: Failed to start Docker Application Container Engine.
Feb 25 17:26:11 joinApp2 systemd[1]: Unit docker.service entered failed state.
Feb 25 17:26:11 joinApp2 systemd[1]: docker.service failed.
当时问题没解决搁置了。
今天重新google , 解决了问题,现在贴下解决办法
vi /etc/sysconfig/selinux
把selinux后面的改为disabled,重启一波机器,再重启docker就可以了
解决方法二:
===================
[root@master01 ~]# 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@master01 ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-01-22 23:31:10 CST; 5s ago
Docs: http://docs.docker.com
Process: 17943 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 $REGISTRIES (code=exited, status=1/FAILURE)
Main PID: 17943 (code=exited, status=1/FAILURE)
Jan 22 23:31:09 master01 systemd[1]: Starting Docker Application Container Engine...
Jan 22 23:31:09 master01 dockerd-current[17943]: time="2018-01-22T23:31:09.315315148+08:00" level=info msg="libcontainerd: new containerd process, pid: 17954"
Jan 22 23:31:10 master01 dockerd-current[17943]: time="2018-01-22T23:31:10.329514525+08:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devmapper..._devices\n"
Jan 22 23:31:10 master01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jan 22 23:31:10 master01 systemd[1]: Failed to start Docker Application Container Engine.
Jan 22 23:31:10 master01 systemd[1]: Unit docker.service entered failed state.
Jan 22 23:31:10 master01 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
处理方法
vim /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS=
vim /etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
# vim /etc/docker/daemon.json
{ "storage-driver": "devicemapper" }
最后重启docker
[root@master01 ~]# systemctl restart docker