/ 195浏览

kafka相关命令

依次在各节点上启动: ./kafka-server-start.sh -daemon ../config/server.properties
查看当前服务器中的所有topic
./kafka-topics.sh --list --zookeeper localhost:2181
创建topic
./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic CustomerContacts
删除topic
./kafka-topics.sh --delete --zookeeper localhost:2181 --topic CustomerContacts
查看消费位置
./kafka-run-cla.ss.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181 --group testGroup
查看某个Topic的详情
./kafka-topics.sh --topic test --describe --zookeeper localhost:2181
对分区数进行修改
./kafka-topics.sh --zookeeper localhost:2181 --alter --partitions 15 --topic utopic
查看当前topic的消费进度
./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181 --group nt1 --topic master5
查看分区的情况:
./kafka-topics.sh --describe --zookeeper localhost:2181 --topic ConsumerAAAA