Created 09-30-2016 06:48 AM
I'm using HDP 2.3.4 with kafka 0.9
I just started to use kafka referring to this document, but having problem with the kafka-console-consumer.
below are the commands used to create a topic and publish messages
bin/kafka-topics.sh --zookeeper <serverX>:2181 --create --topic test2 --partitions 2 --replication-factor 1
bin/kafka-console-producer.sh --broker-list <brokerX>:6667 --topic test2 --security-protocol SASL_PLAINTEXT
both commands worked well.
Tried kafka simple consumer, and worked well, message were read and displayed
bin/kafksimple-consumer-shell.sh --broker-list <brokerX>:6667 --topic test2 --security-protocol SASL_PLAINTEXT --partition 0
bin/kafksimple-consumer-shell.sh --broker-list <brokerX>:6667 --topic test2 --security-protocol SASL_PLAINTEXT --partition 1
but I'm not able to get kafka-console-consumer work.
Tried below command first, but hitting exceptions:
bin/kafka-console-consumer.sh --zookeeper <serverX>:2181 --topic test2 --from-beginning --security-protocol SASL_PLAINTEXT
WARN [console-consumer-89015_xxx-1475146648772-75b1a67a-leader-finder-thread], Failed to find leader for Set([test2,0], [test2,1]) (kafka.consumer.ConsumerFetcherManager$LeaderFinderThread) kafka.common.BrokerEndPointNotAvailableException: End point SASL_PLAINTEXT not found for broker 1002
some online post suggested to use new-consumer option for kafka 0.9, so tried the command below:
bin/kafka-console-consumer.sh --zookeeper <serverX>:2181 --topic test2 --bootstrap-server <serverY>:9092 --new-consumer --security-protocol SASL_PLAINTEXT
consumer started without error, but no messages were read and displayed.
I'm not sure what went wrong, any suggestions? Thanks a lot!
Created 10-01-2016 03:18 AM
If you are not using Kerberos, can you open bin/kafka-console-consumer.sh in an editor and comment out Kerberos related "export" command from the script. In my related article, at the bottom, you can find a sed command how to comment out those commands in all kafka scripts.
Created 09-04-2017 06:59 AM
Hi @pp z
Try these and let me know.
Thanks
Created 09-07-2017 08:36 PM
--security-protocol PLAINTEXTSASL solved it