apache-spark - spark.cores.max 是如何工作的?

标签 apache-spark

我对 spark.cores.max 的定义感到困惑

我在网上得到的是

spark.cores.max represents the total number of CPU cores for the whole application

我的集群有 8 个工作节点和 1 个主节点。每个节点都有 4 个内核和 100 GB 内存。

它是指每个工作节点或所有 8 个工作节点中的内核总数?

如果我将 spark.cores.max 设置为 12 并且 cores/executor 为 4,这意味着什么?

最佳答案

来自 Spark 文档:

When running on a standalone deploy cluster or a Mesos cluster in "coarse-grained" sharing mode, the maximum amount of CPU cores to request for the application from across the cluster (not from each machine). If not set, the default will be spark.deploy.defaultCores on Spark's standalone cluster manager, or infinite (all available cores) on Mesos.

spark.cores.max 限制 spark 作业将使用的核心数。如果您未设置,它将使用“spark.deploy.defaultCores”值。

在您的示例中,spark.executor.cores = 4 和 spark.cores.max = 12 将表明您的作业将具有三个执行器 (12/4),每个执行器具有 4 个核心。

set spark.cores.max to 12 and cores/executor is 4

此属性将允许您在同一 spark 集群中同时运行多个作业。

问候

关于apache-spark - spark.cores.max 是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65214570/

相关文章:

apache-spark - 数据集中的分割数超过数据集分割限制,Dremio + Hive + Spark

java - 为什么(在 "cluster"模式下)我的 UDF 在本地(在驱动程序中)而不是在工作线程上执行

java - Scala Spark java.lang.VerifyError : class scala. collection.mutable.WrappedArray 覆盖 final方法 toBuffer.()

java - Apache Spark - 无法理解 scala 示例

java - 如何将 JavaRDD<Row> 转换为 JavaRDD<List<String>>?

json - 将大量 JSON 文件读入 Spark Dataframe

scala - 如何将列拆分为两个不同的列?

apache-spark - Spark webUI - 完成的应用详情页面

apache-spark - RStudio 中 sparkR.init(master ="local") 中的 SparkR 错误

apache-spark - 分区文本文件的 Spark 追加模式失败并显示 SaveMode.Append - IOException File already Exists