Skip to content

Instantly share code, notes, and snippets.

@anhtranbk
Last active April 24, 2018 22:38
Show Gist options
  • Save anhtranbk/98a509ec84cb0daa4a8fbbbd114c5375 to your computer and use it in GitHub Desktop.
Save anhtranbk/98a509ec84cb0daa4a8fbbbd114c5375 to your computer and use it in GitHub Desktop.
Using Kafka Command-line Tools
# list topics
kafka-topics.sh --list --zookeeper 192.168.23.64:2181
# describe topic
kafka-topics.sh --describe --zookeeper 192.168.23.64:2181 --topic test
# create, alter topic
kafka-topics.sh --create --zookeeper 192.168.23.64:2181 --topic test --replication-factor 2 --partitions 3
# Read data from a Kafka topic and write it to standard output
kafka-console-consumer.sh --bootstrap-server 192.168.23.64:9092 --topic test
# Read data from standard output and write it to a Kafka topic
kafka-console-producer.sh --broker-list 192.18.23.64:9092 --topic test
# offset checker
kafka-run-class.sh kafka.tools.ConsumerOffsetChecker
--topic fbpage-cmt
--group tester4
--zookeeper 192.168.23.64:2181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment