docker - 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 主机节点上,状态显示为ready
和active
$ 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 的新手,如果有人帮我解决这个问题,我真的很感激。
解决方案
问题出在svr-3
服务器卷/data/m64/
上,缺少符号链接。已创建符号链接并解决了问题。
推荐阅读
- sql - SQL right join with functional condition
- python - 创建对象时在 django 上使用 ForeingKey 也是从外键模型创建对象
- kubernetes - 如何知道你的 k8s 主节点?
- arrays - 如何在对象数组中找到特定的字符串,在 Swift 中搜索每个对象?
- android - 如何在该地区的安卓设备中搜索和查找所有可用的电信网络
- wordpress - 如何更改 wordpress 中的导航菜单位置?
- android - 我们可以将 Bulma CSS 用于 Android 应用程序吗?
- javascript - 在 div 中居中 img
- android - 片段的 AlertDialog 的单击事件中的自定义取消按钮未处理
- cordova - Cordova 插件网络信息在 Ionic 3 中不起作用