spring-projects / spring-data-elasticsearch

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-elasticsearch/
Apache License 2.0
2.92k stars 1.33k forks source link

Configuring Spring Data Elasticsearch to Connect to Two Clusters #2909

Closed jayashri112830 closed 6 months ago

jayashri112830 commented 6 months ago

In our application, we need to maintain connections to two Elasticsearch clusters. According to the Spring Data Elasticsearch documentation, it's possible to connect to only one cluster by default. Is there a way to connect to two clusters in the same application? If so, how can we configure it?

sothawo commented 6 months ago

There was #2738, in that issue I linked to a post I wrote: https://www.sothawo.com/post/2023/10/18/use-two-different-elasticsearch-clusters-with-spring-data-elasticsearch/