4

I currently have 3 EC2 instances setup with Docker Swarm and Consul. I have 3 simple node apps spread across all 3 instances, and then nginx for routing on my swarm master.

Using the guide for Overlay Networks, I've created a new overlay called mynetand have every container connected to this network. Using docker inspect I can confirm that each node container and the nginx container all are connected to mynet and have an IP. However, after sshing in to my nginx container, it's only able to communicate with the node app that sits on the same host through the network, and not the ones on the other hosts in the cluster.

运行后docker network inspect mynet,只列出了我的两个容器(位于同一主机上的 nginx 和一个节点实例),而其他两个未列出,即使它们具有来自docker inspect.

这个想法是使用nginx 反向代理将任何上线的新容器添加到它的配置中,但我坚持让容器全部连接。根据用于覆盖的 Docker 网络文档,这应该是可能的。

我究竟做错了什么?谢谢。

编辑:

在发送了几次垃圾邮件之后docker network inspect mynet,看起来容器不断地连接和断开网络,即使我关闭了所有防火墙并打开了端口以进行测试。什么会导致这样的事情?

4

1 回答 1

3

原来有两个问题导致了我的问题。

一是我使用的docker network overlay是不支持的内核 3.13。升级到 3.16 解决了这个问题。其次是 Swarm 1.0.1 中存在一个错误,它可以正确聚合网络信息。它已在此处修复,但截至撰写本文时尚未发布。

于 2015-12-23T20:17:54.747 回答