栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

解决:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

[root@iZbp12f9404um3f6avsm29Z ~]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

今天重启服务器时报了:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

翻译过来就是:无法连接到Docker守护进程在unix:///var/run/ Docker .sock。docker守护进程正在运行吗?

 

这个主要的问题就是docker没有启动起来导致的...

 

启动docker并查看运行状态是否成功

[root@iZbp12f9404um3f6avsm29Z ~]# systemctl start docker
[root@iZbp12f9404um3f6avsm29Z ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-06-15 17:49:40 CST; 7min ago
     Docs: http://docs.docker.com
 Main PID: 1320 (dockerd-current)
    Tasks: 40
   Memory: 11.5M
   CGroup: /system.slice/docker.service
           ├─1320 /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 --init-path=/usr/libexec/d...
           ├─1326 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc --runt...
           ├─1448 /usr/libexec/docker/docker-proxy-current -proto tcp -host-ip 0.0.0.0 -host-port 33306 -container-ip 172.17.0.2 -container-port 3306
           └─1454 /usr/bin/docker-containerd-shim-current 26c8d35946e20d5b146602e4c48d501a17ae259184a1016b1f7efbb4cf439f6c /var/run/docker/libcontainerd/26c8d35946e20d5b146602e4c48d501a17ae259184a1016b1f7efbb4cf439f6c /usr/libexec/docker/docker-runc-current

Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] InnoDB: 5.6.51 started; log sequence number 1626017
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] RSA private key file not found: /usr/data//private_key.pem. Some authentication plugins will not work.
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] RSA public key file not found: /usr/data//public_key.pem. Some authentication plugins will not work.
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] Server hostname (bind-address): '*'; port: 3306
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] IPv6 is available.
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note]   - '::' resolves to '::';
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] Server socket created on IP: '::'.
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] Event Scheduler: Loaded 0 events
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: 2021-06-15 09:49:40 1 [Note] mysqld: ready for connections.
Jun 15 17:49:40 iZbp12f9404um3f6avsm29Z dockerd-current[1320]: Version: '5.6.51'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

看到running的标志,就是运行成功了...

 

为了避免日后重启再次出现类似情况,增加一个开机自动启动docker...

[root@iZbp12f9404um3f6avsm29Z ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

 

以上总结或许能帮助到你,或许帮助不到你,但还是希望能帮助到你,如有疑问、歧义,评论区留言会及时修正发布,谢谢!

未完,待续…

一直都在努力,希望您也是

微信搜索公众号:就用python

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/827850.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号