【问题标题】:Spark dynamic allocation configuration settings precedenceSpark动态分配配置设置优先级
【发布时间】:2019-09-17 09:11:21
【问题描述】:

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

【问题讨论】:

    标签: apache-spark pyspark apache-spark-sql spark-streaming


    【解决方案1】:

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

    spark.dynamicAllocation.initialExecutorsspark.executor.instances aka --num-executors(在运行时通过终端启动时)

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

    https://www.cloudera.com/documentation/enterprise/6/6.2/topics/cdh_ig_running_spark_on_yarn.html#spark_on_yarn_dynamic_allocation__table_tkb_nyv_yr

    Apache YARN 文档:

    https://spark.apache.org/docs/latest/configuration.html#dynamic-allocation

    所以总结一下,如果您使用的是--num-executors,除非您将spark.dynamicAllocation.initialExecutors 设置为更高的值,否则它很可能会覆盖(取消和不使用)动态分配。

    【讨论】:

      【解决方案2】:

      configuration documentation (2.4.4) 提到了spark.dynamicAllocation.initialExecutors

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

      所以对我来说,如果启用了动态分配(即spark.dynamicAllocation.enabledtrue),那么它将被使用,并且执行器的初始数量将简单地为 max(spark.dynamicAllocation.initialExecutors, spark.executor.instances)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-06-15
        • 2022-06-18
        • 2015-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-13
        相关资源
        最近更新 更多