influxdata / influxdb-rails

Ruby on Rails bindings to automatically write metrics into InfluxDB
MIT License
212 stars 63 forks source link

InfluxDB: Failed to contact host #219

Open kinsomicrote opened 1 year ago

kinsomicrote commented 1 year ago

Hello, I'm trying to connect my InfluxDb with my Rails app but I'm faced with this error;

 WARN -- InfluxDB: Failed to contact host xxxxx: #<SocketError: Failed to open TCP connection to xxxx:8086 (getaddrinfo: nodename nor servname provided, or not known)>

I made the changes suggested in this issue: https://github.com/influxdata/influxdb-rails/issues/153

Here is what my config looks like;

config.client.database = "db"
 config.client.hosts = ["host"]
  config.client.port = 8086
  config.client.use_ssl = true

  ## If you've setup user authentication (and activated it in the server
  ## config), you need to configure the credentials here.
  config.client.username = "xxxx"
  config.client.password = "xxx"

I'm able to send a request to influxdb from another container in the same network, and also from my machine using postman. I can see the requests in the container logs for influxdb. But my Rails app keeps giving the same error, locally and on my server. Any hints?

ChrisBr commented 1 year ago

I'm able to send a request to influxdb from another container in the same network

How do you send the request from another machine? Which version of Influxdb are you using?