在服务器上安装了弹性搜索,但如果从另一台机器上无法连接到它 [英] Installed elastic search on server but cannot connect to it if from another machine
问题描述
背景
刚开始使用elastic search
,安装在服务器上,可以curl
和telnet
到port 9200
在 本地机器(服务器)
上,但如果从另一台机器连接到它.
Have just started using elastic search
, installed it on server, can curl
and telnet
to port 9200
on local machine(server)
but cannot connect to it if from another machine.
我禁用了服务器和客户端上的防火墙,因为我从互联网上得到的解决方案是建议的,并且还尝试了在下面的链接中找到的建议,但无法使其正常工作.
I disabled firewall on both the server and client as solutions I got from internet were suggesting and also tried suggestions found on the link below but couldn't get it working.
https://discuss.elastic.co/t/accessing-端口-9200-远程/21840
问题
有人能帮我解决这个问题吗,提前致谢
Can some one help me on how to get this working, thanks in advance
推荐答案
由于您刚刚安装了 Elasticsearch,我想您使用的是 ES 2.0 或 2.1.您需要知道,自 2.0 版本以来,Elasticsearch 默认绑定到 localhost(作为一种安全措施,以防止您的节点在您不知情的情况下连接到网络上的其他节点).
Since you just installed Elasticsearch, I suppose you're using ES 2.0 or 2.1. You need to know that since the 2.0 release, Elasticsearch binds to localhost by default (as a security measure to prevent your node from connecting to other nodes on the network without you knowing it).
所以您需要做的只是编辑您的 elasticsearch.yml
配置文件并像这样更改 network.bind_host
设置:
So what you need to do is simply to edit your elasticsearch.yml
configuration file and change the network.bind_host
setting like this:
network.bind_host: 0
然后,您需要重新启动您的节点,并且可以从远程主机访问它.
Then, you need to restart your node and it will be accessible from a remote host.
这篇关于在服务器上安装了弹性搜索,但如果从另一台机器上无法连接到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!