Getting Kibana docker image to connect to ES

I have an elasticsearch cluster running in docker using the elastic images. The cluster responds to request from my localhost. I downloaded the kibana docker image and I can't get it to connect to elasticsearch.

I get the following errors:

kibana_1  | {"type":"log","@timestamp":"2020-06-02T15:59:16Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
kibana_1  | {"type":"log","@timestamp":"2020-06-02T15:59:16Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}

I've tried http://localhost:9200, http://127.0.0.1:9200, and http://es01:9200 for my elasticsearch_hosts. Here is my yaml:

version: '2.2'
services:

  kibana:
    image: docker.elastic.co/kibana/kibana:7.7.0
    environment:
      SERVER_NAME: kibana.example.org
      ELASTICSEARCH_HOSTS: http://127.0.0.1:9200
    ports:
      - 127.0.0.1:5601:5601
    networks:
      - elastic
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 127.0.0.1:9200:9200
    networks:
      - elastic
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/usr/share/elasticsearch/data
    networks:
      - elastic
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic

volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local

networks:
  elastic:
    driver: bridge

I tried http://es01:9200 again and it looks like it is working. It looks like that URL is supposed to be a container name.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.