Skip to content
Advertisement

Connecting to ES with Spring Data Elasticsearch (reactive) gives error host not reachable

I’m running on an aws-elasticsearch (with OpenSearch 1.1.x) service and im trying to connect with it from a spring application using spring-data-elasticsearch, according to the doc i configured the bean as it says.

on my local i used a ssh tunnel from my aws account.

i used this command:

JavaScript

so i can connect with OpenSearch dashboard over localhost in my browser through port 9200.

Using the OpenSearch RestHighLevelClient from OpenSearch and disabling the ssl i can connect and it works just fine here the config with OS RHLC:

JavaScript

, but when i try with spring and its reactive client i get this error:

JavaScript

here is the config i used to work with spring-data-elasticsearch:

JavaScript

i also tried some solutions other people posted here on SO and Github, but the problem persists, does anybody have a workaround for this? what am i doing wrong?

here i did a demo for the trouble

Thank you very much in advance!

EDIT: clarity

Advertisement

Answer

You have to configure to use SSL for the reactive client with one of the usingSsl()methods:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement