wurstmeister / kafka-docker

Dockerfile for Apache Kafka
http://wurstmeister.github.io/kafka-docker/
Apache License 2.0
6.89k stars 2.73k forks source link

When run second consumer, the docker port changed automaticlly and previous consumer/producer disconnected #717

Open wolfwell5 opened 1 year ago

wolfwell5 commented 1 year ago
image

After run up one producer, one consumer, everything is OK, but when I run second consumer(sometimes run the third consumer, the port of local machine changed automatily. then producer or consumer will disconnected... Not very familiar with docker/kafka, so don't know why this happen. Hope hear your sound, thx in advanced

OneCricketeer commented 1 year ago

If ports are changing on the same service, then it's crashing and you'll need to look at the server logs...

One solution - Don't use 3 Kafka brokers locally with plain port exposure. Main reason - you're "wasting" disk space/cycles if you have replication factor more than 1; you can use one broker with a static port.

Or, you need to edit the listeners on the three services such that their ports don't overlap, then statically assign them to your host