【调优/排错】Hadoop:flink on yarn 模式下提示yarn资源不足:Running and Pending Application Limits

1. 问题现象

相关log:

在这里插入图片描述

INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue:
 not starting application as amIfStarted exceeds amLimit
INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue: 
Application added - appId: application_1593338489799_0317 user: 

org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue$User@6c0d5b4d, 
leaf-queue: default #user-pending-applications: 1 #user-active-applications: 15 #queue-pending-applications: 1 #queue-active-applications: 15
 That your drivers have exceeded max memory configured in Max Application Master Resources. 
 You can either increase max memory for AM or decrease driver memory in your jobs.

 

2. 问题说明

资源不足时,yarn会有两种选择:

  1. flink作业并没有pending等待资源的分配,而是直接打印一行fail的log,直接就fail掉了。
  2. flink作业pending等待资源的分配,一直等待之前的flink作业执行完,等待有资源分配给自己来执行。

问题说明:

这种一般出现在多个任务同时运行,导致AM占用的内存比例超过了设置的maximum-am-resource-percent,当再提交任务时,因为AM申请不到足够的资源,导致任务pending,最后资源虽然充足但是提交不了任务。
 
此时可以适当的提高AM内存比例。

 

3. 修改适配

配置文件:capacity-scheduler.xml


  <property>
    <name>yarn.scheduler.capacity.maximum-am-resource-percent</name>
    <value>0.5</value>
    <description>
      Maximum percent of resources in the cluster which can be used to run 
      application masters i.e. controls number of concurrent running
      applications.
      1. 运行appmaster的最大资源,为了控制集群中并发运行的app。对于flink来说 appmaster对应的是jobmanager。
      2. 建议修改配置大于默认的0.1。
    </description>
  </property>

执行命令:刷新配置。

yarn rmadmin -refreshQueues
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

roman_日积跬步-终至千里

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值