繁体   English   中英

Spark:如何在 spark-submit 中设置 spark.yarn.executor.memoryOverhead 属性

[英]Spark: How to set spark.yarn.executor.memoryOverhead property in spark-submit

在 Spark 2.0 中。 运行 spark submit 时如何设置 spark.yarn.executor.memoryOverhead。

我知道像 spark.executor.cores 这样的东西你可以设置 --executor --executor-cores 2 这个属性是相同的模式吗? 例如--yarn-executor-memoryOverhead 4096

请找到示例。 这些值也可以在 Sparkconf 中给出。

例子:

./bin/spark-submit \
--[your class] \
--master yarn \
--deploy-mode cluster \
--num-exectors 17
--conf spark.yarn.executor.memoryOverhead=4096 \
--executor-memory 35G \  //Amount of memory to use per executor process 
--conf spark.yarn.driver.memoryOverhead=4096 \
--driver-memory 35G \   //Amount of memory to be used for the driver process
--executor-cores 5
--driver-cores 5 \     //number of cores to use for the driver process 
--conf spark.default.parallelism=170
 /path/to/examples.jar

spark.yarn.executor.memoryOverhead现在已被弃用:

警告 spark.SparkConf:配置键“spark.yarn.executor.memoryOverhead”已从 Spark 2.3 开始弃用,将来可能会被删除。 请改用新密钥“spark.executor.memoryOverhead”。


您可以通过将其作为配置传递来以编程方式设置spark.executor.memoryOverhead

spark = (
    SparkSession.builder
        .master('yarn')
        .appName('StackOverflow')
        .config('spark.driver.memory', '35g')
        .config('spark.executor.cores', 5)
        .config('spark.executor.memory', '35g')
        .config('spark.dynamicAllocation.enabled', True)
        .config('spark.dynamicAllocation.maxExecutors', 25)
        .config('spark.yarn.executor.memoryOverhead', '4096')
        .getOrCreate()
)
sc = spark.sparkContext

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM