我已在安装了Windows Server 2012 R2的Azure虚拟机中将ElasticSearch2.3.0设置为服务。我可以使用
http://localhost:9200
但我无法从服务器外部访问。
我试过什么?
- 只是为了测试,我让VM在虚拟网络之外可用。
- 已在Windows防火墙设置中打开端口9200作为入站流量规则
- 在开放端口9200的Azure门户设置中添加了终结点
在VM Classic中也尝试了此操作。
同样为了测试VM是否正常,我在那台机器上设置了IIS,打开了80端口。默认的IIS页面可以从外部访问。
我唯一没有尝试过的是在Linux VM中设置ES。
我在elasticsearch日志中找不到任何东西。在浏览器(Chrome)上,网络中没有日志。它只是旋转,等待服务器,并与“ERR_EMPTY_RESPONSE”快照。
做过这件事的人能给我们一些启示吗?
更新:以下是我在netstat中看到的内容:
TCP 127.0.0.1:9200 machine-name:0 LISTENING
TCP 127.0.0.1:9300 machine-name:0 LISTENING
5条答案
按热度按时间0mkxixxg1#
从ES 2.0开始,elasticsearch进程只绑定到localhost,这就解释了为什么您可以从内部查询ES而不能从外部查询。
您需要在
elasticsearch.yml
配置文件中更改以下设置:gk7wooem2#
我也有同样的案子。查了一下记录
我看到了这个:
解决方案:
使用以下命令修改discorverseed行中的归档文件/
etc/elasticsearch/elasticsearch.yml
:好的。
lrpiutwd3#
我建议将www.example.com设置network.host为特殊值
例如
这对我有用。
mspsb9vt4#
请注意,对我来说,成功是在设置后才取得的
代替
pu3pd22g5#
解决了我在Windows Server 2012上与ElasticSearch7.1.1添加到C:\ProgramData\Elastic\ElasticSearch\配置\ElasticSearch.yml以下配置: