deyu9999: 分享自动查询所有topic的最大最小offset脚本: #!/bin/bash arr2=$(/opt/kafka/bin/ --list --zookeeper 176.1.19.149:2181) array=(${arr2// / }) for var in ${array[@]} do output_max=$(/opt/kafka/bin/ --topic ${var} --time -1 --broker-list 176.1.19.149:9092) echo "$output_max" >> offset_kafka.txt echo "$output_max" output_min=$(/opt/kafka/bin/ --topic ${var} --time -2 --broker-list 176.1.19.149:9092) echo "$output_min" >> offset_kafka.txt echo "$output_min" done
Hive之find_in_set函数
查看kafka topic的消息offset范围