查看所有主题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
【Kafka笔记】(三)常用命令整理
发布时间:2026/5/22 2:39:23
查看所有主题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