“ yarn.scheduler.minimum-allocation-vcores”和yarn.scheduler.maximum-allocation-vcores在确定容器/节点数量中的作用?

Yas*_*gar 5 containers hadoop-yarn

我实际上是想弄清楚单个节点管理器中有多少个容器。它取决于什么因素?在确定每个节点的容器数量时,“ yarn.scheduler.minimum-allocation-vcores”和“ yarn.scheduler.maximum-allocation-vcores”的作用是什么?

ban*_*ara 4

纱线中默认的资源调度程序是Capacity Scheduler

容量调度程序有两个资源计算器

  1. 默认资源计算器(默认)

  2. 主导资源计算器

DefaultResourceCalculator 仅使用内存来计算可用容器

public int computeAvailableContainers(Resource available, Resource required) {
// Only consider memory
return available.getMemory() / required.getMemory();
  }
Run Code Online (Sandbox Code Playgroud)

DominantResourceCalculator 同时使用内存和内核

  public int computeAvailableContainers(Resource available, Resource required) {
    return Math.min(
        available.getMemory() / required.getMemory(), 
        available.getVirtualCores() / required.getVirtualCores());
  }
Run Code Online (Sandbox Code Playgroud)

yarn.scheduler.minimum-allocation-vcores并且yarn.scheduler.maximum-allocation-vcores在决定每个节点的容器数量方面不发挥任何直接作用。

在请求资源时,应用程序会告知每个容器所需的纱线内存和核心。

mapreduce.map.cpu.vcores在mapreduce中,我们指定和所需的vcoresmapreduce.reduce.cpu.vcores

在spark中,我们指定所需的vcoresspark.executor.cores

yarn.scheduler.minimum-allocation-vcoresyarn.scheduler.maximum-allocation-vcores用于定义每个容器可分配的最小和最大 vcore 数量。