当前位置:   article > 正文

记录一个flink跑kafka connector遇到的问题

记录一个flink跑kafka connector遇到的问题

【报错】

  1. D:\Java\jdk1.8.0_231\bin\java.exe "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2022.2.3\lib\idea_rt.jar=56647:D:\Program Files\JetBrains\IntelliJ IDEA 2022.2.3\bin" -Dfile.encoding=UTF-8 -classpath D:\Java\jdk1.8.0_231\jre\lib\charsets.jar;D:\Java\jdk1.8.0_231\jre\lib\deploy.jar;D:\Java\
  2. Exception in thread "main" java.lang.RuntimeException: Failed to fetch next result
  3. Caused by: java.util.concurrent.ExecutionException:
  4. Caused by: org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
  5. Caused by: org.apache.flink.runtime.JobException: Recovery is suppressed by NoRestartBackoffTimeStrategy
  6. Caused by: java.io.IOException: Failed to deserialize consumer record due to
  7. Caused by: java.io.IOException: Failed to deserialize consumer record ConsumerRecord(topic
  8. Caused by: java.lang.RuntimeException: Row length mismatch. 3 fields expected but was 2.
  9. 进程已结束,退出代码1

Job execution failed.

Recovery is suppressed by NoRestartBackoffTimeStrategy

Failed to deserialize consumer record due to

Failed to deserialize consumer record ConsumerRecord(topic = topicA, partition = 1, leaderEpoch = 2, offset = 4, CreateTime = 1718247641082, serialized key size = -1, serialized value size = 7, headers = RecordHeaders(headers = [], isReadOnly = false), key = null, value = [B@3ecd79e3).

Failed to deserialize CSV row '1,dahua'.

Row length mismatch. 3 fields expected but was 2.

上面這幾個是bug中我找的关于问题的关键点

【解决】

将报错粘到网上,说是我分区数据坏了,kafka解析不了,所以把对应的这个topicA删除,重建一次,再往里写数据就好了

删除对应主题: bin/kafka-topics.sh --bootstrap-server hadoop102:9092 --delete --topic

重建对应主题:bin/kaftopics.sh --bootstrap-server hadoop102:9092 --create --partitions 1 --replication-factor 2 --topic topicA

启个对应主题的生产者:bin/kafka-consolroducer.sh --bootstrap-server hadoop102:9092 --topic topicA

往里写数据(先保证对应的这个java程序你已经启动了)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/751732
推荐阅读
相关标签
  

闽ICP备14008679号