Kafka_QucikStart 发表于 2019-03-14 更新于 2024-09-08 Kafka 常用命令记录贴 Start Server123456# 开启系统集成的Zookeeper# 简便做法,不推荐bin/zookeeper-server-start.sh config/zookeeper.properties# 开启Kafka Broker,使用指定propertiesbin/kafka-server-start.sh config/server.properties Topic12345678# 创建Topic 并设置命令行设置相关参数bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic ${topicName}# List Topicsbin/kafka-topics.sh --list --zookeeper localhost:2181# Get Topic Detailbin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic ${TopicName} Producer||Consumer Command1234# 命令行建立一个Producerbin/kafka-console-producer.sh --broker-list localhost:9092 --topic test# 命令行建立一个Consumerbin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ${topicName} --from-beginning