amazon-web-services - 无法通过aws公共(public)IP连接到Elasticsearch

标签 amazon-web-services elasticsearch amazon-ec2

我在 EC2 (Fedora) 上运行了 elasticsearch,

我无法使用公共(public) 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:真 b。 http.cors.enabled:真 c。 http.cors.allow-origin: "*"
  3. Restarted elasticsearch(服务elasticsearch重启)

我可以连接kibana enter image description here 但是我无法连接到 elasticsearch enter image description here

对于这个实例,我的入站和出站是完全开放的:enter image description here enter image description here

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

最佳答案

对于 EC2,您需要安装 elasticsearch 提供的 AWS 插件。安装插件后,您需要从 EC2 生成 key 和访问 key 。 This链接应该可以帮助您生成所需的 key 。 在此之后,您需要在 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 地址从您的客户端连接。

关于amazon-web-services - 无法通过aws公共(public)IP连接到Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34107611/

相关文章:

amazon-web-services - API 网关授权方接受 ID_token 但不接受 Access_Token

amazon-web-services - AWS 无服务器图像处理程序 - Lambda 错误

javascript - 如何在没有特定标签的情况下搜索资源

java - 如何在 S3 中同时读写文件?

amazon-web-services - EC 2's Under Auto-Scaling won' t 规模即使不健康

node.js - Elasticsearch 抛出 resource_already_exists_exception

elasticsearch - Elasticsearch查询行为

elasticsearch - 部分匹配在此查询中不起作用

json - 在句子(句子数组)中的任意位置找到确切的两个单词elastcsearch 6.8

php - Amazon DynamoDB 是否比 Amazon RDS (php) 慢?