在核心和线程使用方面激发本地模式与独立群集

发布于 2025-02-02 19:33:06 字数 965 浏览 3 评论 0原文

IM在Pyspark 本地模式独立模式中比较

local

findspark.init('C:\spark\spark-3.0.3-bin-hadoop2.7')
conf=SparkConf()
conf.setMaster("local[*]")
conf.setAppName('firstapp')

sc = SparkContext(conf=conf)
spark = SparkSession(sc)

standalone

findspark.init('C:\spark\spark-3.0.3-bin-hadoop2.7')
conf=SparkConf()
conf.setMaster("spark://127.0.0.2:7077")
conf.setAppName('firstapp')

sc = SparkContext(conf=conf)
spark = SparkSession(sc)

加上启动主人和使用工人的工人:

主人 bin \ spark-class2.cmd org.apache.spark.deploy.master.master.master

worker 多次 bin \ spark -class2.cmd org.apache.spark.deploy.worker.worker.worker -c 1 -m 1g spark://127.0.0.1.1:7077其中'1'是'1'的含义一个核心和'1G '平均1GB或RAM。

我的问题是本地模式独立模式在使用线程和内核方面有什么区别?

im comparing between pyspark local mode and standalone mode where

local :

findspark.init('C:\spark\spark-3.0.3-bin-hadoop2.7')
conf=SparkConf()
conf.setMaster("local[*]")
conf.setAppName('firstapp')

sc = SparkContext(conf=conf)
spark = SparkSession(sc)

standalone :

findspark.init('C:\spark\spark-3.0.3-bin-hadoop2.7')
conf=SparkConf()
conf.setMaster("spark://127.0.0.2:7077")
conf.setAppName('firstapp')

sc = SparkContext(conf=conf)
spark = SparkSession(sc)

plus starting the Master and the workers using :

Master
bin\spark-class2.cmd org.apache.spark.deploy.master.Master

Worker multiple times depending on the number of workers
bin\spark-class2.cmd org.apache.spark.deploy.worker.Worker -c 1 -m 1G spark://127.0.0.1:7077 where '1' mean one core and '1G' mean 1gb or Ram.

my question is : what is the difference between local mode and standalone mode in term of the usage of threads and cores ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文