简体   繁体   English

elasticsearch集群如何连接多个master节点

[英]How to connect to multiple master nodes of elastic search cluster

I have an elastic search cluster with two master nodes and two data nodes.我有一个带有两个主节点和两个数据节点的弹性搜索集群。 And I need to connect to an elastic search cluster with two master nodes from spring boot.我需要从 spring 引导连接到具有两个主节点的弹性搜索集群。

Is anybody knows how to connect the multinode elastic search cluster from spring boot?有人知道如何从 spring 引导连接多节点弹性搜索集群吗?

In Elasticsearch cluster you can connect to any node ip and that node will forward the request to other nodes in the Elasticsearch cluster, but this is not a ideal way of connecting to Elasticsearch cluster as that way single node becomes bottleneck and if that nodes goes down you will not be able to connect to Elasticsearch cluster. In Elasticsearch cluster you can connect to any node ip and that node will forward the request to other nodes in the Elasticsearch cluster, but this is not a ideal way of connecting to Elasticsearch cluster as that way single node becomes bottleneck and if that nodes goes down您将无法连接到 Elasticsearch 集群。

Best is to create a load balancer on top of all your Elasticsearch nodes and connect to your load balancer that will forward request to underlying Elasticsearch nodes.最好是在所有 Elasticsearch 节点之上创建一个负载均衡器,并连接到您的负载均衡器,该负载均衡器会将请求转发到底层 Elasticsearch 节点。

If you can't create load balancer, instead of single node you can give all nodes ip in your Elasticsearch connection setting to avoid the problem described earlier and also very common as well.如果您不能创建负载均衡器,而不是单个节点,您可以在 Elasticsearch 连接设置中为所有节点提供 ip 以避免前面描述的问题,这也是非常常见的问题。

You can create a Elasticsearch client by passing multiple Elasticsearch nodes in the client builder.您可以通过在客户端构建器中传递多个 Elasticsearch 节点来创建 Elasticsearch 客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Java中将Elastic Search 5.4连接到TCP? - How to connect Elastic search 5.4 to tcp in java? 如何批量更新多个id的弹性搜索? - How to update elastic search in batches for multiple id? 如何连接到服务器并使用Elastic Search索引pdf文件? - How can I connect to a server and index pdf files with elastic Search? 如何连接其他机器安装弹性搜索服务器? - how to connect other machine install Elastic search server? YARN集群模式下,如何设置主节点memory大于工作节点memory? - In YARN cluster mode, how to set memory the master node more than workers nodes' memory? 与远程弹性搜索集群的连接失败 - Connection to remote elastic search cluster fails Elasticsearch集群节点,需要连接到哪个节点? - Elasticsearch cluster nodes , to which node need to connect? 如何在spring boot中使用弹性搜索模板id(存储在ES集群中)得到结果 - How to use elastic search template id(stored in ES cluster) in spring boot get result 如何使用弹性搜索Java API编写多个得分函数? - How to use elastic search java API to write multiple score functions? 如何在java中的弹性搜索Querybuilder中处理多个“和”“或”运算符 - How to handle multiple 'and' 'or' operators in Elastic search Querybuilder in java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM