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问题

相关推荐
数据皮皮侠AI21 小时前
上市公司股票名称相似度(1990-2025)
大数据·人工智能·笔记·区块链·能源·1024程序员节
开开心心就好1 天前
系统清理工具清理缓存日志,启动卸载管理
linux·运维·服务器·神经网络·cnn·pdf·1024程序员节
Evan东少4 天前
[踩坑]笔记本Ubuntu20.04+NvidiaRTX5060驱动+cuda+Pytorch+ROS/Python实现人脸追踪(环境准备)
1024程序员节
不爱编程的小陈5 天前
C/C++每日面试题
面试·职场和发展·1024程序员节
开开心心就好5 天前
右键菜单管理工具,添加程序自定义名称位置
linux·运维·服务器·ci/cd·docker·pdf·1024程序员节
码农三叔6 天前
(4-2-05)Python SDK仓库:MCP服务器端(5)Streamable HTTP传输+Streamable HTTP传输
开发语言·python·http·大模型·1024程序员节·mcp·mcp sdk
西幻凌云10 天前
初始——正则表达式
c++·正则表达式·1024程序员节
启芯硬件10 天前
电源XL6009E1的dieshot细节分析-芯片设计干货
大数据·经验分享·硬件工程·1024程序员节
一颗青果12 天前
单例模式 | 死锁
linux·服务器·单例模式·1024程序员节