簡體   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