【Kafka笔记】(三)常用命令整理
查看所有主题
kafka-topics.sh--list--bootstrap-server127.0.0.1:9092创建主题
kafka-topics.sh--create--topictest_topic --bootstrap-server127.0.0.1:9092--partitions3--replication-factor1partitions:分区数
replication-factor:副本数
查看主题详情
kafka-topics.sh--describe--topictest_topic --bootstrap-server127.0.0.1:9092控制台生产数据
kafka-console-producer.sh--topictest_topic --bootstrap-server127.0.0.1:9092控制台消费数据
# 消费最新数据kafka-console-consumer.sh--topictest_topic --bootstrap-server127.0.0.1:9092# 从头消费所有数据kafka-console-consumer.sh--topictest_topic --bootstrap-server127.0.0.1:9092 --from-beginning删除主题
kafka-topics.sh--delete--topictest_topic --bootstrap-server127.0.0.1:9092