关闭和关闭弹性搜索节点的区别? [英] Difference between close and shutdown a node in elasticsearch?
问题描述
Node node = NodeBuilder.nodeBuilder()。loadConfigSettings(true).node ();
node.close();
和
node.client()管理员()簇()prepareNodesShutdown()执行()actionGet()。。。;
?
正确地从java关闭节点/集群?
两个提到的操作具有相同的效果。不同之处在于潜在的,它们影响的节点。
使用 node.close()
关闭您自己的节点,从您的应用程序开始,成为您在应用程序中嵌入弹性搜索集群或仅通过java api(传输端口)连接到外部集群的客户机节点时唯一的节点。
使用节点关闭api ,您可以在单个操作中也可以有效地关闭远程节点,潜在的多个节点和整个集群。因此,命令上下文中的每个节点将被关闭,再次调用 close
方法。
此外,两个命令均匀地关闭节点。
Having a cluster with a single node :
Node node = NodeBuilder.nodeBuilder().loadConfigSettings(true).node();
What is the difference betwwen
node.close();
and
node.client().admin().cluster().prepareNodesShutdown().execute().actionGet();
?
What's the recommended method to gracefully shutdown the node/cluster from java ?
Both mentioned operations have the same effect. The difference is, potentially, the nodes they affect.
With node.close()
you close your own node, that you started from your application, which can either be the only node you have if you embed the elasticsearch cluster in your application, or just a client node that connects to an external cluster through java api (transport port).
Using the nodes shutdown api you can effectively shutdown remote nodes, potentially multiple nodes and the whole cluster as well in a single operation. As a result, each node in the context of the command will be closed, again calling the close
method.
Also, both commands gracefully close nodes.
这篇关于关闭和关闭弹性搜索节点的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!