2016-07-28 6 views
1

Ich habe Docker-compose Datei mit mehreren Diensten:Docker komponieren Verkleinerung und Konsul

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" 

Services auf Consul erfolgreich registriert, Gesundheitscheck ist vorbei. Ich skaliere einen Microservice: docker-komponieren up microservice1 = 3

alle neuen Container werden ordnungsgemäß in Konsul gezeigt.

Aber, wenn ich Micro verkleinere ich Orange Status in Consul haben und Protokolle so etwas wie dieses zeigen:

2016/07/28 18:58:38 [Warnen] agent: http request failed 'http://27dd6662f944:8080/health': Get http://27dd6662f944:8080/health: dial tcp: Nachschlag 27dd6662f944 auf 127.0.0.11:53: keine solche Host

weiß jemand, wie diese zu lösen?

Antwort

0

gefunden Lösung:

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" 

hinzufügen Hostnamen für Konsul Bild ...