2016-07-28 84 views
1

我有幾個服務搬運工,撰寫文件:泊塢窗組成縮減和領事

services: 
    consul: 
    image: consul:latest 
    ports: 
     - "8300:8300" 
     - "8301:8301" 
     - "8302:8302" 
     - "8400:8400" 
     - "8500:8500" 
     - "8600:53/udp"  
    command: "agent -server -ui -bootstrap-expect=1 -client=0.0.0.0" 
microservice1: 
    image: xxx:latest 
    ports: 
    - "8080" 
microservice2: 
    image: yyy:latest 
    ports: 
    - "8080" 

服務註冊成功的領事,健康檢查在流逝。 我放大一個微服務: 碼頭 - 組成微服務1 = 3

所有新的容器都正確顯示在領事。

但是,當我按比例縮小的microService我在領事橙色狀態和日誌都出現了這樣的事情:

2016年7月28日18時58分38秒[WARN]代理:HTTP請求失敗 'http://27dd6662f944:8080/health':獲取 http://27dd6662f944:8080/health:撥打TCP:查找27dd6662f944上 127.0.0.11:53:沒有這樣的主機

有誰知道如何解決這個問題?

回答

0

我找到了解決辦法:

services: 
    consul: 
    **hostname: consul** 
    image: consul:latest 
    ports: 
     - "8300:8300" 
     - "8301:8301" 
     - "8302:8302" 
     - "8400:8400" 
     - "8500:8500" 
     - "8600:53/udp"  
    command: "agent -server -ui -bootstrap-expect=1 -client=0.0.0.0" 
microservice1: 
    image: xxx:latest 
    ports: 
    - "8080" 
microservice2: 
    image: yyy:latest 
    ports: 
    - "8080" 

添加主機名領事圖像...