2

docker を使用して cadvisor を elasticsearch に接続しようとしていますが、次のエラーが表示されます。

cadvisor.go:113] Failed to initialize storage driver: failed to create the elasticsearch client - no Elasticsearch node available

docker-compose.yml

version: '2'
services:
elasticsearch:
    image: "elasticsearch:2.3.3"
    container_name: "elasticsearch"
    ports:
        - "9200:9200"
kibana:
    image: "kibana:4.5.1"
    container_name: "kibana"
    ports:
        - "5601:5601"
    links:
        - elasticsearch
cadvisor:
    image: "google/cadvisor:latest"
    container_name: "cadvisor"
    ports:
        - "8080:8080"
    volumes:
        - /:/rootfs:ro
        - /var/run:/var/run:rw
        - /sys:/sys:ro
        - /var/lib/docker/:/var/lib/docker:ro
    links:
        - elasticsearch
    restart: always
    command: -storage_driver="elasticsearch" -storage_driver_es_host="http://elasticsearch:9200"

コマンドを次のように変更すると

command: -storage_driver="elasticsearch" -storage_driver_es_host="http://172.22.0.5:9200"

すべてがうまく機能します。何か案は?

4

1 に答える 1