zookeeper&kafka基本操作和可视化工具使用

zookeeper:

https://www.w3cschool.cn/zookeeper/zookeeper_cli.html

kafka:

https://cloud.tencent.com/developer/article/1775065

kafka可视化工具使用帮助:

Kafka 可视化工具(Kafka Tool) - 龙凌云端 - 博客园 (cnblogs.com)

命令行启动kafka:

./bin/zookeeper-server-start.sh config/zookeeper.properties
./bin/kafka-server-start.sh config/server.properties

后台启动kafka:

nohup ./bin/zookeeper-server-start.sh config/zookeeper.properties &

./bin/kafka-server-start.sh -daemon config/server.properties

1、查看topic

bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

 
2、查看一个具体topic的详情
bin/kafka-topics.sh --describe --topic first --bootstrap-server localhost:9092
 
3、查询topic内容
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first --from-beginning
 
4、创建topic
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic first
 
5、往topic 为 first 的内部生产消息
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic first
 
6、从topic 为first的内部消费消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first
7、每个分区消息数量。-1获取最大位移 -2获取最小位移 。相减获取消息数量
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic first --time -1
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic first --time -2
https://www.cnblogs.com/zhangkaimin/p/16547054.html
posted @   zjb480  阅读(55)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 提示词工程——AI应用必不可少的技术
· 地球OL攻略 —— 某应届生求职总结
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界
点击右上角即可分享
微信分享提示