In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What are the common commands of kafka? Many novices are not very clear about this. In order to help you solve this problem, the following small series will explain it in detail for everyone. Those who have this need can learn it. I hope you can gain something.
./ kafka-topics.sh--help //Help Documentation
1 ./ kafka-topics.sh--list --zookeeper ambari1:2181,ambari2:2181 //View list of kafka topics
2 ./ kafka-topics.sh--describe --zookeeper ambari1:2181,ambari2:2181 //See all kafka theme details
3 ./ kafka-topics.sh--describe --zookeeper ambari1:2181,ambari2:2181 --topic test /View details of a given topic in kafka
4 ./ kafka-topics.sh--delete --zookeeper ambari1:2181,ambari2:2181 --topic test /delete a topic
5 ./ kafka-topics.sh--zookeeper ambari1:2181,ambari2:2181 --create --topic test --replication-factor 3 --partitions 2 //Create a topic called test with two partitions, 3 copies per partition
6 Test kafka sending and receiving messages (start two terminals)
#Send message (note port number is port number in configuration file)
./ kafka-console-producer.sh --broker-list ambari1:9092 --topic test
#Consuming messages (possibly port number consistent with profile, or consistent with sending port)
./ kafka-console-consumer.sh--bootstrap-server ambari1:9092 --topic test --from-beginning #added--from-beginning repeat consume all messages
./ kafka-console-consumer.sh--bootstrap-server ambari1:9092 --topic test #no--from-beginning Start consuming from the latest message
./ kafka-console-consumer.sh--bootstrap-server ambari1:9092 --topic test --group consumerGroup1 #Specify consumer group
7 View the number of messages corresponding to a topic
./ kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic test --time -1
8 shows all consumers
./ kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
9 Get offset of group of topic (console-consumer-63307) being consumed
./ kafka-consumer-groups.sh --describe --group console-consumer-63307 --bootstrap-server localhost:9092
Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.