Spark executor cores not shown in yarn resource manager

自闭症网瘾萝莉.ら 提交于 2019-12-08 04:25:59

问题


Yarn resource manager is not showing the total cores for the spark application. Lets say if submit a spark job with 300 executors and executor-cores as 3. So the total cores the spark job is taking is 900 but in yarn resource manager it only shows as 300.

So is this just a display error or is Yarn not seeing the rest of the 600 cores?

Environment: HDP2.2 Scheduler : capacity-scheduler Spark : 1.4.1


回答1:


Set

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

in capacity-scheduler.xml

YARN is running more containers than allocated 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.

you can read more about DominantResourceCalculator here.



来源:https://stackoverflow.com/questions/32233162/spark-executor-cores-not-shown-in-yarn-resource-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!