我有一个带有3个节点的Elasticsearch 7.3集群。
我的应用程序正在使用es rest客户端以便与es通信。客户端使用的连接URL为 node1:node2:node3
我的问题-是否可以将新的 node4 添加到es群集,以便其余客户端发现它(当然,无需重新启动应用程序)?也许其余的调用将到达node1,它将以某种方式将其重定向到新添加的节点。
ps。我开始考虑上述问题-是否需要在客户端和es群集之间使用LB还是不需要...
最佳答案
在es文档中找到了答案。
Once a RestClient instance has been created, a Sniffer can be associated to it. The Sniffer will make use of the provided RestClient to periodically (every 5 minutes by default) fetch the list of current nodes from the cluster and update them by calling RestClient#setNodes.
链接到文档-rest client usage, sniffer
关于elasticsearch - Elasticsearch 7.3 Rest客户端是否发现新节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59047106/