如何知道Yarn公平份额计划程序上是否发生抢占?

时间:2018-07-02 08:51:31

标签: hadoop hive yarn

有没有办法确定是否在YARN上触发了抢占机制?

在YARN资源管理器中还是在日志中?

1 个答案:

答案 0 :(得分:2)

如果您的日志级别设置为info,则应该在YARN Resource Manager日志中看到它。

            // Warn application about containers to be killed
            for (RMContainer container : containers) {
              FSAppAttempt app = scheduler.getSchedulerApp(
                      container.getApplicationAttemptId());
              LOG.info("Preempting container " + container +
                      " from queue " + app.getQueueName());
              app.trackContainerForPreemption(container);
            }

https://github.com/apache/hadoop/.../scheduler/fair/FSPreemptionThread.java#L143

如果您的日志级别为debug,您还将看到以下内容:

    if (LOG.isDebugEnabled()) {
      LOG.debug(
          "allocate: post-update" + " applicationAttemptId=" + appAttemptId
              + " #ask=" + ask.size() + " reservation= " + application
              .getCurrentReservation());

      LOG.debug("Preempting " + preemptionContainerIds.size()
          + " container(s)");
    }

https://github.com/apache/hadoop/.../scheduler/fair/FairScheduler.java#937