Common commands of apache kafka10.0.2.0

start zookeeper

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

start kafka

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

stop kafka
bin/kafka-server-stop.sh

stop zookeeper
bin/zookeeper -server-stop.sh
Copy code
Copy code
Create topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

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

describe topic
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-replicated-topic

producer:
bin/kafka-console-producer.sh -- broker-list 130.51.23.95:9092 --topic my-replicated-topic

consumer:

bin/ kafka-console-consumer.sh --zookeeper 130.51.23.95:2181 --topic test --from


-
beginnin Topic topicname Delete the content stored in topic Find the following location in config/server.properties
  
   Delete the file directory specified by log.dirs, and then restart it

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357335&siteId=291194637