美文网首页
Kafka shell 查看指定topic partition

Kafka shell 查看指定topic partition

作者: MoreThanMing | 来源:发表于2017-08-11 17:31 被阅读0次

    有时需要简单的用shell去检查一个topic下边某一个partition的某个offset的消息。

    之前一直用 kafka.tools.ConsoleConsumer, 用的心酸。

    后来发现一个稍强大的工具。
    https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example

    sample usage:

    kafka-run-class.sh kafka.tools.SimpleConsumerShell 
        --broker-list 'xxxx:9092' 
        --topic 'xxx.xxx.xx.xx' 
        --max-messages 1 
        --offset 12345
        --partition 1
    

    其他命令:

    kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 'xxxx:9092' --topic 'xxxx' --time -1
    

    相关文章

      网友评论

          本文标题:Kafka shell 查看指定topic partition

          本文链接:https://www.haomeiwen.com/subject/qzdrrxtx.html