GotBatteries
GotBatteries

Reputation: 1386

Influxdb not listening on udp port

As the title states, I cannot get the Influxdb to listen to the udp port defined in the config.

Config for the udp looks like this:

[[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 connections work just fine, but not udp. I've checked the port with netstat -aun, and the results are:

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                :::*

The defined udp port is not listed.

I've restarted the influxdb with sudo service influxdb restart, but it has not helped.

What am I missing?

Update 7.11.2016 21:59

I ran the command: influxd -config influxdb.generated.conf to see an output like this:

 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

It doesn't say anything about the udp port.


Update 13.4.2020 Issue is fixed.

This is an old question and I cannot recall how exactly I fixed the issue, but I did. If I remember correctly, the issue was that the Influx didn't load the correct config file, and that it was my own stupidity at the time. Sadly I cannot recall why this happened, but I can remember that it was my own doing. Remember to always read the documentation properly, and google the sht out of it.

Upvotes: 1

Views: 4365

Answers (2)

gtu
gtu

Reputation: 966

I had the same problem. You are running a service in the background already. Then you tried to start influx again. That is why a message says "run: open server: listen: listen tcp :8088: bind: address already in use".

First stop the background service:

sudo systemctl stop influxdb

Then run influx in current terminal so you can see the output:

influxd -config influxdb.generated.conf

or if you set your environmental variable to point to your config:

sudo influxd

Then you will get something like this:

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

If you later want to check if your background service is listening to UDP port, write this command:

systemctl status influxd

And you will get the status

● 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

Upvotes: 1

Mark Wragg
Mark Wragg

Reputation: 23355

I had this same issue and I think the root cause was likely the same. I was running InfluxDB as a Windows service with no arguments. As such it was using a different .conf file to the one I expected, so when I enabled the UDP listener it wasn't taking effect.

To resolve it I changed the service configuration (via nssm) to include the argument:

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

To ensure it was running via the config I expected.

Upvotes: 1

Related Questions