12
votes

I am getting an error attempting to connect Kibana to ES using Docker containers:

kibana-products-624 | {"type":"log","@timestamp":"2018-05-25T14:56:36Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://elasticsearch:9200/"} kibana-products-624 | {"type":"log","@timestamp":"2018-05-25T14:56:36Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}

I have tried a number of variations in the environment settings and other configuration for the yml, but continue to get this error.

I have verified that ElasticSearch is running and available at port 9200 using CURL and a browser.

What is wrong with this configuration?

Here is the docker-compose.yml:

version: "3"

volumes:
elasticsearch-products-624-vol:

networks:
elasticsearch-net-624:

services:

elasticsearch-products-624-service:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
    container_name: elasticsearch-products-624
    restart: always
    networks:
    - elasticsearch-net-624
    environment:
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        - xpack.security.enabled=true
    ulimits:
        memlock:
            soft: -1
            hard: -1
    ports:
    - "9200:9200"
    expose:
    - "9200"
    volumes:
    - elasticsearch-products-624-vol:/usr/share/elasticsearch/data

kibana-products-624-service:
    image: docker.elastic.co/kibana/kibana:6.2.4
    container_name: kibana-products-624
    hostname: kibana
    restart: always
    networks:
    - elasticsearch-net-624
    environment:
    - SERVER_NAME=kibana.localhost
    - ELASTICSEARCH_URL=http://elasticsearch:9200
    - ELASTICSEARCH_USERNAME=elastic
    - ELASTICSEARCH_HOST=elasticsearch
    - ELASTICSEARCH_PORT=9200
    - ELASTIC_PWD=changeme
    - KIBANA_PWD=changeme
    ports:
    - "5601:5601"
    expose:
    - "5601"
    links:
    - elasticsearch-products-624-service
    depends_on:
    - elasticsearch-products-624-service
1
What happens when you exec 'curl elasticsearch:9200/_cat/health...' from the Kibana container? Mostly looking to verify networking & port accessibility.Paul Back
1527271075 17:57:55 docker-cluster green 1 1 1 1 0 0 0 0 - 100.0% That is from localhost:9200/...Chris
$ docker container exec -i kibana-products-624 curl elasticsearch:9200/_cat/health % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: elasticsearch; Name or service not knownChris
$ docker container exec -i kibana-products-624 curl localhost:9200/_cat/health % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to ::1: Cannot assign requested addressChris

1 Answers

12
votes

ELASTICSEARCH_URL=http://elasticsearch:9200 should be changed to: ELASTICSEARCH_URL=http://elasticsearch-products-624:9200 to refer to the container that was instantiated above.