Elastic_exporter 无法连接启用 https 的 uri

Posted

技术标签:

【中文标题】Elastic_exporter 无法连接启用 https 的 uri【英文标题】:Elastic_exporter failing to connect for a https enabled uri 【发布时间】:2021-11-06 12:06:18 【问题描述】:

我在尝试运行 elastic_exporter 以收集 prometheus 的指标信息时遇到以下错误。我们最近启用了 HTTPs uri,之后它失败了。我正在运行以下命令。

./elasticsearch_exporter --es.uri="https://<user>:<password>@<host>:9200" --es.ca="ca.p12" --es.all

错误:

level=info ts=2021-09-09T20:40:27.595324951Z caller=clusterinfo.go:200 msg="triggering initial cluster info call"
level=info ts=2021-09-09T20:40:27.595501321Z caller=clusterinfo.go:169 msg="providing consumers with updated cluster info label"
level=error ts=2021-09-09T20:40:27.60841784Z caller=clusterinfo.go:253 msg="failed to get cluster info" err="Get https://<host>:9200/: x509: certificate signed by unknown authority"
level=error ts=2021-09-09T20:40:27.608495036Z caller=clusterinfo.go:174 msg="failed to retrieve cluster info from ES" err="Get https://<host>:9200/: x509: certificate signed by unknown authority"
level=info ts=2021-09-09T20:40:37.59553964Z caller=main.go:153 msg="initial cluster info call timed out"
level=info ts=2021-09-09T20:40:37.595914448Z caller=main.go:188 msg="starting elasticsearch_exporter" addr=:9114
level=warn ts=2021-09-09T20:40:42.095358641Z caller=cluster_health.go:270 msg="failed to fetch and decode cluster health" err="failed to get cluster health from https://rc-esd701.dev.local:9200/_cluster/health: Get https://<host>:9200/_cluster/health: x509: certificate signed by unknown authority"
level=warn ts=2021-09-09T20:40:42.095358638Z caller=nodes.go:1851 msg="failed to fetch and decode node stats" err="failed to get cluster health from https://<host>:9200_nodes/_local/stats: Get https://<host>:9200/_nodes/_local/stats: x509: certificate signed by unknown authority"

【问题讨论】:

【参考方案1】:

这个错误可以通过在命令中添加--es.ssl-skip-verify来修复

【讨论】:

以上是关于Elastic_exporter 无法连接启用 https 的 uri的主要内容,如果未能解决你的问题,请参考以下文章

关于opengl无法运行的问题

无线网无法连接,之前又设置为此网络启用联邦信息处理标准FIPS兼容,是Win10的,怎么处理,关闭联邦兼容模式

离子应用程序无法使用 $http 连接启用 cors 的服务器

禁用与启用本地连接最简单的命令

无法在启用 SSL 的 Kafka 集群中注册 Debezium (Kafka-Connect) 连接器

Win7电脑无法启用无线连接或无线连不上网