我正在转储Kafka日志消息以查看日志文件中的内容。但是,它不显示任何有效载荷。
有人可以让我知道我做错了吗?
查看此
[gaurang.shah@hadoop_dev]$ cat 00000000000000000002.log
?B�i%f��i%f����������������testingD9�6pi%u%4i%u%4��������������$llllllllllll[gaurang.shah@hadoop_dev]$
[gaurang.shah@hadoop_dev]$ /usr/hdp/current/kafka-broker/bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files 00000000000000000002.log --print-data-log
Dumping 00000000000000000002.log
Starting offset: 2
baseOffset: 2 lastOffset: 2 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 0 isTransactional: false position: 0 CreateTime: 1551110670527 isvalid: true size: 75 magic: 2 compresscodec: NONE crc: 507646879
baseOffset: 3 lastOffset: 3 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 0 isTransactional: false position: 75 CreateTime: 1551111628084 isvalid: true size: 80 magic: 2 compresscodec: NONE crc: 970929776
答案 0 :(得分:1)
尝试使用以下命令:(添加--deep-iteration
标志)
/usr/hdp/current/kafka-broker/bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files 00000000000000000002.log --deep-iteration --print-data-log
从v2.0版本开始,当传递--print-data-log
标志时,deep-iteration
被默认启用。