Error connecting to elasticsearch hosted on AWS via AWS EC2 instance


Can anyone please help me with an issue I am facing with regards to connecting to elasticsearch hosted on AWS. I am using the High level Rest client to make requests and running the java application as Jar.

Error that I am currently running into: Connection refused
at org.elasticsearch.client.RestClient$SyncResponseListener.get(
at org.elasticsearch.client.RestClient.performRequest(
at org.elasticsearch.client.RestHighLevelClient.performRequest(
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(
at org.elasticsearch.client.RestHighLevelClient.get(
at org.onlineadvocate.elasticload.LoadTimeService.getLoadTime(
at org.onlineadvocate.elasticload.ElasticSearchLoader.getLastLoadTime(
at org.onlineadvocate.elasticload.ElasticSearchLoader.loadSiteResourcesIntoElastic(
at org.onlineadvocate.elasticload.SiteLoader.loadSites(
at org.onlineadvocate.elasticload.SiteLoaderMain.main(
Caused by: Connection refused
at Method)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$

However, I was able to successfully make curl requests from the EC2 instance and receive successful response.

Thanks for your help.

Are you hosting it yourself?

May be share node logs and your code.
Formatted please so it's readable

I am not hosting the elasticsearch . We are using the AWS Elasticsearch service and unfortunately I don't have any node logs and cannot share the source code. We use High level Rest client to make requests and it runs just fine, if I make requests as part of War vs Jar.

I can't help then.

BTW did you look at and ?

Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL and what is coming like Canvas...

I'm using this one with the HLRest Client without any problem.

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