gpt4 book ai didi

docker - 来自守护程序 : attaching to network failed, 的错误响应请确保您的网络选项正确并检查管理器日志:超出了上下文截止日期

转载 作者:行者123 更新时间:2023-12-01 23:46:24 25 4
gpt4 key购买 nike

我正在尝试使用覆盖网络设置 docker swarm。我在 aws 上有一些主机,而其他主机是运行 Ubuntu 的笔记本电脑(与 aws 上相同)。每个节点都有一个静态公共(public)IP。我创建了一个覆盖网络: docker network create --driver=overlay --attachable test-net

我在其中一台 aws 主机上创建了一个集群网络。其他每个节点都可以加入该群体网络。

但是当我运行 docker run -it --name alpine2 --network test-net alpine 时在不在 aws 上的任何节点上,我收到错误:docker: Error response from daemon: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded.

但是如果我在任何 aws 主机上运行相同的命令,那么一切都会正常工作。如果 aws 上有一些节点而其他节点没有,我还需要在网络/端口方面做些什么吗?

我已经在所有机器上打开了集群网络所需的端口。

编辑:在管理器节点中列出时,所有节点都标记为“事件”。

更新通过打开相应端口解决了此问题。现在,如果所有节点都基于 Linux,它就可以工作了。但是当我尝试使用 Linux(ubuntu) 操作系统的管理器创建一个 swarm 时,mac os 机器无法加入该 swarm。

最佳答案

检查节点是否处于耗尽状态:

docker node inspect --format {{.Spec.Availability}} node

如果是,则更新状态:

docker node update --availability active node

解释如下:

Resolution

When a node is in drain state, it is expected behavior that you should not be able to allocate swarm mode resources such as multi-host overlay network IP addresses to the node.However, swarm mode does not currently provide a messaging mechanism between the swarm leader where IP address management occurs back to the worker node that requested the IP address. So docker run fails with context deadline exceeded. Internal engineering issue escalation/292 has been opened to provide a better error message in a future release of the Docker daemon.

source

关于docker - 来自守护程序 : attaching to network failed, 的错误响应请确保您的网络选项正确并检查管理器日志:超出了上下文截止日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57388405/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com