当前位置:网站首页>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核心,一定量的内存。
根据主机实际情况进行配置,比如我这里:
这不是问题,只是个概念。
.
边栏推荐
- What is the difficulty of programming?
- 力扣——第298场周赛
- 业务系统从Oracle迁移到openGauss数据库的简单记录
- Acwing - game 55 of the week
- 新手必会的静态站点生成器——Gridsome
- Market trend report, technical innovation and market forecast of double-sided foam tape in China
- AcWing:第56场周赛
- 300th weekly match - leetcode
- Read and save zarr files
- sublime text 代码格式化操作
猜你喜欢

QT模拟鼠标事件,实现点击双击移动拖拽等

409. Longest palindrome

Raspberry pie 4B installation opencv3.4.0

拉取分支失败,fatal: ‘origin/xxx‘ is not a commit and a branch ‘xxx‘ cannot be created from it

1005. Maximized array sum after K negations

860. Lemonade change

300th weekly match - leetcode

第 300 场周赛 - 力扣(LeetCode)

Maximum product (greedy)

软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客
随机推荐
Browser print margin, default / borderless, full 1 page A4
1013. Divide the array into three parts equal to and
AcWing:第56场周赛
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
Market trend report, technical innovation and market forecast of double-sided foam tape in China
Discussion on QWidget code setting style sheet
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
Calculate the time difference
1005. Maximized array sum after K negations
Advancedinstaller安装包自定义操作打开文件
(lightoj - 1236) pairs forming LCM (prime unique decomposition theorem)
Classic application of stack -- bracket matching problem
Opencv learning log 27 -- chip positioning
Candy delivery (Mathematics)
Base dice (dynamic programming + matrix fast power)
Acwing: the 56th weekly match
业务系统兼容数据库Oracle/PostgreSQL(openGauss)/MySQL的琐事
1855. Maximum distance of subscript alignment
Flask框架配置loguru日志庫
QT style settings of qcobobox controls (rounded corners, drop-down boxes, up expansion, editable, internal layout, etc.)