# Logstash losing connection to elastic intermittently

**URL:** https://discuss.elastic.co/t/logstash-losing-connection-to-elastic-intermittently/172042
**Category:** Logstash
**Created:** [March 13, 2019, 1:43am UTC](https://discuss.elastic.co/t/logstash-losing-connection-to-elastic-intermittently/172042 "2019-03-13T01:43:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Saurav\_Sen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurav_sen/32/54025_2.png) [@Saurav\_Sen](https://discuss.elastic.co/u/Saurav_Sen)
#### Post date: [March 13, 2019, 1:43am UTC](https://discuss.elastic.co/t/logstash-losing-connection-to-elastic-intermittently/172042/1 "2019-03-13T01:43:35Z")

</div>

I am running Elastic stack on Docker swarm with xpac monitoring enabled. Everything is running fine with the cluster status as green.

**Data Nodes** : 4  
**Ingest Nodes** : 4  
**logstash nodes** : 4

but when I tail the logs for logststash, I keep getting these message very regularly complaining about **Host Unreachable**

```auto
[WARN][logstash.outputs.elasticsearch] Marking url as dead. Last error: [LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError] Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::SocketException] Connection reset {:url=>http://elasticsearch:9200/, :error_message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::SocketException] Connection reset", :error_class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError"}

[ERROR][logstash.outputs.elasticsearch] Attempted to send a bulk request to elasticsearch' but Elasticsearch appears to be unreachable or down! {:error_message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::SocketException] Connection reset", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError", :will_retry_in_seconds=>2}

[INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elasticsearch:9200/, :path=>"/"}

[WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://elasticsearch:9200/"}

```

I have checked the Xpac monitoring from kibana and everything seems to be fine. All the containers are running fine with no restarts. If i curl to elastic from the logstash container, it always returns a response. I dont find any way to find why this error is coming up.

I dont see similar errors in kibana, heartbeat or apm-server logs. If someone can help identify the source of this problem it would be very helpful.

---

<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: [April 10, 2019, 1:43am UTC](https://discuss.elastic.co/t/logstash-losing-connection-to-elastic-intermittently/172042/2 "2019-04-10T01:43:36Z")

</div>

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