微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

查找 elasticsearch 服务端点

如何解决查找 elasticsearch 服务端点

我正在试用 elasticcloud。但是现在我在创建从 logstash 到 elasticcloud 的管道时遇到了问题。这是我的 logstash.conf 输出

output {
        stdout{codec=>rubydebug}
        elasticsearch
        {
            hosts=>["https://<clusterid>.asia-southeast1.gcp.cloud.es.io:9243"]
 index=>"testindex"
user=>elasticdeploymentcredentials
password=>elasticdeploymentcredentials
 }
}

但它总是返回错误

[WARN ] 2021-03-29 12:24:50.148 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance,but got an error. {:url=>"https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/",:error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError,:error=>"Elasticsearch Unreachable: [https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/][Manticore::ResolutionFailure] <clusterid>.asia-southeast1.gcp.cloud.es.io"}
[WARN ] 2021-03-29 12:24:55.158 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance,:error=>"Elasticsearch Unreachable: [https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/][Manticore::ResolutionFailure] <clusterid>.asia-southeast1.gcp.cloud.es.io: Name or service not kNown"}
[WARN ] 2021-03-29 12:25:00.163 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance,:error=>"Elasticsearch Unreachable: [https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/][Manticore::ResolutionFailure] <clusterid>.asia-southeast1.gcp.cloud.es.io"}
[WARN ] 2021-03-29 12:25:05.170 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance,:error=>"Elasticsearch Unreachable: [https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/][Manticore::ResolutionFailure] <clusterid>.asia-southeast1.gcp.cloud.es.io: Name or service not kNown"}
[WARN ] 2021-03-29 12:25:10.175 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance,:error=>"Elasticsearch Unreachable: [https://elastic:xxxxxx@<clusterid>.asia-southeast1.gcp.cloud.es.io:9243/][Manticore::ResolutionFailure] <clusterid>.asia-southeast1.gcp.cloud.es.io"}

我可以使用我的凭据将其卷曲为: [root@localhost testconfig]# curl https://elasticdeploymentcredentials:elasticdeploymentcredentials@<clusterid>.asia-southeast1.gcp.elastic-cloud.com:9243 它回来了

  "name" : "name","cluster_name" : "<clusterid>","cluster_uuid" : "<clusteruuid>","version" : {
    "number" : "7.12.0","build_flavor" : "default","build_type" : "docker","build_hash" : "build_hash","build_date" : "2021-03-18T06:17:15.410153305Z","build_snapshot" : false,"lucene_version" : "8.8.0","minimum_wire_compatibility_version" : "6.8.0","minimum_index_compatibility_version" : "6.0.0-beta1"
  },"tagline" : "You KNow,for Search"
}

我错过了什么吗?

解决方法

不要尝试通过部署中的用户名/密码连接到 Elastic Cloud,而是尝试使用 Cloud_ID/Cloud_Auth 组合:

output {
  elasticsearch {
    hosts => ["https://<clusterid>.asia-southeast1.gcp.cloud.es.io:9243"]
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    cloud_id => "your cloudid from the console"
    cloud_auth => "elastic:password"
  }
}

cloud_auth 参数是您实际要使用部署中的用户名/密码的位置。更多信息在这里:

https://www.elastic.co/guide/en/logstash/7.12/connecting-to-cloud.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?