Apache spark Spark动态分配配置设置优先级

Apache spark Spark动态分配配置设置优先级,apache-spark,pyspark,apache-spark-sql,spark-streaming,Apache Spark,Pyspark,Apache Spark Sql,Spark Streaming,我有一个spark作业,它在启用了动态资源分配的集群上运行。。我使用num executors和executor内存属性提交spark作业。。这里什么优先?作业是使用动态分配还是使用我在配置中提到的资源运行?这取决于哪个配置参数的值更大 spark.DynamicLocation.initialExecutors或spark.executor.instancesaka--num executors(运行时通过终端启动时) 如果您在纱线上使用Cloudera,请参阅参考文档,并确保根据您的环境查看

我有一个spark作业,它在启用了动态资源分配的集群上运行。。我使用num executors和executor内存属性提交spark作业。。这里什么优先?作业是使用动态分配还是使用我在配置中提到的资源运行?

这取决于哪个配置参数的值更大

spark.DynamicLocation.initialExecutors
spark.executor.instances
aka
--num executors
(运行时通过终端启动时)

如果您在纱线上使用Cloudera,请参阅参考文档,并确保根据您的环境查看正确的CDH版本

Apache纱线文档也包括:

因此,如果您使用的是
--num executors
,那么它很可能会覆盖(取消并不使用)动态分配,除非您将
spark.dynamicAllocation.initialExecutors
设置为更高的值。

2.4.4)说明了
spark.dynamicAllocation.initialExecutors

启用动态分配时要运行的初始执行器数。 如果设置了
--num executors
(或
spark.executor.instances
)且大于此值,它将用作执行器的初始数量

因此,对于我来说,如果启用了动态分配(即
spark.dynamicAllocation.enabled
true
),则将使用它,并且执行器的初始数量将仅为max(
spark.dynamicAllocation.initialExecutors
spark.executor.instances