【发布时间】:2018-09-11 04:18:12
【问题描述】:
我有一项服务,我已将其配置为具有 3 个副本(在 3 个节点的集群中)。当需要将服务更新到新版本时,我运行以下命令:
docker stack deploy -c docker-compose.yml authentication
我还尝试使用以下命令强制更新:
docker service update --force authentication_authentication
一个实例将得到更新,其他实例将保持相同版本。上面的更新命令永远挂在这里:
overall progress: 1 out of 3 tasks
1/3: running [==================================================>]
2/3:
3/3:
在 docker 的 systemd 日志中,我看到了以下条目:
Sep 10 10:24:28 docker01 dockerd[1478]: time="2018-09-10T10:24:28.910584651-04:00" level=warning msg="rmServiceBinding 489e7143d27eaa4e4210b080f77b60018a033b29a291599d63def87fb0bed903 possible transient state ok:false entries:0 set:false "
Sep 10 10:24:28 docker01 dockerd[1478]: time="2018-09-10T10:24:28.911078594-04:00" level=warning msg="rmServiceBinding fa961a79dc139cfcc31e7ae671b6305f83887d804c4ce28aaae6f7221de08021 possible transient state ok:false entries:0 set:false "
如何更新这些服务?
其他细节:
- Docker 18.06.0-ce
- Ubuntu 16.04.5 LTS
docker-compose.yml:
version: "3.1"
services:
authentication:
image: "<private registry>/authentication:1.0.11"
ports:
- 8008:8008
deploy:
mode: replicated
replicas: 3
placement:
constraints:
- node.platform.os==linux
在 docker 配置文件中打开调试,现在我在日志中反复看到:
Sep 10 13:14:08 docker01 dockerd[1532]: time="2018-09-10T13:14:08.283136216-04:00" level=debug msg="Calling GET /v1.38/nodes"
Sep 10 13:14:08 docker01 dockerd[1532]: time="2018-09-10T13:14:08.487369825-04:00" level=debug msg="Calling GET /v1.38/services/authentication_authentication?insertDefaults=false"
Sep 10 13:14:08 docker01 dockerd[1532]: time="2018-09-10T13:14:08.488713081-04:00" level=debug msg="error handling rpc" error="rpc error: code = NotFound desc = service authentication_authentication not found" rpc=/docker.swarmkit.v1.Control/GetService
Sep 10 13:14:08 docker01 dockerd[1532]: time="2018-09-10T13:14:08.492766895-04:00" level=debug msg="Calling GET /v1.38/tasks?filters=%7B%22_up-to-date%22%3A%7B%22true%22%3Atrue%7D%2C%22service%22%3A%7B%22authentication_authentication%22%3Atrue%7D%7D"
Sep 10 13:14:08 docker01 dockerd[1532]: time="2018-09-10T13:14:08.494021275-04:00" level=debug msg="error handling rpc" error="rpc error: code = NotFound desc = service authentication_authentication not found" rpc=/docker.swarmkit.v1.Control/GetService
【问题讨论】:
-
一些猜测:您的私有注册表仍然可以从所有节点访问吗?您是否尝试在“docker stack deploy/update”命令中添加--with-registry-auth?你检查过 docker service ps authentificaction 吗?您的所有节点是否都在相同版本的 docker 下运行(您可以混合使用不同的节点)?
-
@Marvin - 可以从所有节点访问注册表。如果我删除服务并重新创建它,所有节点都会使用正确版本的服务运行,所以我认为这不是身份验证问题。是 - 检查
docker service ps,显示部分更新(只有本地节点正确更新)。所有节点都运行相同版本的 os/docker。尽我所能,这个问题与无法删除服务绑定(日志中的 rmServiceBinding 错误)有关。 -
实际上,所有节点都已经有一个本地服务的先前版本的图像:所以它可能是因为这个是新的。您可以尝试 docker pull 每个节点上的图像以确保。但这并不意味着我是对的!我想您还查看了您的服务和容器(尤其是远程节点上的容器)上的 docker 检查?此外,我没有在您的日志中看到“错误”,而只是“警告”。有没有遗漏?
-
@Marvin - 这只是一个警告。我回去为 docker 服务打开了调试,并附上了一些看起来相关的 rpc 错误。我还能够毫无问题地从远程节点上的私有注册表中提取图像。在检查服务/容器时没有发现任何有趣的东西。
标签: docker docker-swarm