kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joaquin Casares (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (KAFKA-4121) Allow creating broker listeners from hostname
Date Mon, 12 Sep 2016 16:11:21 GMT

     [ https://issues.apache.org/jira/browse/KAFKA-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joaquin Casares resolved KAFKA-4121.
------------------------------------
    Resolution: Duplicate

> Allow creating broker listeners from hostname
> ---------------------------------------------
>
>                 Key: KAFKA-4121
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4121
>             Project: Kafka
>          Issue Type: Improvement
>          Components: config
>    Affects Versions: 0.10.0.1
>            Reporter: Joaquin Casares
>            Priority: Minor
>
> I'm attempting to start a docker container using the parameter:
> {CODE}
> advertised.listeners = PLAINTEXT://dockercomposeproject_kafka_1:9092
> {CODE}
> However, I get this error:
> {CODE}
> 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)
> {CODE}
> My workaround is to set my envar (for a wurstmeister/kafka-docker container, which is
unrelated to this ticket) to:
> {CODE}
> KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://`getent hosts dockercomposeproject_kafka_1 | awk
'{ print $1 }'`:9092
> {CODE}
> Which resolves to:
> {CODE}
> advertised.listeners = PLAINTEXT://172.18.0.4:9092
> {CODE}
> 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!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message