yahoo / CMAK

CMAK is a tool for managing Apache Kafka clusters
Apache License 2.0
11.83k stars 2.51k forks source link

Problem with parsing brokers list #719

Open amazoyer opened 4 years ago

amazoyer commented 4 years ago

Hi,

I have an issue with the connection of Kafka-Manager to my Kafka Cluster. I provide the correct ZkHosts and the connection works well. However, I have the following exception in log:

2020-01-31 16:43:29,425 - [ERROR] k.m.a.c.KafkaStateActor - KafkaTopicOffsetGetter exception

  | org.apache.kafka.common.KafkaException: Failed to construct kafka consumer   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:811)   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:659)   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:639)   | at kafka.manager.actor.cluster.KafkaStateActor$KafkaTopicOffsetGetter.$anonfun$run$21(KafkaStateActor.scala:1489)   | at kafka.manager.actor.cluster.KafkaStateActor$KafkaTopicOffsetGetter.$anonfun$run$21$adapted(KafkaStateActor.scala:1467)   | at scala.collection.Iterator.foreach(Iterator.scala:941)   | at scala.collection.Iterator.foreach$(Iterator.scala:941)   | at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)   | at scala.collection.MapLike$DefaultKeySet.foreach(MapLike.scala:181)   | at kafka.manager.actor.cluster.KafkaStateActor$KafkaTopicOffsetGetter.$anonfun$run$20(KafkaStateActor.scala:1467)   | Caused by: org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers   | at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:90)   | at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:49)   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:721)   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:659)   | at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:639)   | at kafka.manager.actor.cluster.KafkaStateActor$KafkaTopicOffsetGetter.$anonfun$run$21(KafkaStateActor.scala:1489)   | at kafka.manager.actor.cluster.KafkaStateActor$KafkaTopicOffsetGetter.$anonfun$run$21$adapted(KafkaStateActor.scala:1467)   | at scala.collection.Iterator.foreach(Iterator.scala:941)   | at scala.collection.Iterator.foreach$(Iterator.scala:941)   | at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)

It seems that it cannot reach the broker servers. It makes sense since the brokers that are listed in the Kafka Manager UI are internal addresses that can not be reached from my Kafka-Manager host. I have a feeling that Kafka-Manager had an issue to parse the "brokers" node value of my Zookeeper. The value I have in this node for my Kafka config is:

{"listener_security_protocol_map":{"INTERNAL":"PLAINTEXT","EXTERNAL":"PLAINTEXT"},"endpoints":["INTERNAL://internal-host-0:9092","EXTERNAL://169.12.22.13:19092"],"rack":"loc","jmx_port":9999,"host":"internal-host-0","timestamp":"1576003178596","port":9092,"version":4}

And Kafka-Manager shows this one in the UI : "internal-host-0:9092", which is not the expected one (I expect 169.12.22.13:19092). Do you think there is a bug in Kafka-Manager parsing method or there is a way to modify Kafka config to make it work with Kafka-Manager?

Thank you,

Aurelien

stevewampler commented 4 years ago

I'm having the same issue. Is there a way to configure the app's bootstrap.servers?

stevewampler commented 4 years ago

In my case, I was running zookeeper and kafka in docker-compose (on a Mac) and needed to add a kafka-broker entry to my /etc/hosts: 127.0.0.1 kafka-broker (where kafka-broker is the name of my kafka broker container in my docker-compose file).