笔记|运维笔记-Kafka

#kafka服务启动: ./kafka-server-start.sh../config/server.properties#查看有哪些topic: ./kafka-topics.sh --list --zookeeper zk服务IP:2181#创建topic: ./kafka-topics.sh --create --zookeeper zk服务IP:2181 --replication-factor 1 --partitions 1 --topic test1#topic分区数修改: ./kafka-topics.sh --zookeeper 127.0.0.1:2181 -alter --partitions 4 --topic test1#kafka生产: ./kafka-console-producer.sh --broker-list kafka服务IP:9092 --topic test1#kafka消费 ./kafka-console-consumer.sh--bootstrap-server localhost:9092 --from-beginning --topic test1#删除topic:(要彻底删除必须把kafka中与当前topic相关的数据目录和zookeeper中与当前topic相关的路径一并删除) ./kafka-topics.sh --zookeeper zk服务IP:2181 --delete --topic test1

    推荐阅读