kafka常用命令

启动kafka:

  bin/kafka-server-start.sh config/server.properties &

停止kafka:
  bin/kafka-server-stop.sh

创建topic
  bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic wpp-topic

展示topic
  bin/kafka-topics.sh --list --zookeeper localhost:2181

描述topic
  bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic wpp-topic

生产者:
  bin/kafka-console-producer.sh --broker-list localhost:9092 --topic wpp-topic

  bin/kafka-console-producer.sh --broker-list localhost:9092 --topic wpp-topic --producer.config /root/wpp/producer.properties

消费者:
  bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic wpp-topic

    bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic wpp-topic --from-beginnin --consumer.config /root/wpp/consumer.properties

  bin/kafka-console-consumer.sh --bootstrap-server:localhost:9092 --topic wpp-topic

原文地址:https://www.cnblogs.com/guoguochong/p/10570541.html