# Elasticsearch and logstash inside docker - connection refused

**URL:** <https://discuss.elastic.co/t/elasticsearch-and-logstash-inside-docker-connection-refused/201703>\
**Category:** Elasticsearch\
**Created:** [October 1, 2019, 12:29am UTC](https://discuss.elastic.co/t/elasticsearch-and-logstash-inside-docker-connection-refused/201703 "2019-10-01T00:29:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nxns1](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nxns1](https://discuss.elastic.co/u/nxns1)\
**Post date:** [October 1, 2019, 12:29am UTC](https://discuss.elastic.co/t/elasticsearch-and-logstash-inside-docker-connection-refused/201703/1 "2019-10-01T00:29:10Z")

</div>

Hello, I have a logstash image on a docker container, and elasticsearch on a different host (xx.xx.xx.xx). My config files look like this:

- docker-compose.yml

- logstash.conf

On elasticsearch.yml, everything is commented out.

I'm getting the following error on Logstash:

`[2019-09-30T23:13:30,269][WARN][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://xx.xx.xx.xx:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://xx.xx.xx.xx:9200/][Manticore::SocketException] Connection refused (Connection refused)"}`

Not sure what the problem is. Do I need to add network.host on elasticsearch.yml, or if this setup is enough? Also, not sure if port binding is needed since logstash is in docker?

---

<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 29, 2019, 12:29am UTC](https://discuss.elastic.co/t/elasticsearch-and-logstash-inside-docker-connection-refused/201703/2 "2019-10-29T00:29:26Z")

</div>

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