【问题标题】:Influxdb not listening on udp portInfluxdb 没有监听 udp 端口
【发布时间】:2016-10-26 15:28:50
【问题描述】:

正如标题所述,我无法让 Influxdb 监听配置中定义的 udp 端口​​。

udp 的配置如下所示:

[[udp]]
  enabled = true
  bind-address = ":8089"
  database = "testdb"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  read-buffer = 0
  batch-timeout = "1s"
  precision = ""

Http/tcp 连接工作正常,但不是 udp。 我用netstat -aun检查了端口,结果是:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
udp        0      0 0.0.0.0:54601           0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp6       0      0 :::38131                :::*

未列出定义的 udp 端口​​。

我已经用sudo service influxdb restart 重新启动了 influxdb,但它没有帮助。

我错过了什么?

更新 7.11.2016 21:59

我运行了命令:influxd -config influxdb.generated.conf 看到这样的输出:

 8888888           .d888 888                   8888888b.  888888b.
   888            d88P"  888                   888  "Y88b 888  "88b
   888            888    888                   888    888 888  .88P
   888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
   888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
   888   888  888 888    888 888  888   X88K   888    888 888    888
   888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
 8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"

[run] 2016/11/07 19:54:57 InfluxDB starting, version 1.0.2, branch master, commit ff307047057b7797418998a4ed709b0c0f346324
[run] 2016/11/07 19:54:57 Go version go1.6.2, GOMAXPROCS set to 2
[run] 2016/11/07 19:54:57 Using configuration at: influxdb.generated.conf
run: open server: listen: listen tcp :8088: bind: address already in use

它没有说明 udp 端口​​。


13.4.2020 更新 问题已解决。

这是一个老问题,我不记得我是如何解决这个问题的,但我做到了。如果我没记错的话,问题是 Influx 没有加载正确的配置文件,这是我当时的愚蠢。可悲的是,我不记得为什么会发生这种情况,但我记得那是我自己做的。请记住始终正确阅读文档,并通过 google 搜索。

【问题讨论】:

  • 你使用的是什么版本的 InfluxDB?
  • @MichaelDesa:InfluxDB shell 版本:1.0.2
  • 它似乎对我有用。日志中是否报告了任何错误?另外,当您通过运行influxd -config /path/to/your/config 启动进程而不是作为服务时发生了什么?
  • @MichaelDesa:日志文件太大了,甚至都很难打开它,更不用说从中搜索任何内容了。 :D Tail -50 没有显示一些 Grafana 查询的其他内容。我猜某处或某处有一个调试标志。我不认为它应该记录这样的事情。我将在几秒钟内更新该命令的输出。
  • 能不能先关闭服务再运行influxd -config influxdb.generated.conf

标签: udp influxdb


【解决方案1】:

我遇到了同样的问题,我认为根本原因可能是相同的。我将 InfluxDB 作为 Windows 服务运行,没有任何参数。因此,它使用的 .conf 文件与我预期的不同,所以当我启用 UDP 侦听器时,它没有生效。

为了解决它,我更改了服务配置(通过nssm)以包含参数:

-config \path\to\my\config.conf

为了确保它通过我预期的配置运行。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。您已经在后台运行服务。然后你试图再次开始涌入。这就是为什么一条消息说“运行:打开服务器:侦听:侦听 tcp :8088:绑定:地址已在使用中”。

    先停止后台服务:

    sudo systemctl stop influxdb
    

    然后在当前终端运行influx,这样你就可以看到输出了:

    influxd -config influxdb.generated.conf
    

    或者如果您将环境变量设置为指向您的配置:

    sudo influxd
    

    然后你会得到这样的东西:

    uesrname@host:~$ sudo influxd
    
     8888888           .d888 888                   8888888b.  888888b.
       888            d88P"  888                   888  "Y88b 888  "88b
       888            888    888                   888    888 888  .88P
       888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
       888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
       888   888  888 888    888 888  888   X88K   888    888 888    888
       888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
     8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"
    
    [run] 2020/02/25 19:41:59 InfluxDB starting, version 1.1.1, branch unknown, commit unknown    
    ......   
    [httpd] 2020/02/25 19:42:00 Listening on HTTP: [::]:8086
    [udp] 2020/02/25 19:42:00 Started listening on UDP: :8189
    [run] 2020/02/25 19:42:00 Listening for signals
    

    如果你以后想检查你的后台服务是否在监听 UDP 端口,写这个命令:

    systemctl status influxd
    

    你会得到状态

    ● influxdb.service - InfluxDB is an open-source, distributed, time series database
       Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
       Active: active (running) since Tue 2020-02-25 19:56:01 CET; 2s ago
         Docs: man:influxd(1)
     Main PID: 7087 (influxd)
        Tasks: 9 (limit: 2233)
       CGroup: /system.slice/influxdb.service
               └─7087 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
    
    .....
    feb 25 19:56:02 host influxd[7087]: [httpd] 2020/02/25 19:56:02 Starting HTTP service
    feb 25 19:56:02 host influxd[7087]: [httpd] 2020/02/25 19:56:02 Listening on HTTP: [::]:8086   
    feb 25 19:56:02 host  influxd[7087]: [udp] 2020/02/25 19:56:02 Started listening on UDP: :8189
    feb 25 19:56:02 host influxd[7087]: [run] 2020/02/25 19:56:02 Listening for signals
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      • 2021-07-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多