gpt4 book ai didi

elasticsearch - 如何从另一台机器连接到我的 elasticsearch 集群?

转载 作者:行者123 更新时间:2023-12-03 01:48:29 25 4
gpt4 key购买 nike

我想从另一台机器连接我的 elasticsearch 集群,我浏览了一些文档,他们提到我已经更改了 network.bind_host : 0 .但我没有找到network.bind_host在我的 elasticsearch.yml 中。我只有 network.host在我的 elasticsearch.yml 文件中。即使我通过给出作为network.host :0但我无法从另一台机器连接。我还尝试在 network.host :0 之前删除 ##启动 Elasticsearch 集群时会引发错误。

当我从另一台机器连接时,我必须给 http://clustermachingip:9200对?
有人可以帮忙解决这个问题吗?

谢谢..

最佳答案

当你想连接到另一台机器的 elasticsearch 实例时,是的,地址是 http://clustermachingip:9200 .可以试试设置network.bind_host: clustermachingip
如果这不起作用,那么您可能需要使用 ping 命令之类的东西检查与您尝试连接的机器的连接。

ping clustermachingip

编辑:

您可以在一台机器上启动 elasticsearch,然后在另一台机器上尝试以下 curl 命令之一。
curl 'clustermachingip:9200/_cat/nodes?v'
curl 'clustermachingip:9200/_cat/health?v'

EDIT2:清除network.host,network.bind_host之间的混淆

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-network.html#advanced-network-settings

The network.host setting explained in Commonly used network settings is a shortcut which sets the bind host and the publish host at the same time. In advanced used cases, such as when running behind a proxy server, you may need to set these settings to different values:

network.bind_host This specifies which network interface(s) a node should bind to in order to listen for incoming requests. A node can bind to multiple interfaces, e.g. two network cards, or a site-local address and a local address. Defaults to network.host. network.publish_host The publish host is the single interface that the node advertises to other nodes in the cluster, so that those nodes can connect to it. Currently an elasticsearch node may be bound to multiple addresses, but only publishes one. If not specified, this defaults to the “best” address from network.host, sorted by IPv4/IPv6 stack preference, then by reachability.

关于elasticsearch - 如何从另一台机器连接到我的 elasticsearch 集群?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42190218/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com