Kafka常用命令
1.创建topic ./kafka-topics.sh --create --topic test1 --replication-factor 2 --partitions 3 --zookeeper hbp001:2181 2.增加partition ./kafka-topics.sh --zookeeper node01:2181 --alter --topic t_cdr --partitions 10 3.查看所有topic列表 4.查看指定topic信息 ./kafka-topics.sh --zookeeper hbp201:2181 --describe --topic t_cdr 5.控制台向topic生产数据 ./kafka-console-producer.sh --broker-list node86:9092 --topic t_cdr 6.控制台消费topic的数据 ./kafka-console-consumer.sh -zookeeper hdh247:2181 --from-beginning --topic fieldcompact 7.查看topic某分区偏移量最大(小)值 ./kafka-run-class.sh kafka.tools.GetOffsetShell --topic hive-mdatabase-hostsltable -