无法通过公共IP

时间:2015-12-05 16:08:24

标签: amazon-web-services elasticsearch amazon-ec2

我在EC2(Fedora)上运行了弹性搜索,

我无法使用公共IP或主机名进行外部连接。

ElasticSearch正确启动,我可以使用以下方式在本地访问:curl -XGET http://localhost:9200

{
  "name" : "Prodigy",
  "cluster_name" : "awstutorialseries",
  "version" : {
    "number" : "2.1.0",
    "build_hash" : "72cd1f1a3eee09505e036106146dc1949dc5dc87",
    "build_timestamp" : "2015-11-18T22:40:03Z",
    "build_snapshot" : false,
    "lucene_version" : "5.3.1"
  },
  "tagline" : "You Know, for Search"
}

我确实按照此处说明的所有步骤进行操作:elasticsearch on Ec2 cannot hit public IP(timeout)

喜欢

  1. 做TJ在评论中说的话,+重启实例。我不确定这是否是必要的,但我做得很好。
  2. 我确保在elasticsearch.yml文件中设置了以下内容: http.enabled:true b。 http.cors.enabled:true c。 http.cors.allow-origin:" *"
  3. 重新启动的elasticsearch(service elasticsearch restart)
  4. 我可以连接kibana enter image description here 但我无法连接到elasticsearch enter image description here

    我的入站和出站广泛用于此实例:enter image description here enter image description here

    这是我的elasticsearch.yml文件enter image description here

1 个答案:

答案 0 :(得分:0)

对于EC2,您需要安装elasticsearch提供的AWS插件。安装插件后,您需要从EC2生成密钥和访问密钥。 This链接可以帮助您生成所需的密钥。 在此之后,您需要在elasticsearch.yml中配置以下设置:network.host: ec2 ,network.publish_host:"",discovery.type:ec2,cloud.aws。 access_key :,cloud.aws.secret_key :, discovery.ec2.groups :, discovery.ec2.host_type:" public_ip",discovery.ec2.ping_timeout:" 10s"

这应该让你开始运行。使用机器的IP地址从客户端连接。

相关问题