Docker swarm只能在容器运行的节点上访问

时间:2017-07-10 16:41:27

标签: docker swarm

我目前正在3个节点上运行docker swarm。首先,我创建了网络

docker network create -d overlay xx_net

之后的服务

docker service create --network xxx_net --replicas 1 -p 12345:12345 --name nameofservice nameofimage:1

如果我读得正确,这就是路由网格(对我来说= ok)。但我只能访问容器正在运行的那个node-ip上的服务,即使它应该在每个节点ip上都可用。

如果我耗尽某个节点,容器会在不同的节点上启动,然后在新的ip上启用它。

**下面添加了更多信息:

  • 我重新启动了所有服务器 - 3名工作人员,其中他们是经理
  • 启动后,一切似乎都正常!
  • 我正在使用docker hub中的rabbitmq-image。 Dockerfile非常小:FROM rabbitmq:3-management容器已在worker 2
  • 启动
  • 我可以从所有工作人员连接到rabbitmq的管理页面:worker1-ip:15672,worker2-ip:15672,worker3-ip:15672,所以我认为所有需要的端口都是打开的。
  • 约1小时后,rabbitmq-container已从工人2搬到工人3 - 我不知道原因。
  • 之后我再也无法连接来自worker1-ip:15672,worker2-ip:15672但是来自worker3-ip:15672仍然有效!
  • 我将worker3排除为docker node update --availability drain worker3
  • 容器从worker1开始。
  • 之后我只能从worker1-ip:15672连接,而不再从worker2或worker3连接

更多一个测试: 所有工人都重新启动所有docker服务,所有工作都重新开始了吗?! - 让我们等几个小时......

今天的状态: 3个节点中的2个正常工作。在经理的服务日志上:

Jul 12 07:53:32 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:53:32.787953754Z" level=info msg="memberlist: Marking dockerswarmworker2-459b4229d652 as failed, suspect timeout reached"
Jul 12 07:53:39 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:53:39.787783458Z" level=info msg="memberlist: Marking dockerswarmworker2-459b4229d652 as failed, suspect timeout reached"
Jul 12 07:55:27 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:55:27.790564790Z" level=info msg="memberlist: Marking dockerswarmworker2-459b4229d652 as failed, suspect timeout reached"
Jul 12 07:55:41 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:55:41.787974530Z" level=info msg="memberlist: Marking dockerswarmworker2-459b4229d652 as failed, suspect timeout reached"
Jul 12 07:56:33 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:56:33.027525926Z" level=error msg="logs call failed" error="container not ready for logs: context canceled" module="node/agent/taskmanager" node.id=b6vnaouyci7b76ol1apq96zxx
Jul 12 07:56:33 dockerswarmmanager dockerd[7180]: time="2017-07-12T07:56:33.027668473Z" level=error msg="logs call failed" error="container not ready for logs: context canceled" module="node/agent/taskmanager" node.id=b6vnaouyci7b76ol1apq96zxx
Jul 12 08:13:22 dockerswarmmanager dockerd[7180]: time="2017-07-12T08:13:22.787796692Z" level=info msg="memberlist: Marking dockerswarmworker2-03ec8453a81f as failed, suspect timeout reached"
Jul 12 08:21:37 dockerswarmmanager dockerd[7180]: time="2017-07-12T08:21:37.788694522Z" level=info msg="memberlist: Marking dockerswarmworker2-03ec8453a81f as failed, suspect timeout reached"
Jul 12 08:24:01 dockerswarmmanager dockerd[7180]: time="2017-07-12T08:24:01.525570127Z" level=error msg="logs call failed" error="container not ready for logs: context canceled" module="node/agent/taskmanager" node.id=b6vnaouyci7b76ol1apq96zxx
Jul 12 08:24:01 dockerswarmmanager dockerd[7180]: time="2017-07-12T08:24:01.525713893Z" level=error msg="logs call failed" error="container not ready for logs: context canceled" module="node/agent/taskmanager" node.id=b6vnaouyci7b76ol1apq96zxx

来自工人的码头日志:

Jul 12 08:20:47 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:20:47.486202716Z" level=error msg="Bulk sync to node h999-99-999-185.scenegroup.fi-891b24339f8a timed out"
Jul 12 08:21:38 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:38.288117026Z" level=warning msg="memberlist: Refuting a dead message (from: h999-99-999-185.scenegroup.fi-891b24339f8a)"
Jul 12 08:21:39 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:39.404554761Z" level=warning msg="Neighbor entry already present for IP 10.255.0.3, mac 02:42:0a:ff:00:03"
Jul 12 08:21:39 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:39.404588738Z" level=warning msg="Neighbor entry already present for IP 104.198.180.163, mac 02:42:0a:ff:00:03"
Jul 12 08:21:39 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:39.404609273Z" level=warning msg="Neighbor entry already present for IP 10.255.0.6, mac 02:42:0a:ff:00:06"
Jul 12 08:21:39 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:39.404622776Z" level=warning msg="Neighbor entry already present for IP 104.198.180.163, mac 02:42:0a:ff:00:06"
Jul 12 08:21:47 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:21:47.486007317Z" level=error msg="Bulk sync to node h999-99-999-185.scenegroup.fi-891b24339f8a timed out"
Jul 12 08:22:47 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:22:47.485821037Z" level=error msg="Bulk sync to node h999-99-999-185.scenegroup.fi-891b24339f8a timed out"
Jul 12 08:23:17 dockerswarmworker2 dockerd[677]: time="2017-07-12T08:23:17.630602898Z" level=error msg="Bulk sync to node h999-99-999-185.scenegroup.fi-891b24339f8a timed out"

这一个来自工人:

Jul 12 08:33:09 h999-99-999-185.scenegroup.fi dockerd[10330]: time="2017-07-12T08:33:09.219973777Z" level=warning msg="Neighbor entry already present for IP 10.0.0.3, mac xxxxx"
Jul 12 08:33:09 h999-99-999-185.scenegroup.fi dockerd[10330]: time="2017-07-12T08:33:09.220539013Z" level=warning msg="Neighbor entry already present for IP "managers ip here", mac xxxxxx"

我重新启动了有问题的工人的docker,它又开始工作了。 我会跟着......

**今天的结果:

  • 有2名工人可用,一名不是
  • 我没有一件事
  • 4小时后“独自一人”,所有似乎都有效了?!
  • 由于任何理由,
  • 服务已从工人转移到其他服务,所有结果似乎都与沟通有关。
  • 非常混乱。

1 个答案:

答案 0 :(得分:0)

升级到docker 17.06

Ingress覆盖网络很长一段时间被打破,直到大约17.06-rc3