Kafka producer-consumer issues


Dear ITversity-Team,

I tried to send messages via kafka and then get them, but each time I get response, that kafka broker is unavailable. What am I doing wrong:

  1. I enter the folder cd /usr/hdp/current/kafka-broker/bin
  2. Run commands: export KAFKA_HOME=/usr/hdp/current/kafka-broker
    export PATH=$PATH:$KAFKA_HOME/bin
  3. Produce messages
    kafka-console-producer.sh --broker-list nn01.itversity.com:6667,nn02.itversity.com:6667,rm01.itversity.com:6667 --topic demoKafka
  4. Consume messages: kafka-console-consumer.sh --bootstrap-server nn01.itversity.com:6667,nn02.itversity.com:6667,rm01.itversity.com:6667
    –zookeeper nn01.itversity.com:2181,nn02.itversity.com:2181,rm01.itversity.com:2181
    –topic demoKafka --from-beginning

Thanks for help!


@Alexander The hosts which you are using are not correct. Please refer the link to get start with kafka in Itversity labs.