# Logstash unable to reach Elasticsearch: port issues

**URL:** <https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [July 14, 2020, 7:57pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187 "2020-07-14T19:57:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulnama](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rahulnama](https://discuss.elastic.co/u/rahulnama)\
**Post date:** [July 14, 2020, 7:57pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/1 "2020-07-14T19:57:13Z")

</div>

Hello Team

I deployed Elasticsearch on Kubernetes and it's working fine. Also, I created an ingress so it's redirecting from 80 =\> 9200. But logstash is looking for 9200 so connection is failing.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/8/4866c742b2df6bcd267ef0f043b47339ed6c0ff4.png)

However, if I try [http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200](http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200) it's giving me error but [http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io](http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io) is working fine as we can see in the above figure

logstash.conf: -- elasticsearch host setting

xpack.monitoring.elasticsearch.hosts: ["[http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io](http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io)" ]

**logstash logs:**

> [2020-07-14T19:51:57,137][WARN][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error. {:url=\>"[http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/](http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/)", :error\_type=\>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :error=\>"**Elasticsearch Unreachable: [[http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/](http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/)]**[Manticore::SocketException] Connection refused (Connection refused)"}

**How to make logstash look for [http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io](http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io) instead of [http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200](http://elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200)**

please let me know.

Thank you

-Rahul  
`

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 14, 2020, 8:05pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/2 "2020-07-14T20:05:40Z")

</div>

> [@rahulnama](#):
>
> url=\>"[http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/](http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/)"

If that is the url you configured in the hosts option of the elasticsearch output then just change 9200 to 80.

---

<div class="post-metadata">

**Author:** ![rahulnama](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rahulnama](https://discuss.elastic.co/u/rahulnama)\
**Post date:** [July 14, 2020, 8:07pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/3 "2020-07-14T20:07:49Z")

</div>

Hi @Badger

Thank you the response.

I tried that as well in logstash config. No matter what logstash is looking for **:9200**.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 14, 2020, 8:27pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/4 "2020-07-14T20:27:42Z")

</div>

Is the elasticsearch output looking for 9200, or is xpack monitoring or the licence checker looking for 9200?

---

<div class="post-metadata">

**Author:** ![rahulnama](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rahulnama](https://discuss.elastic.co/u/rahulnama)\
**Post date:** [July 14, 2020, 8:28pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/5 "2020-07-14T20:28:21Z")

</div>

Hi @Badger  
when I update conf with :80 instead of :9200

at first it connected. here is the log

`[2020-07-14T20:18:13,047][WARN][logstash.licensechecker.licensereader] Restored connection to ES instance {:url=>"http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:80/"}`

and then immediately I see this updating. log:

`[2020-07-14T20:18:17,864][INFO][logstash.outputs.elasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elastic:xxxxxx@elasticsearch.phoenix-alfresco.10.85.77.116.xip.io:9200/]}}`

I believe this is x-pack issue. Any suggestions here ?

---

<div class="post-metadata">

**Author:** ![rahulnama](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rahulnama](https://discuss.elastic.co/u/rahulnama)\
**Post date:** [July 14, 2020, 8:38pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/6 "2020-07-14T20:38:04Z")

</div>

Hi @Badger

As you said changing the elasticsearch output in logstash.yml file to http://elasticsearch\_url:80 solved this issue. So far I have been updating it in logstash.conf file.

Thank you 🙂

Best  
Rahul

---

<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:** [August 11, 2020, 8:38pm UTC](https://discuss.elastic.co/t/logstash-unable-to-reach-elasticsearch-port-issues/241187/7 "2020-08-11T20:38:10Z")

</div>

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