【问题标题】:Force InfluxDB to listen on localhost only强制 InfluxDB 仅在 localhost 上侦听
【发布时间】:2017-02-28 20:10:51
【问题描述】:

我正在尝试让 InfluxDB v1.1.1 仅在 localhost 上侦听并同时使用 IPv4/v6。服务器在 Debian 7 上运行。

默认,配置,我可以在内部和外部达到influx:

[http]
  # The bind address used by the HTTP service.
  bind-address = ":8086"

netstat -antp | grep "influx"
tcp6       0      0 :::8083                 :::*                    LISTEN      813/influxd     
tcp6       0      0 :::8086                 :::*                    LISTEN      813/influxd     
tcp6       0      0 :::8088                 :::*                    LISTEN      813/influxd     

curl -4 -sl -I localhost:8086/ping <- Works
curl -6 -sl -I localhost:8086/ping <- Works

尝试仅使用 IPv6 在 localhost 上侦听我无法使用 IPv4/IPv6 在内部或外部访问 influx:

[http]
  # The bind address used by the HTTP service.
  bind-address = "[::1]:8086"

  netstat -antp | grep "influx"
tcp6       0      0 :::8083                 :::*                    LISTEN      1831/influxd    
tcp6       0      0 ::1:8086                :::*                    LISTEN      1831/influxd    
tcp6       0      0 :::8088                 :::*                    LISTEN      1831/influxd

curl -4 -sl -I localhost:8086/ping <- Does not work
curl -6 -sl -I localhost:8086/ping <- Does not work

尝试仅使用 IPv4 在 localhost 上侦听我可以仅使用 IPv4 在内部访问 influx:

[http]
  # The bind address used by the HTTP service.
  bind-address = "127.0.0.1:8086"

  netstat -antp | grep "influx"
tcp        0      0 127.0.0.1:8086          0.0.0.0:*               LISTEN      3375/influxd    
tcp6       0      0 :::8083                 :::*                    LISTEN      3375/influxd    
tcp6       0      0 :::8088                 :::*                    LISTEN      3375/influxd  

curl -4 -sl -I localhost:8086/ping <- Works
curl -6 -sl -I localhost:8086/ping <- Does not work

不确定我是否在配置中遗漏了某些内容,或者这是不可能的。

【问题讨论】:

  • 目前,InfluxDB 无法做到这一点。我鼓励您在 InfluxDB 上打开 feature request,或查看 influxdb community 以查看是否有任何解决方法。

标签: influxdb


【解决方案1】:

这似乎是 2018 年 4 月的 have been solved。TL;DR:使用 bind-address 两次,一次在顶部(用于备份/诊断访问 influxdb),一次用于 HTTP API:

bind-address = "127.0.0.1:8088"

[http]
  bind-address = "127.0.0.1:8088"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-18
    • 2018-01-12
    • 1970-01-01
    • 2021-01-25
    • 2020-07-06
    • 1970-01-01
    • 2011-08-28
    • 1970-01-01
    相关资源
    最近更新 更多