文档首页> MapReduce服务 MRS> 故障排除> 使用Spark> 提交Spark任务时Driver端提示运行内存超限
更新时间:2024-03-05 GMT+08:00
分享

提交Spark任务时Driver端提示运行内存超限

问题背景与现象

运行内存超限导致提交Spark任务失败。

原因分析

在Driver日志中直接打印申请的executor memory超过集群限制。
... INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster (6144 MB per container)
... ERROR SparkContext: Error initializing SparkContext.
java.lang.IllegalArgumentException: Required executor memory (10240+1024 MB) is above the max threshold (6144 MB) of this cluster!

Spark任务提交至Yarn上面,运行task的executor使用的资源受yarn的管理。从报错信息可看出,用户申请启动executor时,指定10G的内存,超出了Yarn设置的每个container的最大内存的限制,导致任务无法启动。

解决办法

修改Yarn的配置,提高对container的限制。如可通过调整“yarn.scheduler.maximum-allocation-mb”参数的大小,可控制启动的executor的资源,修改之后要重启Yarn服务。

MRS Manager界面操作:

  1. 登录MRS Manager页面。
  2. 选择“服务管理 > Yarn > 服务配置”将“参数类别”修改为“全部配置”。
  3. 在“搜索”栏输入“yarn.scheduler.maximum-allocation-mb”修改参数并保存重启服务。如下图所示:

    图1 修改Yarn服务参数

FusionInsight Manager界面操作:

  1. 登录FusionInsight Manager页面。
  2. 选择“集群 > 服务 > Yarn”,单击“配置”,选择“全部配置”。
  3. 在“搜索”栏输入“yarn.scheduler.maximum-allocation-mb”修改参数并保存重启服务。
分享:

    相关文档

    相关产品