Spark executor on yarn-client does not take execut

2020-02-29 05:27发布

Irrespective of the spark executor core count, yarn container for the executor does not use more than 1 core.

1条回答
家丑人穷心不美
2楼-- · 2020-02-29 05:49

YARN is showing 1 core per executor irrespective of spark.executor.cores because by default DefaultResourceCalculator is used. It considers only memory.

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

Use DominantResourceCalculator, It uses both cpu and memory.

Set below config in capacity-scheduler.xml

yarn.scheduler.capacity.resource-calculator=org.apache.hadoop.yarn.util.resource.DominantResourceCalculator

More about DominantResourceCalculator

查看更多
登录 后发表回答