docker安装启动问题解决排查

一、安装docker报错

刚开始安装docker报这个错:

Error: Transaction test error:

file /usr/libexec/docker/cli-plugins/docker-buildx from install of docker-ce-cli-1:20.10.8-3.el8.x86_64 conflicts with file from package docker-buildx-plugin-0:0.14.0-1.el8.x86_64

根据错误显示发现插件冲突了,删除插件

复制代码
yum remove docker-buildx-plugin-0:0.14.0-1.el8.x86_64

结果如下:

再次安装

复制代码
yum install docker-ce-20.10.8-3.el8 docker-ce-cli-20.10.8-3.el8

显示成功

但是无法启动

二、启动问题

使用命令启动结果报错

复制代码
sudo systemctl start docker

查看状态和错误

但看状态无法发现是什么原因,去查看具体原因

复制代码
journalctl -u docker.service

结果如下:

-- Logs begin at Wed 2024-12-04 03:55:58 CST, end at Fri 2024-12-06 11:31:04 CST. --

Dec 06 10:43:55 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:43:55 node2 dockerd[3353521]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:43:55 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:43:55 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:43:55 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:43:58 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:43:58 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.

Dec 06 10:43:58 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:43:58 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:43:58 node2 dockerd[3353564]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:43:58 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:43:58 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:43:58 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:44:00 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:44:00 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.

Dec 06 10:44:00 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:44:00 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:44:00 node2 dockerd[3353590]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:44:00 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:44:00 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:44:00 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.

Dec 06 10:44:02 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Start request repeated too quickly.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:44:02 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:45:00 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:45:00 node2 dockerd[3353939]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:45:00 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:45:00 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:45:00 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:45:02 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:45:02 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.

Dec 06 10:45:02 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:45:02 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:45:02 node2 dockerd[3353993]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:45:02 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:45:02 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:45:02 node2 systemd[1]: Failed to start Docker Application Container Engine.

根据这个报错failed to start daemon: failed to dial "/run/containerd/containerd.sock"去查看,以为是没启动,结果查看是启动的

复制代码
systemctl status containerd

查看结果如下:

去查看containerd.sock相关权限

执行下列操作:

复制代码
sudo chown root:docker /run/containerd/containerd.sock

然后直接重启

复制代码
systemctl restart containerd

结果还是一样:

最后发现需要先停止在重启才能奏效

复制代码
[root@node2 ~]# systemctl stop containerd
[root@node2 ~]# systemctl start containerd
[root@node2 ~]# systemctl start docker.service

此时查看docker状态已经running了

相关推荐
likuolei16 分钟前
XML DOM 节点类型
xml·java·服务器
风123456789~1 小时前
【Linux专栏】显示或隐藏行号、批量注释
linux·运维·服务器
谢尔登2 小时前
简单聊聊webpack摇树的原理
运维·前端·webpack
ZHE|张恒2 小时前
Spring Bean 生命周期
java·spring
只想安静的写会代码3 小时前
centos/ubuntu/redhat配置清华源/本地源
linux·运维·服务器
susu10830189113 小时前
ubuntu多块硬盘挂载到同一目录LVM方式
linux·运维·ubuntu
r***F2623 小时前
【漏洞复现】CVE-2019-11043(PHP远程代码执行漏洞)信息安全论文_含漏洞复现完整过程_含Linux环境go语言编译环境安装
linux·golang·php
贝锐3 小时前
Docker部署Teemii本地漫画库,并通过花生壳内网穿透实现远程访问
docker
q***38514 小时前
SpringCloud实战十三:Gateway之 Spring Cloud Gateway 动态路由
java·spring cloud·gateway
小白学大数据4 小时前
Python爬虫伪装策略:如何模拟浏览器正常访问JSP站点
java·开发语言·爬虫·python