Reply
New Contributor
Posts: 1
Registered: ‎04-20-2017

How can I consume a kafka topic from romote server?

I have a kafka zookeeper with port 2181 and kafka broker with port 9092 in a public server and I am trying to consume the topic content from a client machine. The ports 2181 (zk) and 9092 are open to the consumer machine. I can even do a bin/kafka-topics.sh --list --zookeeper myPublicServer:2181 from my client machine which gives me the list of topics. But when I try to consume or produce message from/to a topic the server no showa the messages.

I've tryed with the next comands:

bin/kafka-console-producer.sh --broker-list myPublicServer:9092 --topic test_topic

and:

bin/kafka-console-consumer.sh --zookeeper myPlublicServer:2181 --topic test_topic

 

Even I configured a flume sink and source for public or consume the messages from the client machine.

 

I configured the file server.properties in the server with the below values:

   listeners=PLAINTEXT://myPlublicServer:9092

   advertised.listeners=PLAINTEXT://myPublicServer:9092

 

Are there some configuration that I am forgetting??

 

Cloudera Employee
Posts: 159
Registered: ‎01-09-2014

Re: How can I consume a kafka topic from romote server?

If you turn on debug, it will give you a good idea of what might be happening:

cp /etc/kafka/conf/tools-log4j.properties /var/tmp
sed -i -e 's/WARN/DEBUG/g' /var/tmp/tools-log4j.properties
export KAFKA_OPTS="-Dlog4j.configuration=file:/var/tmp/tools-log4j.properties"

-pd
Announcements
New Solutions