Last active
April 24, 2018 22:38
-
-
Save anhtranbk/98a509ec84cb0daa4a8fbbbd114c5375 to your computer and use it in GitHub Desktop.
Using Kafka Command-line Tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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