首页 > 解决方案 > 重启 Raspbian 后 Docker 守护进程未启动

问题描述

所以目标是建立一个有 4 个 raspis、1 个 master 和 3 个 worker 的 kubernetes 集群。我正在遵循指南。初始设置后,集群工作正常,但重新启动后变得无用。经过一番调查,我发现 docker daemon 在重新启动后没有重新启动存在问题,这导致必要的 kubernetes 容器无法启动。我的文件系统在重新启动后也进入只读模式。的输出sudo service docker status显示以下内容

docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-10-03 12:23:57 CEST; 21min ago
     Docs: https://docs.docker.com
  Process: 1126 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/
 Main PID: 1126 (code=exited, status=1/FAILURE)

Oct 03 12:23:57 k8smaster-2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Oct 03 12:23:57 k8smaster-2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 03 12:23:57 k8smaster-2 systemd[1]: Stopped Docker Application Container Engine.
Oct 03 12:23:57 k8smaster-2 systemd[1]: docker.service: Start request repeated too quickly.
Oct 03 12:23:57 k8smaster-2 systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 03 12:23:57 k8smaster-2 systemd[1]: Failed to start Docker Application Container Engine.

尝试运行任何 docker 命令会导致

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

并且 docker 是通过curl -sSL get.docker.com | sh && sudo usermod pi -aG docker && newgrp docker.

我什至无法卸载它,因为它不是通过 apt-get 安装的:

sudo apt-get remove docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'docker' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.

journalctl -xeist的输出

The unit docker.service has entered the 'failed' state with result 'exit-code'.
Oct 03 12:23:57 k8smaster-2 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit docker.service has finished with a failure.
--
-- The job identifier is 1060 and the job result is failed.
Oct 03 12:23:57 k8smaster-2 systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

我用谷歌搜索了我遇到的各种错误,但它们只会导致 github 错误,这些错误已经存在 2 年且未解决或通过对我没有帮助的解决方案解决。(参考thisthisthis

我还尝试sudo systemctl enable docker在启动时自动启动,但我认为这不是问题。它看起来像是一个可以通过全新安装解决的配置问题,如果我想运行应该能够正常关闭的 kubernetes 集群,我需要避免这种情况。我真的希望有人能帮助我。

标签: dockerkubernetesraspbian

解决方案


推荐阅读