kafka zookeeper 常用命令以及排错分析

Kafka

查看所有Topic

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

查看Topic详情

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

手动创建Topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 3 --topic test

启动生产者

./kafka-console-producer.sh --broker-list localhost:9092 --topic test

启动消费者

./kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic test

Zookeeper

进入zkCli shell

bin/zkCli.sh -server localhost:2181

删除某topic path

rmr /broker/topic/{topicname}

查看zk角色

bin/zkServer.sh status


版权声明:本文为yanminghaop原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。