【发布时间】:2017-09-09 08:20:53
【问题描述】:
我使用 5 台 Ubuntu 16.04 服务器在 Digital Ocean 上建立了一个集群。他们都使用相同的 Docker 引擎版本和防火墙规则。设置为使用 3 个管理员。
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:01:32 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:01:32 2017
OS/Arch: linux/amd64
Experimental: false
22 ALLOW Anywhere
Anywhere/esp on eth1 ALLOW Anywhere/esp
2377/tcp on eth1 ALLOW Anywhere
7946 on eth1 ALLOW Anywhere
4789 on eth1 ALLOW Anywhere
2376/tcp ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
Anywhere/esp (v6) on eth1 ALLOW Anywhere/esp (v6)
2377/tcp (v6) on eth1 ALLOW Anywhere (v6)
7946 (v6) on eth1 ALLOW Anywhere (v6)
4789 (v6) on eth1 ALLOW Anywhere (v6)
2376/tcp (v6) ALLOW Anywhere (v6)
app01 Ready Active
app04 Ready Active Reachable
app03 Ready Active Reachable
app06 Ready Active Leader
app05 Ready Active
我正在为我的服务使用加密网络。
[
{
"Name": "jupiter",
"Id": "en4gdr54yw4w2xmo34fttdbvg",
"Created": "0001-01-01T00:00:00Z",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": []
},
"Internal": false,
"Attachable": false,
"Containers": null,
"Options": {
"com.docker.network.driver.overlay.vxlanid_list": "4097",
"encrypted": "true"
},
"Labels": null
}
]
我创建了我的群体以驻留在eth1。例如:docker swarm init --listen-addr eth1:2377 --advertise-addr eth1:2377。
尽管进行了此设置,但我的 3 个服务无法看到彼此。好像 DNS 在 swarm 内部不起作用。我找到了this link on github,它描述了发生在我身上的事情。
我的一个服务尝试使用 mongo servicename:port 连接到 mongo 服务。但是由于服务连接无法到达 mongo 它失败了。现在我尝试通过使用https://hub.docker.com/r/nicolaka/netshoot/ 连接容器内部来解决容器问题,结果表明容器可以交互。 (但我不认为它是通过为它设置的加密进行连接的。)
我认为它一定是防火墙,但我不是网络安全方面的专家,所以我想知道我是否遗漏了什么。我试图将我所拥有的内容与 issue 26523 中关于他们的防火墙所写的内容进行比较。
无论如何,我决定创建另一个未加密的网络并将我的服务放在上面。
现在 mongo 正在接收连接:
2017-07-17T14:17:53.267+0000 I NETWORK [conn8] received client metadata from 10.0.1.7:33424 conn8: { driver: { name: "nodejs", version: "2.2.29" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.4.0-62-generic" }, platform: "Node.js v6.11.1, LE, mongodb-core: 2.1.13" }
2017-07-17T14:17:53.369+0000 I NETWORK [thread1] connection accepted from 10.0.1.7:33426 #9 (3 connections now open)
2017-07-17T14:17:53.373+0000 I NETWORK [conn9] received client metadata from 10.0.1.7:33426 conn9: { driver: { name: "nodejs", version: "2.2.29" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.4.0-62-generic" }, platform:
我想弄清楚如何让加密网络正常工作。是防火墙,在我看来是,还是 Ubuntu 服务器缺少一个包? ;
【问题讨论】:
标签: docker docker-swarm