Connection Refused intermittently when reading and writing to influxdb2

I have this same issue. Totally randomly refuses connection. Reading or writing, does not matter. I estimate that 75%-80% of queries go through and the rest are refused. Reinstalled influx and also purged data from bucket. Version is 2.0.8 and I think it started after version upgrade(?)

Post "http://192.168.20.22:8086/api/v2/query?org=Sjoberg": dial tcp 192.168.20.22:8086: connect: connection refused

Hi and welcome. Some more info is needed for someone to have a chance in helping you.

  • Can you share with us the influxdb service log? (The time periods where you are getting connection refused)
  • What parameters are you running influxdb with and in what way (self hosted, cloud, container )
  • what rate is your client attempting to write and read data from influxdb ? Do the influxdb service logs agree/match up?

I had a look at /var/log/syslog and it is filled with influxdb not starting:

Sep 14 16:51:30 vmt-lin1-virt influxd-systemd-start.sh[445]: /usr/lib/influxdb/scripts/influxd-systemd-start.sh: line 27: curl: command not found
Sep 14 16:51:30 vmt-lin1-virt influxd-systemd-start.sh[445]: InfluxDB API at http://localhost:8086/ready unavailable after 74 attempts…

There is something horribly wrong with the startup script? Installed curl now. Let’s see if this was the issue…