[ https://issues.apache.org/jira/browse/KAFKA-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14621085#comment-14621085 ]
ASF GitHub Bot commented on KAFKA-2327: --------------------------------------- GitHub user granders opened a pull request: https://github.com/apache/kafka/pull/73 KAFKA-2327 Added unit tests as well. These fail without the fix, but pass with the fix. You can merge this pull request into a Git repository by running: $ git pull https://github.com/confluentinc/kafka KAFKA-2327 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/73.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #73 ---- commit 23b3340b91800ff6568ac8f07f9188659358ecc3 Author: Geoff Anderson <ge...@confluent.io> Date: 2015-07-09T19:01:27Z Fixes KAFKA-2327 ---- > broker doesn't start if config defines advertised.host but not advertised.port > ------------------------------------------------------------------------------ > > Key: KAFKA-2327 > URL: https://issues.apache.org/jira/browse/KAFKA-2327 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.8.3 > Reporter: Geoffrey Anderson > Assignee: Geoffrey Anderson > Priority: Minor > > To reproduce locally, in server.properties, define "advertised.host" and > "port", but not "advertised.port" > port=9092 > advertised.host.name=localhost > Then start zookeeper and try to start kafka. The result is an error like so: > [2015-07-09 11:29:20,760] FATAL (kafka.Kafka$) > kafka.common.KafkaException: Unable to parse PLAINTEXT://localhost:null to a > broker endpoint > at kafka.cluster.EndPoint$.createEndPoint(EndPoint.scala:49) > at > kafka.utils.CoreUtils$$anonfun$listenerListToEndPoints$1.apply(CoreUtils.scala:309) > at > kafka.utils.CoreUtils$$anonfun$listenerListToEndPoints$1.apply(CoreUtils.scala:309) > at > scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) > at > scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) > at > scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) > at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34) > at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) > at scala.collection.AbstractTraversable.map(Traversable.scala:105) > at kafka.utils.CoreUtils$.listenerListToEndPoints(CoreUtils.scala:309) > at > kafka.server.KafkaConfig.getAdvertisedListeners(KafkaConfig.scala:728) > at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:668) > at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:541) > at kafka.Kafka$.main(Kafka.scala:58) > at kafka.Kafka.main(Kafka.scala) > Looks like this was changed in 5c9040745466945a04ea0315de583ccdab0614ac > the cause seems to be in KafkaConfig.scala in the getAdvertisedListeners > method, and I believe the fix is (starting at line 727) > {code} > ... > } else if (getString(KafkaConfig.AdvertisedHostNameProp) != null || > getInt(KafkaConfig.AdvertisedPortProp) != null) { > CoreUtils.listenerListToEndPoints("PLAINTEXT://" + > getString(KafkaConfig.AdvertisedHostNameProp) + ":" + > getInt(KafkaConfig.AdvertisedPortProp)) > ... > {code} > -> > {code} > } else if (getString(KafkaConfig.AdvertisedHostNameProp) != null || > getInt(KafkaConfig.AdvertisedPortProp) != null) { > CoreUtils.listenerListToEndPoints("PLAINTEXT://" + > advertisedHostName + ":" + advertisedPort > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)