Apache spark 在纱线上使用火花时,maxExecutors、num executors和initialExecutors之间的关系是什么?

Apache spark 在纱线上使用火花时,maxExecutors、num executors和initialExecutors之间的关系是什么?,apache-spark,yarn,Apache Spark,Yarn,首先,我读到,spark.dynamicAllocation.maxecutors的值将等于num executors,如果spark.dynamicAllocation.maxecutors没有显式设置。但是,在本文的以下部分中,它说“--num executors或spark.executor.instances作为默认值为2的最小执行者数量”,这让我感到困惑 我的第一个问题是--num executors在Spark 2.x或更高版本中的用法是什么?在动态定位之前,它是否像一个过时的选项一

首先,我读到,
spark.dynamicAllocation.maxecutors
的值将等于
num executors
,如果
spark.dynamicAllocation.maxecutors
没有显式设置。但是,在本文的以下部分中,它说“
--num executors
spark.executor.instances
作为默认值为2的最小执行者数量”,这让我感到困惑

  • 我的第一个问题是
    --num executors
    在Spark 2.x或更高版本中的用法是什么?在动态定位之前,它是否像一个过时的选项一样有用?当引入DynamicLocation时,
    --num executors
    --max executors
    的行为更像是
    spark.DynamicLocation.
    的一些默认值

  • --conf spark.dynamicAllocation.maxecutors
    --max executor
    之间有什么区别?后者是前者的别名吗

  • 同时,本文没有提到
    numexecutors
    spark.dynamicAllocation.initialExecutors
    之间的关系。因此,我做了一个实验,其中我发送了以下参数:

    --conf spark.dynamicAllocation.minExecutors=2  --conf spark.dynamicAllocation.maxExecutors=20  --conf spark.dynamicAllocation.enabled=true --conf spark.dynamicAllocation.initialExecutors=3 --conf spark.dynamicAllocation.maxExecutors=10  --num-executors 0  --driver-memory 1g  --executor-memory 1g  --executor-cores 2  
    
    结果是,最初分配了3个执行器(对应于
    初始执行器
    ),然后减少到2个(对应于
    地雷执行器
    ),并且似乎
    --num executors
    在这里是无用的。然而,文章说“-num executors或spark.executor.instances作为最小数量的执行者”,所以现在存在一个矛盾

  • 我的第三个问题是
    num executors
    spark.dynamicAllocation.initialExecutors
    之间的关系,是
    spark.dynamicAllocation.initialExecutors
    之前的
    num executors
    ?从中,我发现当
    num executors
    设置为大于
    spark.dynamicalocation.initialExecutors
    时,它将覆盖
    spark.dynamicalocation.initialExecutors