1.启动zookeeper
bin/zkServer.sh start config/zookeeper.properties
2.关闭zookeeper
bin/zkServer.sh stop config/zookeeper.properties
3.启动kafka
bin/kafka-server-start.sh config/server.properties
4.关闭kafka
bin/kafka-server-stop.sh config/server.properties
5.kafka创建topic
bin/kafka-topics.sh --create --zookeeper xx.xx.xx.xx:2181 --replication-factor 1 --partitions 1 --topic xx
6.kafka删除topic
bin/kafka-topics.sh --delete --zookeeper xx.xx.xx.xx:2181 --topic xxx
7.扩展分区
./bin/kafka-topics.sh --alter --topic topic_interface_notify --zookeeper xx.xx.xx.xx:2181 --partitions x
8.查看kafka消费情况
bin/kafka-consumer-groups.sh --zookeeper xx.xx.xx.xx:2181 --group xxxx --describe
9.彻底删除kafka的topic
9.1停止该topic的生产和消费
9.2 config/server.properties 设置 delete.topic.enable=true
9.3bin/kafka-topics.sh --delete --zookeeper xx.xx.xx.xx:2181 --topic xxx
9.4删除log(server.properties文件log.dirs配置),全部删除(或者只删除跟topic有关的)
9.5到zookeeper目录:bin/zkCli.sh -server xx.xx.xx.xx:2181
9.6删除zookeeper中的topic:rmr /brokers/topics/xxxx
9.7重启下kafka