Kafka 命令行操作
CDH 的 kafka 命令脚本安装目录:
/opt/cloudera/parcels/KAFKA-2.2.0-1.2.2.0.p0.68/lib/kafka/bin
List Topics:
./kafka-topics.sh --zookeeper 172.16.26.4:2181/kafka --list
List Consumer Groups:
./kafka-consumer-groups.sh --bootstrap-server bd-kafka31-pe2:9092 --list
./kafka-consumer-groups.sh --bootstrap-server bd-kafka31-pe2:9092 --describe --group ConsumerGroupName
Read Topic:
./kafka-topics.sh --zookeeper 172.16.26.4:2181/kafka --list
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic TopicName