[toc]
list consumer groups
1 | 列出所有 consumer group |
list topic
1 | ./bin/kafka-topics.sh --list --zookeeper server.zk |
清空 topic
1 | kafka-configs.sh --zookeeper <zkhost>:2181 --alter --entity-type topics --entity-name <topic name> --add-config retention.ms=1000 |
查看 topic 信息
1 | ./bin/kafka-topics.sh --zookeeper c3cloudsrv.zk.hadoop.srv:11000/kafka/c3cloudsrv-feeds --describe --topic model_diff_update_111 |
1 | kafka-topics --zookeeper 127.0.0.1:2181 --describe --topic <topic-name> |
消费
1 | ./bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic <topic> --from-beginning |
指定配置文件
kafka-auth.properties
1 | security.protocol = "ssl" |
1 | 指定配置文件 |
参考
环境变量指定认证
1 | CONNECT_CONSUMER_SECURITY_PROTOCOL: SASL_SSL |
发送消息
1 | /bin/kafka-console-producer.sh --broker-list localhost:9092 --topic <topic> |
删除 topic
1 | ./bin/kafka-topics --delete --zookeeper 127.0.0.1:2181 --topic <topic-name> |