docker重启服务器步骤

[root@iZwz99xeomvq1omj9cu7tuZ ~]# docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@iZwz99xeomvq1omj9cu7tuZ ~]# docker version
Client:
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:51:04 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@iZwz99xeomvq1omj9cu7tuZ ~]# systemctl restartdocker.service
Unknown operation 'restartdocker.service'.
[root@iZwz99xeomvq1omj9cu7tuZ ~]#  systemctl status docker -l
● docker.service - Docker Application Container Engine
   Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-06-20 13:22:05 CST; 7s ago
     Docs: http://docs.docker.io
 Main PID: 15203 (dockerd)
    Tasks: 27
   Memory: 29.5M
   CGroup: /system.slice/docker.service
           ├─15203 /opt/docker/bin/dockerd
           └─15216 containerd --config /data/docker/exec/containerd/containerd.toml --log-level debug

Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191847920+08:00" level=info msg="loading plugin \"io.containerd.service.v1.images-service\"..." type=io.containerd.service.v1
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191872082+08:00" level=info msg="loading plugin \"io.containerd.service.v1.leases-service\"..." type=io.containerd.service.v1
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191889053+08:00" level=info msg="loading plugin \"io.containerd.service.v1.namespaces-service\"..." type=io.containerd.service.v1
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191904226+08:00" level=info msg="loading plugin \"io.containerd.service.v1.snapshots-service\"..." type=io.containerd.service.v1
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191920419+08:00" level=info msg="loading plugin \"io.containerd.runtime.v1.linux\"..." type=io.containerd.runtime.v1
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.191992708+08:00" level=info msg="loading plugin \"io.containerd.runtime.v2.task\"..." type=io.containerd.runtime.v2
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.192051316+08:00" level=debug msg="loading tasks in namespace" namespace=moby
Jun 20 13:22:05 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:05.293329136+08:00" level=debug msg="garbage collected" d=1.360248ms
Jun 20 13:22:06 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:06.149908821+08:00" level=warning msg="grpc: addrConn.createTransport failed to connect to {unix:///data/docker/exec/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = \"transport: error while dialing: dial unix:///data/docker/exec/containerd/containerd.sock: timeout\". Reconnecting..." module=grpc
Jun 20 13:22:08 iZwz99xeomvq1omj9cu7tuZ dockerd[15203]: time="2022-06-20T13:22:08.998044225+08:00" level=warning msg="grpc: addrConn.createTransport failed to connect to {unix:///data/docker/exec/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = \"transport: error while dialing: dial unix:///data/docker/exec/containerd/containerd.sock: timeout\". Reconnecting..." module=grpc
[root@iZwz99xeomvq1omj9cu7tuZ ~]# docker debug
docker: 'debug' is not a docker command.
See 'docker --help'
[root@iZwz99xeomvq1omj9cu7tuZ ~]# systemctl daemon-reload
You have new mail in /var/spool/mail/root
[root@iZwz99xeomvq1omj9cu7tuZ ~]# systemctl restart docker
[root@iZwz99xeomvq1omj9cu7tuZ ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

解决方案

删除之前运行进程数据/data/docker/exec/containerd/下数据

执行如下命令即可

systemctl daemon-reload;
systemctl restart docker;
systemctl status docker;  # 查看状态
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值