2017-07-10 156 views
0

我目前在3個節點上運行docker swarm。首先,我創建了網絡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的所有worker的管理頁面: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

一個測試多種:重新啓動所有工人 所有碼頭工人的服務,一切工作再次? - 讓我們等幾個小時...

今天的狀態: 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" 

我重新啓動泊塢窗上有問題的工人,並開始再次工作。 我會在下面......

**今天的成績:

  • 可用的工人的2,一個不
  • 我沒有一件事
  • 4小時後「獨蜂擁而上「,都似乎再次合作?!
  • 由於任何理由,服務已經從工作人員轉移到其他人,所有結果似乎都是溝通問題。
  • 很混亂。
+0

您運行的是什麼版本的泊塢窗,以及在什麼平臺上? – BMitch

+0

對不起,忘了添加... Docker版本17.05.0-ce,build 89658be和​​平臺都是centos7 – ajlind

+0

你有沒有配置防火牆,iptables或外部?端口4789/udp和7946 /都已打開? – BMitch

回答

0

升級到泊塢窗17.06

入口覆蓋網絡被打破很長一段時間,直到約17.06-RC3

相關問題