Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

kafka consumer throwing an error

Highlighted

kafka consumer throwing an error

I have created a topic and started the producer but when I try to consume the message it throws an error :

commands executed are below :

export JVMFLAGS="-Djava.security.auth.login.config=/etc/kafka/2.6.1.0-129/0/kafka_client_jaas.conf"
/usr/hdp/2.6.1.0-129/kafka/bin/kafka-topics.sh --zookeeper <zkhost>:2181  --create --topic finaltopic  --replication-factor 1 --partitions 1
/usr/hdp/2.6.1.0-129/kafka/bin/kafka-console-producer.sh --broker-list <kafka_broker>:9092 --topic finaltopic
 /usr/hdp/2.6.1.0-129/kafka/bin/kafka-console-consumer.sh --zookeeper <zkhost>:2181  --topic finaltopic  --from-beginning

but it throws below error why i start the consumer :

[2018-08-23 16:14:02,971] WARN [console-consumer-57032_<host>-1535033627757-4668621a-leader-finder-thread], Failed to find leader for Set(finaltopic-0) (kafka.consumer.ConsumerFetcherManager$LeaderFinderThread)
kafka.common.BrokerEndPointNotAvailableException: End point with security protocol PLAINTEXT not found for broker 1001
        at kafka.cluster.Broker$anonfun$5.apply(Broker.scala:128)
        at kafka.cluster.Broker$anonfun$5.apply(Broker.scala:128)
        at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
        at scala.collection.AbstractMap.getOrElse(Map.scala:58)
        at kafka.cluster.Broker.getBrokerEndPoint(Broker.scala:127)
        at kafka.utils.ZkUtils$anonfun$getAllBrokerEndPointsForChannel$1.apply(ZkUtils.scala:254)
        at kafka.utils.ZkUtils$anonfun$getAllBrokerEndPointsForChannel$1.apply(ZkUtils.scala:254)
        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.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at kafka.utils.ZkUtils.getAllBrokerEndPointsForChannel(ZkUtils.scala:254)

also I have tried to run the consumer this way as well but error is same :

/usr/hdp/2.6.1.0-129/kafka/bin/kafka-console-consumer.sh --zookeeper <zkhost>:2181  --topic finaltopic  --from-beginning --security-protocol SASL_PLAINTEXT
Don't have an account?
Coming from Hortonworks? Activate your account here