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

我实际上是想弄清楚单个节点管理器中有多少个容器.它取决于哪些因素?在确定每个节点的容器数量时,“yarn.scheduler.minimum-allocation-vcores”和“yarn.scheduler.maximum-allocation-vcores”的作用是什么? 最佳答案 纱线中的默认资源调度程序是
Capacity Scheduler.

Capacity Scheduler有两个资源计算器

> DefaultResourceCalculator(默认)
> DominantResourceCalculator

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

public int computeAvailableContainers(Resource available, Resource required) {
// Only consider memory
return available.getMemory() / required.getMemory();
  }

DominantResourceCalculator使用内存和内核

  public int computeAvailableContainers(Resource available, Resource required) {
    return Math.min(
        available.getMemory() / required.getMemory(), 
        available.getVirtualCores() / required.getVirtualCores());
  }

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

请求资源应用程序告诉每个容器需要的纱线内存和内核.

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

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

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

点赞