1.启动命令:bin/kafka-server.start.sh ./config/server.properties
2.创建主题:bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic test --partitions 2 --replication-factor 2
3.展示所有主题:bin/kafka-topics.sh --zookeeper localhost:2181 --list
4.查看主题详情:bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic test
5.启动消费端接收消息: bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test
6.启动生产端发送消息:bin/kafka-console-producer.sh --broker-list localhsot:9092 --topic test
7.添加一个分区:bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic test