首页 > 解决方案 > 连接到 InfluxDB 的远程连接被拒绝

问题描述

我在 Xubuntu 机器上有一个正在运行的 Influxd 服务器,我想通过互联网从另一台(Ubuntu)计算机进行查询(因此,客户端和服务器位于不同的 LAN 中)。我在路由器上的 influxdb 和 portforwardport 8086上设置了身份验证,但我无法访问服务器。

输入

curl -G http://xx.xxx.xx.xxx:8086/query -u admin:admin --data-urlencode "q=SHOW DATABASES"
(xx.xxx.xx.xxx is the server public ip address)

输出

curl: (7) Failed to connect to xx.xxx.xx.xxx port 8086: Connection refused

相同的 curl 查询,如果在服务器上运行localhost而不是xx.xxx.xx.xxx返回正确的结果。

输出

{
  "results":[{
      "statement_id":0,
      "series":[{
          "name":"databases",
          "columns":["name"],
          "values":[["_internal"],["test"]]
      }]
  }]
}

我究竟做错了什么?

标签: influxdbportforwarding

解决方案


推荐阅读