首页 > 解决方案 > Docker Swarm 代理 - 类型的挂载配置无效

问题描述

在我们的一台docker swarm agent服务器docker ps -a上,没有显示任何正在运行的容器列表。从docker service status看到下面的消息。

$ sudo systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-11-13 17:04:36 IST; 15h ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 4834 (dockerd)
      Tasks: 74
     Memory: 119.0M
     CGroup: /system.slice/docker.service
             └─4834 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Nov 14 08:27:06 svr-3 dockerd[4834]: time="2021-11-14T08:27:06.848315565+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:07 svr-3 dockerd[4834]: time="2021-11-14T08:27:07.253824118+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:11 svr-3 dockerd[4834]: time="2021-11-14T08:27:11.841725172+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:12 svr-3 dockerd[4834]: time="2021-11-14T08:27:12.261848748+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:16 svr-3 dockerd[4834]: time="2021-11-14T08:27:16.842731139+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:17 svr-3 dockerd[4834]: time="2021-11-14T08:27:17.256307583+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:21 svr-3 dockerd[4834]: time="2021-11-14T08:27:21.855252126+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:22 svr-3 dockerd[4834]: time="2021-11-14T08:27:22.256813458+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:26 svr-3 dockerd[4834]: time="2021-11-14T08:27:26.844842718+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>
Nov 14 08:27:27 svr-3 dockerd[4834]: time="2021-11-14T08:27:27.265032144+05:30" level=error msg="fatal task error" error="invalid mount config for type \"b>

在 Docker Swarm Manager 主机节点上,状态显示为readyactive

$ docker node ls
ID                            HOSTNAME   STATUS    AVAILABILITY   MANAGER STATUS   ENGINE VERSION
mmbxdeerfwperedsbj6l8zr71f *   svr-1     Ready     Active         Leader           20.10.7
kzc7jf7irsereed3kurcwqjb2j     svr-2     Ready     Active                          20.10.7
ew0edluvz39aregd87ld0wnv2e     svr-3     Ready     Active                          18.06.1-ce

svr-3主机上一切正常。我已经尝试过以下服务来解决svr-2,不幸的是无法帮助我。

sudo systemctl daemon-reload 
sudo systemctl enable docker 
sudo systemctl start docker

在 Leader 主机挂载部分如下。

docker inspect m64

"Mounts": [
                        {
                            "Type": "bind",
                            "Source": "/data/m64/",
                            "Target": "/root/.m64/"
                        },

我是 docker swarm 的新手,如果有人帮我解决这个问题,我真的很感激。

标签: dockerdocker-swarmubuntu-20.04docker-swarm-mode

解决方案


问题出在svr-3服务器卷/data/m64/上,缺少符号链接。已创建符号链接并解决了问题。


推荐阅读