Hadoop yarn 技术分享
  • 介绍
  • YARN Service
  • 事件处理
    • AsyncDispatcher
    • stateMachine
  • YARN RPC
    • RPC 设计
    • RPC 实现
  • 交互协议
  • 提交app的过程
    • 提交APP概要
    • 客户端提交app
    • RM接收请求
    • RM分配App
    • RM下发App
    • NM拉起APP
  • YARN 高可用
    • RM HA 基础
    • RM HA
  • YARN调度策略
    • Untitled
    • YARN-队列配置
  • 问题分析总结
    • 集群繁忙时偶发性空指针导致app执行失败
    • YARN 资源充足,但app等待调度排长队
    • YARN UI看不了app 日志
    • YARN UI看不了app 日志2
    • TEZ 资源不释放问题分析
    • NM频繁挂掉
    • container执行异常
    • YARN RM主备切换异常
Powered by GitBook
On this page

Was this helpful?

  1. YARN调度策略

YARN-队列配置

YARN 队列配置说明

1.队列最大可运行个数

配置来源

Integer maxApps = queueMaxApps.get(queue);
return (maxApps == null) ? queueMaxAppsDefault : maxApps;

queueMaxAppsDefault 来自 配置 conf/fair-scheduler.xml 对应的 queueMaxAppsDefault 属性 而 queueMaxApps.get(queue) 来自 队列设置中的 maxRunningApps

yarn 在处理最大可运行app 个数的判断也非常有意思 通过if else 来做两个判断,第一个判断失败,表示用户最大可运行次数可以过。然后判断队列最大可运行次数

if (exceedUserMaxApps(attempt.getUser())) {
  attempt.updateAMContainerDiagnostics(AMState.INACTIVATED,
      "The user \"" + attempt.getUser() + "\" has reached the maximum limit"
          + " of runnable applications.");
  ret = false;
} else if (exceedQueueMaxRunningApps(queue)) {
  attempt.updateAMContainerDiagnostics(AMState.INACTIVATED,
      "The queue \"" + queue.getName() + "\" has reached the maximum limit"
          + " of runnable applications.");
  ret = false;
}

在队列判断的过程中 会从子队列向上轮询到跟队列

public boolean exceedQueueMaxRunningApps(FSQueue queue) {
  // Check queue and all parent queues
  while (queue != null) {
    if (queue.getNumRunnableApps() >= queue.getMaxRunningApps()) {
      return true;
    }
    queue = queue.getParent();
  }

  return false;
}

所以在一个队列上提交app ,他会检查每一个父队列正在运行的app 是否超过 最大限制。 如果没有设置,则使用全局参数。当然queueMaxAppsDefault 也变成了全局限制。

PreviousUntitledNext问题分析总结

Last updated 5 years ago

Was this helpful?