如何解决从 HTTP 更改为 HTTPS 时,InfluxDB 拒绝来自 Telegraf 的连接
在我的 centos7 服务器中,我已经设置了 Telegraf 和 InfluxDB。 InfluxDB 成功接收来自 Telegraf 的数据并将其存储在数据库中。但是当我重新配置这两个服务以使用 https 时,我在 Telegraf 的日志中看到以下错误
12 月 29 日 15:13:11 localhost.localdomain 电报 [31779]:2020-12-29T13:13:11Z E! [outputs.influxdb] 写入 [https://127.0.0.1:8086] 时:发布“https://127.0.0.1:8086/write?db=GRAFANA”:拨 tcp 127.0.0.1:8086:connect:connect拒绝
12 月 29 日 15:13:11 localhost.localdomain 电报 [31779]:2020-12-29T13:13:11Z E! [agent] 写入outputs.influxdb 出错:无法写入任何地址
InfluxDB 在其日志中没有显示任何错误。
以下是我的 telegraf.conf 文件:
[agent]
hostname = "local"
flush_interval = "15s"
interval = "15s"
# Input Plugins
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
[[inputs.disk]]
ignore_fs = ["tmpfs","devtmpfs","devfs"]
[[inputs.io]]
[[inputs.mem]]
[[inputs.net]]
[[inputs.system]]
[[inputs.swap]]
[[inputs.netstat]]
[[inputs.processes]]
[[inputs.kernel]]
# Output Plugin InfluxDB
[[outputs.influxdb]]
database = "GRAFANA"
urls = [ "https://127.0.0.1:8086" ]
insecure_skip_verify = true
username = "telegrafuser"
password = "metricsmetricsmetricsmetrics"
这是 influxdb.conf
中未注释的 [http] 部分 # Determines whether HTTP endpoint is enabled.
enabled = false
# Determines whether the Flux query endpoint is enabled.
flux-enabled = true
# The bind address used by the HTTP service.
bind-address = ":8086"
# Determines whether user authentication is enabled over HTTP/HTTPS.
auth-enabled = false
# Determines whether HTTPS is enabled.
https-enabled = true
# The SSL certificate to use when HTTPS is enabled.
https-certificate = "/etc/ssl/server-cert.pem"
# Use a separate private key location.
https-private-key = "/etc/ssl/server-key.pem"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。