本文内容主要记录Kafka常用命令

(1)根据topic设置聊天组大小

./bin/kafka-topics.sh --zookeeper 172.25.0.6:2181 --alter --topic db_realtime_data_zoon_us --config max.message.bytes=104857600

(2)设置kafka位移量为最早

./bin/kafka-consumer-groups.sh --bootstrap-server 172.25.0.21:9092 --group test_group_us --reset-offsets --to-earliest --topic db_realtime_data_zoon_cn --execute

(3)设置查看kafka中topic消费情况

./bin/kafka-consumer-groups.sh --describe --bootstrap-server localhost:9092 --group test_group_us

(4)自定义kafka位移

./bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group test-group --reset-offsets --all-topics --to-offset 500000 --execute

查询数据库中订阅情况

select * from pg_stat_replication;SELECT * FROM pg_replication_slots;

查询topic

./bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

查询group

./bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list