# Cluster ES with Docker-compose Does Not Recognize an Image

**URL:** <https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522>\
**Category:** Elasticsearch\
**Created:** [November 26, 2019, 1:30pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522 "2019-11-26T13:30:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbrodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rbrodrigues/32/56358_2.png) [@rbrodrigues](https://discuss.elastic.co/u/rbrodrigues)\
**Post date:** [November 26, 2019, 1:30pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522/1 "2019-11-26T13:30:29Z")

</div>

I have the following docker-compose.yml file, all images go up, but Kibana can't find ES, is there any wrong setting in the file?

```
version: '2.2'
services:

es01:
    image: rbrodrigues/elasticseach:7.1.0
    container_name: es01
    environment:
        - node.name=es01
        - node.master=true
        - discovery.seed_hosts=es02
        - cluster.initial_master_nodes=es01,es02
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
        memlock:
            soft: -1
            hard: -1
    volumes:
        - esdata01:/usr/share/elasticsearch/data
    ports:
        - 9200:9200
    networks:
        - esnet
        
es02:
    image: rbrodrigues/elasticseach:7.1.0
    container_name: es02
    environment:
        - node.name=es02            
        - discovery.seed_hosts=es01
        - cluster.initial_master_nodes=es01,es02
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
        memlock:
            soft: -1
            hard: -1
    volumes:
        - esdata02:/usr/share/elasticsearch/data
    networks:
        - esnet

kibana:
    image: docker.elastic.co/kibana/kibana:7.1.0
    container_name: kibana
    environment:            
        - SERVER_HOST=0.0.0.0
    ports:
        - 5601:5601
    depends_on: 
        - es01
    networks:
        - esnet

volumes:
esdata01:
    driver: local
esdata02:
    driver: local

networks:
esnet:
    driver: bridge
```

---

<div class="post-metadata">

**Author:** ![MiTschMR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitschmr/32/48254_2.png) [@MiTschMR](https://discuss.elastic.co/u/MiTschMR)\
**Post date:** [November 26, 2019, 1:36pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522/2 "2019-11-26T13:36:26Z")

</div>

Hi @rbrodrigues

How does Kibana know to which address and port it should connect? You are missing the most important environment setting:

```auto
ELASTICSEARCH_HOSTS="<array of hosts>"

```

I am not using the SERVER\_HOST variable, I think you can go without it. As for the address, you could probably use `http://localhost:9200`. Try it out and tell us how it goes.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 26, 2019, 1:44pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522/3 "2019-11-26T13:44:04Z")

</div>

Here is the configuration I'm using:

```auto
---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:7.4.2
    ports: ['5601:5601']
    networks: ['stack']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']

networks:
  stack: {}

```

HTH

---

<div class="post-metadata">

**Author:** ![rbrodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rbrodrigues/32/56358_2.png) [@rbrodrigues](https://discuss.elastic.co/u/rbrodrigues)\
**Post date:** [November 26, 2019, 5:43pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522/4 "2019-11-26T17:43:15Z")

</div>

It worked. My final file looked like this:

```
version: '2.2'
services:
    
    elasticseach_01:
        image: rbrodrigues/elasticseach:7.1.0
        container_name: elasticseach_01
        environment:
            - http.host=0.0.0.0
            - transport.host=0.0.0.0
            - node.name=elasticseach_01
            - node.master=true
            - discovery.seed_hosts=elasticseach_01,elasticseach_02
            - cluster.initial_master_nodes=elasticseach_01
            - cluster.name=elasticseach_cluster
            - bootstrap.memory_lock=true
            - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
            memlock:
                soft: -1
                hard: -1
        volumes:
            - elasticseach_data_01:/usr/share/elasticsearch/data
            - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
        ports:
            - 9200:9200
            - 9300:9300
        networks:
            - elasticseach_network
        cap_add:
            - IPC_LOCK
    
    elasticseach_02:
        image: rbrodrigues/elasticseach:7.1.0
        container_name: elasticseach_02
        environment:
            - http.host=0.0.0.0
            - transport.host=0.0.0.0
            - node.name=elasticseach_02            
            - discovery.seed_hosts=elasticseach_01
            - cluster.initial_master_nodes=elasticseach_01,elasticseach_02
            - cluster.name=elasticseach_cluster
            - bootstrap.memory_lock=true
            - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
            memlock:
                soft: -1
                hard: -1
        volumes:
            - elasticseach_data_02:/usr/share/elasticsearch/data
            - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
        networks:
            - elasticseach_network
        cap_add:
            - IPC_LOCK

    kibana:
        image: docker.elastic.co/kibana/kibana:7.1.0
        container_name: kibana
        environment:            
            - server.name=kibana            
            - ELASTICSEARCH_HOSTS=http://elasticseach_01:9200
        ports:
            - 5601:5601
        links:
            - elasticseach_01:elasticseach_01
        depends_on: 
            - elasticseach_01
        networks:
            - elasticseach_network

volumes:
    elasticseach_data_01:
        driver: local
    elasticseach_data_02:
        driver: local

networks:
    elasticseach_network:
        ipam:
            driver: bridge
            config:
                - subnet: 192.168.144.0/15
                - gateway: 10.5.0.1
```

---

<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:** [December 24, 2019, 5:43pm UTC](https://discuss.elastic.co/t/cluster-es-with-docker-compose-does-not-recognize-an-image/209522/5 "2019-12-24T17:43:16Z")

</div>

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