gpt4 book ai didi

scala - setMaster `local[*]`在spark中是什么意思?

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

我找到了一些在本地启动 Spark 的代码:

val conf = new SparkConf().setAppName("test").setMaster("local[*]")
val ctx = new SparkContext(conf)

[*] 是什么意思?

最佳答案

来自 doc :

./bin/spark-shell --master local[2]

The --master option specifies the master URL for a distributed cluster, or local to run locally with one thread, or local[N] to run locally with N threads. You should start by using local for testing.

来自 here :

local[*] Run Spark locally with as many worker threads as logical cores on your machine.

关于scala - setMaster `local[*]`在spark中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32356143/

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