ui icon indicating copy to clipboard operation
ui copied to clipboard

Unable to write data in influxdb, connection to 127.0.0.1:8086 keeps getting refused.

Open gsalmanali opened this issue 2 years ago • 0 comments

I am constantly getting the following error in influxdb-writer container

{"level":"warn","message":"Failed to handle Mainflux message: failed to save message to influxdb database : Post "http://localhost:8086/write?consistency=&db=mainflux&precision=ns&rp=": dial tcp 127.0.0.1:8086: connect: connection refused"

Assuming that the containers might not be able to recognize localhost or host addresses when calling them from within their own containers, i added to influxdb contianers the following lines:

extra_hosts: - "host.docker.internal:host-gateway"

Also switched 'host-gateway' with docker0 address (172.17.0.1) and docker_gwbridge (172.18.0.1) address but that didn't work. Everything works except for when trying to use influxdb writer or reader services. I also made sure the ports 8086, 8088 8090 were not used by any other service other than then being used by containers but that didn't help either. I am not sure if i should be adding network mode 'host' altogether because that would defeat the purpose of the custom bridge docker network. All the containers are up and running without issues!

gsalmanali avatar Jun 19 '22 21:06 gsalmanali