繁体   English   中英

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

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

我有一个带有两个主节点和两个数据节点的弹性搜索集群。 我需要从 spring 引导连接到具有两个主节点的弹性搜索集群。

有人知道如何从 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您将无法连接到 Elasticsearch 集群。

最好是在所有 Elasticsearch 节点之上创建一个负载均衡器,并连接到您的负载均衡器,该负载均衡器会将请求转发到底层 Elasticsearch 节点。

如果您不能创建负载均衡器,而不是单个节点,您可以在 Elasticsearch 连接设置中为所有节点提供 ip 以避免前面描述的问题,这也是非常常见的问题。

您可以通过在客户端构建器中传递多个 Elasticsearch 节点来创建 Elasticsearch 客户端。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM