# Elastic cluster is unreachable - Logstash with docker

**URL:** <https://discuss.elastic.co/t/elastic-cluster-is-unreachable-logstash-with-docker/284964>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [September 23, 2021, 7:02am UTC](https://discuss.elastic.co/t/elastic-cluster-is-unreachable-logstash-with-docker/284964 "2021-09-23T07:02:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rashmika\_Gamage](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmika_gamage/32/88321_2.png) [@Rashmika\_Gamage](https://discuss.elastic.co/u/Rashmika_Gamage)\
**Post date:** [September 23, 2021, 7:02am UTC](https://discuss.elastic.co/t/elastic-cluster-is-unreachable-logstash-with-docker/284964/1 "2021-09-23T07:02:25Z")

</div>

I have created a ELK cluster with 3 elastic nodes with docker compose. I am getting an error from logstash. I have been trying with several ways. Appreciate you help.

My docker-compose.yml

```auto
version: '2.2'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-alpha2
    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
      - xpack.security.enabled=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic

  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-alpha2
    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
      - xpack.security.enabled=false
      - "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:8.0.0-alpha2
    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
      - xpack.security.enabled=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic

  kib01:
    image: docker.elastic.co/kibana/kibana:8.0.0-alpha2
    container_name: kib01
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://es01:9200
      ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200"]'
    networks:
      - elastic
      
  logstash:
    image: docker.elastic.co/logstash/logstash:8.0.0-alpha2
    ports:
      - 5000:5000
    environment:
      ELASTICSEARCH_URL: http://es01:9200
      ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200"]'
    volumes:
      - type: bind
        source: /home/cloudera/logstash-pipeline
        target: /usr/share/logstash/pipeline
        read_only: true

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

networks:
  elastic:

    driver: bridge

```

Logstash.conf file

```auto

input {
  beats {
    port => 5044
  }
}

filter {
   grok {
     match => { "message" => "%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}" }
   }
}

output {
  elasticsearch {
    hosts => ["192.168.85.175:9200"]
        index => "log_1"
  }
  stdout {}
}

```

---

<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:** [October 21, 2021, 7:03am UTC](https://discuss.elastic.co/t/elastic-cluster-is-unreachable-logstash-with-docker/284964/2 "2021-10-21T07:03:22Z")

</div>

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