gpt4 book ai didi

docker - 工作人员无法连接到 AWS EC2 上的 Swarm

转载 作者:行者123 更新时间:2023-12-02 11:52:11 26 4
gpt4 key购买 nike

我是 AWS EC2 新手,

目标:在 EC2 上创建 3 个 Ubuntu 机器实例,并在第一个实例上初始化 Swarm,并将其他 2 个实例作为工作节点添加到 Swarm。

错误:Swarm 初始化工作正常,但将工作人员添加到 Swarm 会引发错误

~$ docker swarm join --token SWMTKN-1-4yquvx0xihdhcv0m1vmxmbq4q45hoanm9ig00pue7opx3dhc1s-2ybrjxx97mpjyo351sx8jyisp 172.31.31.41:2377
Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the "docker info" command to see the current swarm status of your node.

~$ docker info
*****
Swarm: error
NodeID:
Error: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Is Manager: false
******

我已经查看了 stackoverflow ( Docker 1.12.1: after swarm init, workers unable to join swarm ) 上的相关问题,但这些解决方案不适用于我的情况

如何让我的其他 2 个实例加入群

最佳答案

这看起来像是您的安全设置存在问题。确保所有必需的端口均已打开

关于经理:

Custom TCP Rule TCP 2377    swarm + remote mgmt
Custom TCP Rule TCP 7946 swarm
Custom UDP Rule UDP 7946 swarm
Custom UDP Rule UDP 4789 swarm

关于 worker

Custom TCP Rule TCP 7946    swarm
Custom UDP Rule UDP 7946 swarm
Custom UDP Rule UDP 4789 swarm

请参阅下文了解更多详细信息

https://gist.github.com/BretFisher/7233b7ecf14bc49eb47715bbeb2a2769

同时检查 ufw statusiptables -Ssestatus 以确保其中任何一个都不会阻止访问

关于docker - 工作人员无法连接到 AWS EC2 上的 Swarm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46116999/

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