Skip to content

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

Description

@gsalmanali

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions