zoukankan      html  css  js  c++  java
  • 关于docker启动失败问题处理

    docker info命令
    输出显示:
    Server:
    ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    本次解决问题的资料:
    关于Docker启动报错:docker.socket: Failed to listen on sockets: Address already in use
    https://www.cnblogs.com/Conwie/p/14462232.html
     
    不能解决的网上资料:
    网上查了一堆资料,没找到解决方法
    编辑 vim /etc/docker/daemon.json (解决不了)
    https://blog.csdn.net/sdrfengmi/article/details/87929593
    
    写在docker后重新安装   (不考虑)
    
    添加docker用户组    (已经有用户组了)
    https://www.dazhuanlan.com/2019/12/31/5e0b0af5a3191/
    
    还有修改 vi /etc/sysconfig/selinux文件信息的(不考虑)
    https://blog.csdn.net/qq_40996741/article/details/98473966
    然后想着先停掉docker服务。
    停服务时候报错了
    systemctl stop  docker.service
    Warning: Stopping docker.service, but it can still be activated by:
      docker.socket

    docker服务还是存活了,根据docker.socket文件。

    接着启动docker服务
    systemctl start  docker.service
    错误信息如下:
    A dependency job for docker.service failed. See 'journalctl -xe' for details
    systemctl status docker.service
    查看服务状态:
    ● docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
       Active: inactive (dead) since Tue 2021-06-08 09:53:44 CST; 10min ago
         Docs: https://docs.docker.com
    Main PID: 4695 (code=exited, status=0/SUCCESS)
    
    
    Jun 08 09:53:42 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:42.8864784..."
    Jun 08 09:53:42 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:42.9251783..."
    Jun 08 09:53:44 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:44.9135121..."
    Jun 08 09:53:44 VM-0-13-centos systemd[1]: Stopped Docker Application Container....
    Jun 08 09:57:52 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
    Jun 08 09:57:52 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
    Jun 08 10:01:29 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
    Jun 08 10:01:29 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
    Jun 08 10:03:09 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
    Jun 08 10:03:09 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
    Hint: Some lines were ellipsized, use -l to show in full

    看不出来错误信息

    然后使用 journalctl -xe 命令查看系统日志信息
     
    主要就是红框里
    Jun 08 10:08:41 VM-0-13-centos systemd[1]: docker.socket failed to listen on sockets: Address already in use
    Jun 08 10:08:41 VM-0-13-centos systemd[1]: Failed to listen on Docker Socket for the API.
    错误提示:监听socket时,发现地址已经被使用。
     
    然后去查看 /var/run/ 目录的docker文件
    发现docker.sock 文件变成的目录 docker.dock/
     
    删除这个目录就可以解决问题
    rm -rf /var/run/docker.sock/
     
    然后能正常启动docker服务
    systemctl restart docker

    作者:海绵般汲取
    出处:https://www.cnblogs.com/gne-hwz/
    版权:本文版权归作者和博客园共有
    转载:欢迎转载,但未经作者同意,必须保留此段声明;必须在文章中给出原文连接;否则必究法律责任
  • 相关阅读:
    Linux find 用法示例
    PostgreSQL 之 yum安装 postgis 插件
    解决sql中上下左右backspace不能用的方法
    MySQL 之 MySQL数据库的优化
    mysql命令行批量插入100条数据命令
    MySQL 之 MyTop实时监控MySQL
    MySQL 之 mysqlbinlog解析binlog乱码问题解密
    MySQL 之数据库增量数据恢复案例
    Mysql 之多实例 安装以及配置
    mysql 之审计 init-connect+binlog完成审计功能
  • 原文地址:https://www.cnblogs.com/gne-hwz/p/14861889.html
Copyright © 2011-2022 走看看