英文:
Logstash warning Opensearch unreachable
问题
我已部署 Logstash 8.6.1 并使用 logstash-output-opensearch 插件。以下是与将日志推送到 OpenSearch 相关的配置:
output {
if [type] == "logback" {
opensearch {
hosts => ["https://search-x.ap-southeast-1.es.amazonaws.com"]
auth_type => {
type => 'basic'
user => 'x'
password => 'y'
}
index => "logback-%{+YYYY}"
ecs_compatibility => disabled
}
}
}
运行 logstash 时,我注意到日志输出了以下警告:
[2023-03-01T07:02:47,126][WARN][logstash.outputs.opensearch][main] 尝试恢复到已关闭的 OpenSearch 实例的连接,但出现错误 {:url=>"https://search-x.ap-southeast-1.es.amazonaws.com:9200/", :exception=>LogStash::Outputs::OpenSearch::HttpClient::Pool::HostUnreachableError, :message=>"OpenSearch 不可访问:[https://search-x.ap-southeast-1.es.amazonaws.com:9200/][Manticore::ConnectTimeout] 连接到 search-x.ap-southeast-1.es.amazonaws.com:9200 [search-x.ap-southeast-1.es.amazonaws.com/x.x.x.x, search-x.ap-southeast-1.es.amazonaws.com/x.x.x.x] 失败:连接超时"}
Opensearch 的网络访问是公共的,版本为 1.1,这个警告是否与防火墙设置有关?
当我尝试使用所需的基本身份验证标头执行 curl https://search-x.ap-southeast-1.es.amazonaws.com
时,它确实返回信息:
{
"name": "e",
"cluster_name": "x",
"cluster_uuid": "y",
"version": {
"number": "7.10.2",
"build_type": "tar",
"build_hash": "unknown",
"build_date": "2022-10-20T07:32:13.999133Z",
"build_snapshot": false,
"lucene_version": "8.9.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "OpenSearch 项目:https://opensearch.org/"
}
我还可以访问 OpenSearch 仪表板。
英文:
I have deployed Logstash 8.6.1 with the logstash-output-opensearch plugin. This is the config related to pushing the logs to OpenSearch:
output {
if [type]=="logback" {
opensearch {
hosts => [ "https://search-x.ap-southeast-1.es.amazonaws.com" ]
auth_type => {
type => 'basic'
user => 'x'
password => 'y'
}
index => "logback-%{+YYYY}"
ecs_compatibility => disabled
}
}
}
When running logstash, I noticed that the log prints:
[2023-03-01T07:02:47,126][WARN ][logstash.outputs.opensearch][main] Attempted to resurrect connection to dead OpenSearch instance, but got an error {:url=>"https://search-x.ap-southeast-1.es.amazonaws.com:9200/", :exception=>LogStash::Outputs::OpenSearch::HttpClient::Pool::HostUnreachableError, :message=>"OpenSearch Unreachable: [https://search-x.ap-southeast-1.es.amazonaws.com:9200/][Manticore::ConnectTimeout] Connect to search-x.ap-southeast-1.es.amazonaws.com:9200 [search-x.ap-southeast-1.es.amazonaws.com/x.x.x.x, search-x.ap-southeast-1.es.amazonaws.com/x.x.x.x] failed: Connect timed out"}
The Opensearch network access is on Public, its version is 1.1, is this warning related to firewall settings?
When I tried curl https://search-x.ap-southeast-1.es.amazonaws.com with the required Basic auth header, it does return information:
{
"name": "e",
"cluster_name": "x",
"cluster_uuid": "y",
"version": {
"number": "7.10.2",
"build_type": "tar",
"build_hash": "unknown",
"build_date": "2022-10-20T07:32:13.999133Z",
"build_snapshot": false,
"lucene_version": "8.9.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "The OpenSearch Project: https://opensearch.org/"
}
I can also access the OpenSearch dashboard.
答案1
得分: 2
如果是亚马逊OpenSearch服务(托管服务),默认端口不是9200,而是443或80(我不确定您是否可以更改此配置)。请还确保您没有IAM策略阻止您的请求。
英文:
if it's Amazon OpenSearch service (managed service), the default port is not 9200, but 443 or 80 (I'm not sure you can change this configuration). Please also make sure that you don't have a IAM policy blocking your requests
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论