Ec2上的弹性搜索不能打到公共IP(超时) [英] elasticsearch on Ec2 cannot hit public IP(timeout)

查看:149
本文介绍了Ec2上的弹性搜索不能打到公共IP(超时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我可以打到本地IP地址(例如curl -XGET localhost:9200)



我无法使用公共IP地址,无论是在同一台机器上还是从我们的网络,它总是超时,



IPtables允许



端口是打开的(对自己和私有网络)



弹性搜索http.cors已启用,并允许 *



除了Iptables,amazon安全配置,弹性搜索配置有什么可以忽略吗? (我们可以访问443并获得kibana,它只是弹性搜索ajax调用的时间,或者如果我尝试直接访问9200)



一直在为此工作一天,所以我谦虚地来找你们。



谢谢

解决方案

我有完全相同的问题。



我设法解决如下:


    TJ 在他的评论中说,+重启实例。我不知道这是否是必要的,但我做的很好。
  1. 我确保在elasticsearch.yml文件中设置以下内容:
    a。 http.enabled:true
    b。 http.cors.enabled:true
    c。 http.cors.allow-origin:*


  2. 重新启动的弹性搜索(service elasticsearch restart)




    1. 然后,当我尝试从公共IP访问弹性搜索时,它工作 - http:// [PUBLIC IP OF INSTANCE]:9200



      希望这有帮助。


      I have elasticsearch running on EC2,

      I can hit form local IP address(ex. curl -XGET localhost:9200)

      I cannot hit from public IP address, whether on the same machine, or from our network, it always times out,

      IPtables are allowing

      port is open(to itself as well as private network)

      Elasticsearch http.cors is enabled and allows "*"

      aside from Iptables, amazon security config, elasticsearch config could there be anything I am overlooking? (we can access 443 and get kibana up, it just times out on the elasticsearch ajax call or if I try to access 9200 directly)

      been working on this for over a day so I humbly come to you all!

      thank you

      解决方案

      I had exactly the same issue.

      I managed to solve it as follows:

      1. Do what TJ said in his comment, + restart the instance. I wasn't sure if this was/is necessary, but I did it for good measure.
      2. I made sure that the following is set in the elasticsearch.yml file: a. http.enabled: true b. http.cors.enabled: true c. http.cors.allow-origin: "*"

      3. Restarted elasticsearch (service elasticsearch restart)

      Then when I tried to access elasticsearch from the public IP it worked - http://[PUBLIC IP OF INSTANCE]:9200

      Hope this helps.

      这篇关于Ec2上的弹性搜索不能打到公共IP(超时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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