Flink on yarn模式下,JobManager异常退出问题

这个问题排除了很久,其中更换了Flink版本,也更换了Hadoop版本一直无法解决,JobManager跑着跑着就异常退出了。资源管理器上是提示运行结束,运行状态是被Kill掉。

网上搜了一圈,都说内存不足、资源不足,配置错误。但是报错非常不明显。

最后终于看到了一条警告日志。

是客户端与jobmanager心跳超时,协商退出的jobmanager。后面就开始取消任务,回收资源逐步退出。除了这条关键退出日志,就没有明显的报错了。

复制代码
2024-10-24 17:41:15,073 WARN  org.apache.flink.runtime.dispatcher.MiniDispatcher           [] - The heartbeat from the job client is timeout and cancel the job cc0f9dcadc79ee561632518539baf513. You can adjust the heartbeat interval by 'client.heartbeat.interval' and the timeout by 'client.heartbeat.timeout'

其实提交Flink on Yarn的Pro-Job程序,从开始到结束都有心跳异常的错误。最后超过默认的超时时间180s就开始协商退出了,所以程序每次跑3分钟后就开始退出了。

复制代码
2024-10-24 17:40:15,725 ERROR org.apache.flink.runtime.rest.handler.job.JobClientHeartbeatHandler [] - Exception occurred in REST handler: Request did not match expected format JobClientHeartbeatRequestBody.

只在yarn-per-job与yarn-application模式下会触发,session模式下不会。因为session模式是一直存在jobmanager,他会接受任何客户端的任务。不需要用完就释放资源。

Flink 1.13.1、Flink1.15.2、Flink1.16.3都不存在以上问题

但是1.17.1和1.18.1、1.20都存在该问题。应该是1.17以上都存在

某大神说的1.17引入新的心跳机制:

复制代码
The issue you're encountering is related to a new heartbeat mechanism
between the client and job in Flink-1.17. If the job does not receive any
heartbeats from the client within a specific timeout, it will cancel itself
to avoid hanging indefinitely.
复制代码
To address this, you have two options:
1. Run your job in detached mode by adding the -d option in your command
line
2. Increase the client heartbeat timeout setting to a larger value, the
default value is 180 seconds

解决办法总结了下,大概三种

1、用旧点的Flink版本:例如Flink1.16.3以下;

2、分离模式,加 -d参数;

3、增加心跳超时时间;这个其实无法根本解决;

新版本还是多坑,其实很有一个可能flink1.17开始去除java代码,导致的bug问题

相关推荐
unable code2 天前
磁盘取证-Flying_High
网络安全·ctf·misc·1024程序员节·磁盘取证
unable code3 天前
磁盘取证-ColorfulDisk
网络安全·ctf·misc·1024程序员节·内存取证
unable code4 天前
磁盘取证-[第十章][10.1.2 磁盘取证方法]磁盘取证1
网络安全·ctf·misc·1024程序员节·内存取证
开开心心就好5 天前
免费抽奖工具支持批量导入+自定义主题
linux·运维·服务器·macos·pdf·phpstorm·1024程序员节
开开心心就好9 天前
卸载工具清理残留,检测垃圾颜色标识状态
linux·运维·服务器·python·安全·tornado·1024程序员节
子燕若水10 天前
Facebook reels 运营指南
1024程序员节
尘觉13 天前
创作 1024 天|把热爱写成长期主义
数据库·1024程序员节
写点什么呢14 天前
Word使用记录
word·1024程序员节
开开心心就好14 天前
内存清理工具点击清理,自动间隔自启
linux·运维·服务器·安全·硬件架构·材料工程·1024程序员节
开开心心就好15 天前
内存清理工具开源免费,自动优化清理项
linux·运维·服务器·python·django·pdf·1024程序员节