setMaster`local[*]` 在火花中是什么意思? [英] What does setMaster `local[*]` mean in spark?

查看:30
本文介绍了setMaster`local[*]` 在火花中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

[*] 是什么意思?

解决方案

来自 doc:

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

<块引用>

--master 选项指定分布式的主 URL集群,或者 local 用一个线程在本地运行,或者 local[N] 运行本地有 N 个线程.您应该首先使用本地进行测试.

这里:

<块引用>

local[*] 在本地运行 Spark,使用尽可能多的工作线程作为逻辑您机器上的内核.

I found some code to start spark locally with:

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

What does the [*] mean?

解决方案

From the 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.

And from here:

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

这篇关于setMaster`local[*]` 在火花中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆