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

查看:31
本文介绍了无法从服务器外部访问 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 作为入站流量规则
  • 在开放端口 9200 的 Azure 门户设置中添加了一个端点

在 VM Classic 上也试过了.

Tried this with VM Classic as well.

另外为了测试虚拟机是否正常,我在那台机器上设置了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.

我唯一没有尝试的是在 Linux VM 中设置 ES.

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

我在 elasticsearch 日志中找不到任何内容.在浏览器 (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 开始,elasticsearch 过程只有 绑定到localhost,这就解释了为什么可以从内部查询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天全站免登陆