crate/cratedb-toolkit

[I/O] InfluxDB adapter: `Failed to establish a new connection: [Errno 111] Connection refused`, when using Docker runtime

amotl opened this issue · 2 comments

Procedure

docker run -d --name crate -p 4200:4200 crate/crate:latest

docker run -d --name influxdb -p 8086:8086 \
    --env=DOCKER_INFLUXDB_INIT_MODE=setup \
    --env=DOCKER_INFLUXDB_INIT_USERNAME=user1 \
    --env=DOCKER_INFLUXDB_INIT_PASSWORD=secret1234 \
    --env=DOCKER_INFLUXDB_INIT_ORG=example \
    --env=DOCKER_INFLUXDB_INIT_BUCKET=testdrive \
    --env=DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=token \
    influxdb:latest

alias ctk="docker run --rm -it ghcr.io/crate-workbench/cratedb-toolkit:latest ctk"
ctk load table influxdb2://example:token@localhost:8086/testdrive/demo --cratedb-sqlalchemy-url "crate://crate@localhost:4200/testdrive/demo"

Problem

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9ebfd32450>: Failed to establish a new connection: [Errno 111] Connection refused

References

Evaluation

When running all services in Docker, manually, like outlined above, you will need to address the service containers appropriately on behalf of corresponding host names.

For your recipe, that command, using the host names influxdb and crate, may help.

ctk load table \
  influxdb2://example:token@influxdb:8086/testdrive/demo \
  --cratedb-sqlalchemy-url "crate://crate@crate:4200/testdrive/demo"

Suggestions

  • Improve the documentation accordingly.
  • Use the "hostname" cratedb for the CrateDB container.

Summary

There have been a few connectivity quirks (bugs, ambiguities, you name it), which have been improved on behalf of corresponding patches.

Patches

References