Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
0.10.0.1
-
None
-
None
Description
I'm attempting to start a docker container using the parameter:
advertised.listeners = PLAINTEXT://dockercomposeproject_kafka_1:9092
However, I get this error:
kafka_1 | java.lang.IllegalArgumentException: Error creating broker listeners from 'PLAINTEXT://dockercomposeproject_kafka_1:9092': Unable to parse PLAINTEXT://dockercomposeproject_kafka_1:9092 to a broker endpoint
kafka_1 | at kafka.server.KafkaConfig.validateUniquePortAndProtocol(KafkaConfig.scala:954)
kafka_1 | at kafka.server.KafkaConfig.getAdvertisedListeners(KafkaConfig.scala:985)
kafka_1 | at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:927)
kafka_1 | at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:743)
kafka_1 | at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:740)
kafka_1 | at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
kafka_1 | at kafka.Kafka$.main(Kafka.scala:58)
kafka_1 | at kafka.Kafka.main(Kafka.scala)
My workaround is to set my envar (for a wurstmeister/kafka-docker container, which is unrelated to this ticket) to:
KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://`getent hosts dockercomposeproject_kafka_1 | awk '{ print $1 }'`:9092
Which resolves to:
advertised.listeners = PLAINTEXT://172.18.0.4:9092
This advertised.listeners resolution allows my docker container to start as expected.
Could sending in hostnames, instead of strict IP addresses, be supported for the advertised.listeners setting?
Thanks!
Attachments
Issue Links
- duplicates
-
KAFKA-3017 hostnames with underscores '_' are not valid
- Resolved