解决spark任务报错:java.lang.IllegalArgumentException: requirement failed: numRecords must not be negative
如题,这个任务的报错是有由于消费方的消费条数和注册中心的不一致导致的。解决方法仅供参考哈:1、先到kafka集群查看消费偏移量./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list [集群地址:对应端口] --topic [topic名](Pid(分区id)、Offset(当前已消费的条数)、LogSize(总条数)、Lag(未消
·
如题,这个任务的报错是有由于消费方的消费条数和注册中心的不一致导致的。解决方法仅供参考哈:
1、先到kafka集群查看消费偏移量
./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list [集群地址:对应端口] --topic [topic名]
(Pid(分区id)、Offset(当前已消费的条数)、LogSize(总条数)、Lag(未消费的条数))
2、修改注册中心zookeeper 的偏移量
a、先进入zookeeper :/appcom/zookeeper/bin/zkCli.sh
b、可查看所有的group:ls /consumers
c、设置偏移量:set /consumers/[group]/offsets/[topic]/0 165 其中0指分区
d、 查看偏移量:get /consumers/[group]/offsets/[topic]/0
3、修改完后重跑任务即可。
更多推荐
所有评论(0)