当前位置:网站首页>Spark独立集群Worker和Executor的概念
Spark独立集群Worker和Executor的概念
2022-07-06 09:29:00 【若苗瞬】
.
(一)Spark独立集群Worker和Executor的概念
1.1 Worker(容器)
工作节点,相当于工作站,一台虚拟的计算机,有自己的CPU核心数,内存数。
我们把Worker假设成一台计算机,那么CPU核心数(假设2核),内存数(假设32GB)就是它的硬件条件。
实际上在Spark里面是这些配置决定的:
export SPARK_WORKER_CORES=2
export SPARK_WORKER_MEMORY=32g
1.2 Executor(程序)
工作程序,相当于计算机上运行的一个程序,有它要求CPU核心数,要求的内存数。
我们把Executor假设成一个程序,那么它需要运行在计算机上,它它对CPU核心数(假设1核),内存数(假设4GB),就是它运行的基本要求。
PS:同理driver也是个程序。
我们提交时可以指定这些参数:
SparkLauncher aL = new org.apache.spark.launcher.SparkLauncher()
.setXXX(...)
.setConf(SparkLauncher.DRIVER_MEMORY, "4g")
.setConf(SparkLauncher.EXECUTOR_MEMORY,"4g")
.setConf(SparkLauncher.EXECUTOR_CORES,"1")
1.3 无法满足条件的Worker不工作
如果EXECUTOR_MEMORY,EXECUTOR_CORES参数指定超过了某些Worker的配置,
则这些Work不会参加到这个任务的计算中。
如果EXECUTOR_MEMORY,EXECUTOR_CORES参数指定超过了全部Worker的配置,
那么集群中就没有资源可以供这个任务使用了,任务会无限等待下去,等待可用资源。
每个worker可以配置多个CPU核心,一定量的内存。
根据主机实际情况进行配置,比如我这里:
这不是问题,只是个概念。
.
边栏推荐
猜你喜欢

OneForAll安装使用

分享一个在树莓派运行dash应用的实例。

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题

It is forbidden to trigger onchange in antd upload beforeupload

Flag framework configures loguru logstore

pytorch提取骨架(可微)

860. Lemonade change

807. Maintain the urban skyline

新手必会的静态站点生成器——Gridsome

Anaconda下安装Jupyter notebook
随机推荐
605. Planting flowers
Some problems encountered in installing pytorch in windows11 CONDA
浏览器打印边距,默认/无边距,占满1页A4
js时间函数大全 详细的讲解 -----阿浩博客
Research Report on market supply and demand and strategy of double drum magnetic separator industry in China
Li Kou - 298th weekly match
原生js实现全选和反选的功能 --冯浩的博客
业务系统兼容数据库Oracle/PostgreSQL(openGauss)/MySQL的琐事
2027. Minimum number of operations to convert strings
QNetworkAccessManager实现ftp功能总结
Quick to typescript Guide
QT style settings of qcobobox controls (rounded corners, drop-down boxes, up expansion, editable, internal layout, etc.)
(lightoj - 1349) Aladdin and the optimal invitation (greed)
Codeforces Round #802(Div. 2)A~D
Li Kou: the 81st biweekly match
sublime text 代码格式化操作
Sword finger offer II 019 Delete at most one character to get a palindrome
(POJ - 3579) median (two points)
Anaconda下安装Jupyter notebook
pytorch提取骨架(可微)