Loading... 今天更新portainer/agent的时候发现新版本无法连接,于是开始排查。 那么直接进去查看日志 `docker logs -f portainer_agent` 输出 ```bash 2023/05/24 09:07AM FTL github.com/portainer/agent/cmd/agent/main.go:141 > unable to retrieve a list of IP associated to the host | error="lookup tasks. on 114.114.114.114:53: no such host" host=tasks. 2023/05/24 09:08AM INF github.com/portainer/agent/cmd/agent/main.go:86 > agent running on Docker platform | 2023/05/24 09:08AM INF github.com/portainer/agent/cmd/agent/main.go:101 > agent running on a Swarm cluster node. Running in cluster mode | 2023/05/24 09:08AM WRN github.com/portainer/agent/cmd/agent/main.go:112 > unable to retrieve agent container IP address, using host flag instead | error="unable to retrieve the address on which the agent can advertise. Check your network settings" host_flag=0.0.0.0 2023/05/24 09:08AM FTL github.com/portainer/agent/cmd/agent/main.go:141 > unable to retrieve a list of IP associated to the host | error="lookup tasks. on 114.114.114.114:53: no such host" host=tasks. ``` 查询资料后发现Portainer Agent 是默认使用Swarm模式。Docker Swarm是Docker的原生集群和编排解决方案,只有需要用到集群才会使用。我的使用场景用不上swarm,那么直接关闭swarm就可以了。 ```bash docker swarm leave --force ``` 关闭后再次连接已经全部正常。 最后修改:2023 年 05 月 25 日 © 允许规范转载 打赏 赞赏作者 如果觉得我的文章对你有用,请随意赞赏