ElasticSearch实例从服务器外部无法访问 - Azure Windows 2012 [英] ElasticSearch instance not reachable from outside the server - Azure Windows 2012

查看:816
本文介绍了ElasticSearch实例从服务器外部无法访问 - Azure Windows 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows Server 2012 R2的Azure VM中设置了Elastic Search 2.3.0作为服务。我可以使用

I have set up Elastic Search 2.3.0 as a service in an Azure VM with Windows Server 2012 R2. I can access elastic search instance from within the server using

http://localhost:9200

但我无法从服务器外部访问。

but I cannot access from outside the server.

我尝试了什么?


  • 只是为了测试我已经做了VM在虚拟网络之外可用。

  • 在Windows防火墙设置中打开端口9200作为入站流量规则

  • 在Azure门户网站设置中添加端点,打开端口9200

尝试使用VM Classic。

Tried this with VM Classic as well.

还用于测试VM是否好的,我在那台机器上设置了IIS,打开了端口80.默认的IIS页面可以从外部访问。

Also for testing whether the VM is alright, I had set up IIS in that machine, opened up the port 80. The default IIS page is accessible from outside.

只有我没有尝试的东西是设置ES在Linux VM中。

Only thing I have not tried is setting ES in a Linux VM.

我在弹性搜索日志中找不到任何内容。在浏览器(Chrome)上,网络中没有日志。它只是旋转,等待服务器,并使用ERR_EMPTY_RESPONSE进行捕捉。

I can't find anything in the elasticsearch logs. On the browser (Chrome), there are no logs in the Network. It just spins, waiting for the server, and snaps with "ERR_EMPTY_RESPONSE".

有没有做过这个的人可以轻松一点吗?

Can anybody that had done this shed some light please?

更新:
这是我在netstat中可以看到的:

UPDATE: Here is what I can see in netstat:

TCP    127.0.0.1:9200         machine-name:0       LISTENING
TCP    127.0.0.1:9300         machine-name:0       LISTENING


推荐答案

从ES 2.0开始,弹性搜索过程只有绑定到本地主机,这就解释了为什么你可以从内部而不是外部查询ES。

Starting with ES 2.0, the elasticsearch process only binds to localhost, which explains why you can query ES from inside but not from the outside.

你需要更改 elasticsearch.yml 配置文件中的以下设置:

You need to change the following setting in your elasticsearch.yml configuration file:

network.host: 0.0.0.0

这篇关于ElasticSearch实例从服务器外部无法访问 - Azure Windows 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆