Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gsalmanali opened this issue Jun 19, 2022 · 0 comments

Comments

@gsalmanali
Copy link

gsalmanali commented Jun 19, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant