运行flink报错:

查找思路:

(1)查看flink/log下的日志发现:

The file .flink-runtime.version.properties has not been generated correctly. You MUST run 'mvn generate-sources' in the flink-runtime module. : java.time.format.DateTimeParseException: Text '2020-12-02T08:49:16+0100' could not be parsed: Unable to obtain Instant from TemporalAccessor: {OffsetSeconds=3600},ISO resolved to 2020-12-02T08:49:16 of type java.time.format.Parsed

(2)去 flink-runtime module查看源码:

其中FAIL_MESSAGE就是“.flink-runtime.version.properties has not been ......”,仔细看源码发现该报错信息跟文件是否存在并没有关系(因为是DateTimeParseException下的错误输出),后来发现在flink/lib/flink-dist_2.11-1.12.0.jar中存在.flink-runtime.version.properties文件

解决办法:

既然是时间解析有问题,那最简单的就是直接使用默认值,不从.flink-runtime.version.properties里面读取,所以我直接删除了flink-dist_2.11-1.12.0.jar .flink-runtime.version.properties里面的git.commit.time和git.build.time配置,然后重新打成jar包,修改jar包可参考:https://www.pianshen.com/article/3728970379/

之后再运行./bin/flink命令不再报错

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐