influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.7k stars 3.54k forks source link

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: getsockopt: connection refused Please check your connection settings and ensure ‘influxd’ is running #19499

Open yxfGrace opened 4 years ago

yxfGrace commented 4 years ago

After I run influxd -config ../../etc/influxdb/influxdb.conf, and then run ./influx, an error occurred: Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: getsockopt: connection refused Please check your connection settings and ensure ‘influxd’ is running

but if I change a new data dir, influx can run. Why does it happen? like this

图片
russorat commented 4 years ago

@yxfGrace thanks for the issue. when you start influxd normally, can you curl http://localhost:8086/ping successfully from your machine?

justadoll commented 3 years ago

@russorat Hi, have this trouble too. Ping fails... curl: (7) Failed to connect to localhost port 8086: Connection refused

But netstat show me this: tcp 0 0 127.0.0.1:8086 0.0.0.0:* LISTEN 2985/python3

maximinus333 commented 2 years ago

Hi, me too. Influx/grafana was running well for several months on a RasperryPi4 4GB in an ioBroker installation until it recently stopped without any change. After a reinstall of influx and a restore of the database it was running again but only several days until it stopped again. While in the influxdb.conf in the area http the Port 8086 is defined it seems to listen on 8088

pi@raspberrypi:~ $ sudo netstat -tulpn | grep LISTEN |grep influx
tcp        0      0 127.0.0.1:8088          0.0.0.0:*               LISTEN      13217/influxd
pi@raspberrypi:~ $

The installation seem to be OK

i@raspberrypi:~ $ sudo apt update
Get:1 http://archive.raspberrypi.org/debian bullseye InRelease [23.7 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Hit:3 https://packages.grafana.com/oss/deb stable InRelease
Hit:4 https://repos.influxdata.com/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_16.x bullseye InRelease
Get:6 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Get:7 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [297 kB]
Fetched 13.6 MB in 9s (1,503 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
pi@raspberrypi:~ $ apt policy influxdb*
influxdb-client:
  Installed: (none)
  Candidate: 1.6.7~rc0-1
  Version table:
     1.6.7~rc0-1 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
influxdb-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
influxdb:
  Installed: 1.8.10-1
  Candidate: 1.8.10-1
  Version table:
 *** 1.8.10-1 500
        500 https://repos.influxdata.com/debian bullseye/stable armhf Packages
        100 /var/lib/dpkg/status
     1.6.7~rc0-1 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
pi@raspberrypi:~ $

Finally I tried again to call influx and got this response:

pi@raspberrypi:/etc/influxdb $ influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show databases
ERR: Post http://localhost:8086/query?chunked=true&db=&epoch=ns&q=show+databases: dial tcp [::1]:8086: connect: connection refused
>

Suddenly it seems able to connect but cannot find any databases but still waiting for some input. Has anybody an idea what I got wrong with this installation and how I can repair that?

Regards Gerhard

nikic2014 commented 2 months ago

I have the same problem only, but curl http://localhost:8086/ping successful