# Kibana Error Connecting to ES on Docker - Cannot Revive Connection

**URL:** https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335
**Category:** Kibana
**Created:** [May 25, 2018, 2:58pm UTC](https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335 "2018-05-25T14:58:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chrisruel](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chrisruel](https://discuss.elastic.co/u/chrisruel)
#### Post date: [May 25, 2018, 2:58pm UTC](https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335/1 "2018-05-25T14:58:15Z")

</div>

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/](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
```

---

<div class="post-metadata">

### Author: ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)
#### Post date: [May 25, 2018, 4:40pm UTC](https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335/2 "2018-05-25T16:40:42Z")

</div>

Your Elasticsearch container name is `elasticsearch-products-624`. Kibana's Elasticsearch URL should match - change to `http://elasticsearch-products-624:9200`.

More info:

> [@Kibana docker image doesn't connect to elasticsearch image](https://discuss.elastic.co/t/kibana-docker-image-doesnt-connect-to-elasticsearch-image/79511/4):
>
> Hi. This one is all about [Docker Networking](https://docs.docker.com/engine/userguide/networking/). There are some steps involved in getting Docker to establish network links and name resolution between containers. It's one of the reasons I tend to recommend getting started with Docker Compose, since it takes care of some of these details. The Kibana image tries, by default, to connect to a host/container called elasticsearch. However, the Docker operator must arrange for that name to make sense, and for there to be a network connection between th…

---

<div class="post-metadata">

### Author: ![chrisruel](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chrisruel](https://discuss.elastic.co/u/chrisruel)
#### Post date: [May 25, 2018, 6:39pm UTC](https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335/3 "2018-05-25T18:39:48Z")

</div>

jen-huang - That did fix the connection problem and thanks for the reference. I am working through this to understand exactly this type of connectivity configuration and what each element in the yml actually refers. Too many of the examples just name everything "elasticsearch" and "kibana" and so when I need to build more complex configurations that require different names for different instances, the examples do not make clear what names they actually refer.  
Thanks for your help!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 22, 2018, 6:39pm UTC](https://discuss.elastic.co/t/kibana-error-connecting-to-es-on-docker-cannot-revive-connection/133335/4 "2018-06-22T18:39:49Z")

</div>

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