gpt4 book ai didi

apache-spark - Spark-Shell 的默认执行器和核心数

转载 作者:行者123 更新时间:2023-12-03 07:15:56 25 4
gpt4 key购买 nike

如果我在spark shell中运行一个spark程序,该程序是否有可能占用整个hadoop集群几个小时?

通常有一个名为 num-executors 和 executor-cores 的设置。

spark-shell --driver-memory 10G --executor-memory 15G --executor-cores 8

但是如果没有指定它们并且我只是运行“spark-shell”...它会消耗整个集群吗?或者是否有合理的默认值。

最佳答案

大多数配置属性的默认值可以在 Spark Configuration documentation 中找到。 。对于示例中的配置属性,默认值是:

  • spark.driver.memory = 1g
  • spark.executor.memory = 1g
  • spark.executor.cores = 1 in YARN mode, all the available cores on the worker in standalone mode.

此外,您可以通过使用所需的属性创建文件$SPARK-HOME/conf/spark-defaults.conf来覆盖这些默认值(如所述 here )。然后,如果文件存在且具有所需的值,则无需将它们作为参数传递给 spark-shell 命令。

关于apache-spark - Spark-Shell 的默认执行器和核心数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37127407/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com