confluentinc / bottledwater-pg

Change data capture from PostgreSQL into Kafka
http://blog.confluent.io/2015/04/23/bottled-water-real-time-integration-of-postgresql-and-kafka/
Apache License 2.0
2 stars 149 forks source link

bottledwater service depends on both postgres and postgres-94 causing port conflicts #105

Closed kinghuang closed 8 years ago

kinghuang commented 8 years ago

The bottledwater-json and bottledwater-avro services in the Docker Compose file has links to both the postgres and postgres-94 services. The postgres services both have a port mapping for 45432 on the host, which causes an error when starting bottledwater-json or bottledwater-avro.

bottledwater-json and bottledwater-avro should probably just link to postgres only, dropping postgres-94.

samstokes commented 8 years ago

Thanks for this report!

I've been making a lot of changes to the Docker Compose setup as it's used in the test suite to automate setting up a test cluster, and some of them broke more normal uses of Docker Compose. The problem you note was actually deliberate, but it does break the instructions in the readme :) This is done for the Docker Compose "links" feature, so that the Bottled Water container can address whichever Postgres is running simply by the hostname "postgres". This works fine in the tests, which run docker-compose up --no-deps [service] and explicitly start just one of the Postgressen, but on the command line a simple docker-compose up bottledwater-json will attempt to start both, and fail because they attempt to bind the same host port.

As a workaround, I've submitted PR #106 which assigns different host ports to each Postgres service, so they no longer clash. This still means you'll end up redundantly running one more Postgres than you actually wanted, but that should be fairly harmless.

kinghuang commented 8 years ago

Ah, thanks for the detailed explanation here and PR #106! I was indeed trying to follow the README instructions.

samstokes commented 8 years ago

I've just merged that PR so the instructions in the README ought to work now. Do let me know if you're still having problems!