spark资源类相关参数介绍
- JDBCServer资源类参数:
- JDBCServer动态规划:(生效是以JDBCServer服务端为准)
开启动态规划参数:spark.dynamicAllocation.enabled,为true时候开启
开启动态规划参数后,spark.executor.instances将不再生效,但是spark.executor.instances参数的值不能大于spark.dynamicAllocation.maxExecutors的值,且
spark.dynamicAllocation.initialExecutors的值不能大于
spark.dynamicAllocation.minExecutors的值
开启动态规划后:任务初始的executor个数对应参数:spark.dynamicAllocation.initialExecutors
任务最多申请的executor个数:spark.dynamicAllocation.maxExecutors(资源使用上限)
executor的回收对应参数:spark.dynamicAllocation.executorIdleTimeout
executor的是否要再申请对应参数spark.dynamicAllocation.schedulerBacklogTimeout
关闭动态规划参数:spark.dynamicAllocation.enabled,为false时候关闭
此时executor个数对应参数spark.executor.instacnes
- executor内存:SPARK_EXECUTOR_MEMORY
- driver内存:SPARK_DRIVER_MEMORY
- executor的core数:SPARK_EXECUTOR_CORES
- 如果要添加task.cpus参数,需要添加自定义参数
- 堆外内存对应参数:
executor:spark.executor.memoryOverhead
driver:spark.yarn.am.memoryOverhead(yarn-client模式也就是jdbcserver的多实例模式)
spark.driver.memoryOverhead(yarn-cluster模式也就是jdbcserver的多租户模式
- spark-submit和spark-sql资源类参数,都可以通过—conf或者命令行或者在spark-default.conf中添加
- executor的内存和core数对应参数:
spark.executor.memory,spark.executor.cores
或者提交命令里面:--executor-memory和--executor-cores
- driver内存和core数对应参数:
spark.driver.memory和spark.driver.cores
或者提交命令里面:--driver-memory和--driver-cores
- 堆外内存对应参数:
executor:spark.executor.memoryOverhead
driver:spark.yarn.am.memoryOverhead(yarn-client模式)
spark.driver.memoryOverhead(yarn-cluster模式)
- spark任务资源相关的打印:
提交到yarn上,处于accept状态,此时yarn资源不够am启动
日志打印:Application report for applicationID**** (state: ACCEPT)
提交到yarn上处于RUNNING状态,但是业务无job运行,此时是am已经启动,但是队列没有资源启动executor
日志打印:Initial job has not accepted any resources
查看am日志可以看到executor的启动情况
- 点赞
- 收藏
- 关注作者
评论(0)