# \[Errno 111\] Connection refused): ConnectionError elasticsearch

**URL:** <https://discuss.elastic.co/t/errno-111-connection-refused-connectionerror-elasticsearch/212873>\
**Category:** Elasticsearch\
**Created:** [December 23, 2019, 5:06pm UTC](https://discuss.elastic.co/t/errno-111-connection-refused-connectionerror-elasticsearch/212873 "2019-12-23T17:06:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![urketadic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/urketadic/32/27048_2.png) [@urketadic](https://discuss.elastic.co/u/urketadic)\
**Post date:** [December 23, 2019, 5:06pm UTC](https://discuss.elastic.co/t/errno-111-connection-refused-connectionerror-elasticsearch/212873/1 "2019-12-23T17:06:41Z")

</div>

I was following this tutorial:

> **[Building a Near Real-Time Discovery Platform with AWS | Amazon Web Services](https://aws.amazon.com/blogs/big-data/building-a-near-real-time-discovery-platform-with-aws/)**
>
> Assaf Mentzer is a Senior Consultant for AWS Professional Services In the spirit of the U.S presidential election of 2016, in this post I use Twitter public streams to analyze the candidates’ performance, both Republican and Democrat, in a near...

It all works fine but the part where lambda pushes data from S3 to Elasticsearch fails.  
This is the error and some warnings:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/8/9/89ccf69ab2a5f53d089541af9b53f7d7e0e921fd.png)

On top of this it used to also say Error loading data into Elasticsearch but that error is now gone after i turned off HTTPS only encryption setting on ES.

I don't think there is anthing wrong with lambda exe role:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/f/0/f0edd96dd2055e8cb467a241f1942b7a85667360.png)  
It has access to read and write S3. And my ES had public access.

So what could cause this error?

curl -X GET ES:80 returns fine.

---

<div class="post-metadata">

**Author:** ![urketadic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/urketadic/32/27048_2.png) [@urketadic](https://discuss.elastic.co/u/urketadic)\
**Post date:** [December 23, 2019, 5:42pm UTC](https://discuss.elastic.co/t/errno-111-connection-refused-connectionerror-elasticsearch/212873/2 "2019-12-23T17:42:42Z")

</div>

Alright after removing public access (which i have done because i made this post) and only allowing access to my account, im now getting this error:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2af5bc5a220d5291da3fade8f16bf38bd53ccbae.png)

I would still like to know why public access was throwing connection errors.

EDIT: I just had a bad understanding of what public access means.  
Also new error above is fixed by downgrading to ES version 6.x

(you can delete this thread)

---

<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:** [January 20, 2020, 5:42pm UTC](https://discuss.elastic.co/t/errno-111-connection-refused-connectionerror-elasticsearch/212873/3 "2020-01-20T17:42:44Z")

</div>

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