我知道这是一个老问题,肖恩的回答非常好 . 我的写作是关于's comment. If you use Mesos or YARN as your cluster manager, you are able to run multiple executors on the same machine with one worker, thus there is really no need to run multiple workers per machine. However, if you use standalone cluster manager, currently it still only allows one executor per worker process on each physical machine. Thus in case you have a super large machine and would like to run multiple exectuors on it, you have to start more than 1 worker process. That'在_1312010_中的 SPARK_WORKER_INSTANCES 是什么意思 . 默认值为1.如果使用此设置,请确保明确设置 SPARK_WORKER_CORES 以限制每个工作程序的核心,否则每个工作程序将尝试使用所有核心 .
4 回答
我建议先阅读Spark cluster docs,但更多的是解释这些模式的Cloudera blog post .
您的第一个问题取决于“实例”的含义 . 节点是一台机器,并没有充分的理由为每台机器运行多个工作程序 . 因此,两个工作节点通常意味着两台机器,每台机器都是Spark工作
对于许多应用, Worker 拥有许多执行者 . 一个应用程序在许多工作者上有执行者 .
你的第三个问题不明确 .
我知道这是一个老问题,肖恩的回答非常好 . 我的写作是关于's comment. If you use Mesos or YARN as your cluster manager, you are able to run multiple executors on the same machine with one worker, thus there is really no need to run multiple workers per machine. However, if you use standalone cluster manager, currently it still only allows one executor per worker process on each physical machine. Thus in case you have a super large machine and would like to run multiple exectuors on it, you have to start more than 1 worker process. That'在_1312010_中的 SPARK_WORKER_INSTANCES 是什么意思 . 默认值为1.如果使用此设置,请确保明确设置 SPARK_WORKER_CORES 以限制每个工作程序的核心,否则每个工作程序将尝试使用所有核心 .
这种独立的集群管理器限制很快就会消失 . 根据这个SPARK-1706,这个问题将在Spark 1.4中修复并发布 .
扩展到其他很棒的答案,我想用几张图片来描述 .
如果我们在一个地方为独立模式代表主人和 Worker .
如果您对Spark如何与YARN合作感到好奇?查看此帖子Spark on YARN
通常我们将worker实例称为slave,因为它是 a process to execute spark tasks/jobs . 建议的节点(物理或虚拟机)和工作人员的映射是,
Yes, A worker node can be holding multiple executors (进程),如果它有足够的CPU,内存和存储 .
检查给定图像中的Worker节点 .
BTW,工作节点 at a given point of time 中的执行程序数完全取决于 work load on the cluster 和 capability of the node 来运行多少个执行程序 .
如果我们通过任何资源管理器查看Spark预期执行的程序,那么
join
两个rdd
并执行一些reduce
操作然后filter
HIH
正如Lan所说,使用多个工作器实例仅在独立模式下相关 . 您希望拥有多个实例的原因有两个:(1)垃圾暂停收集器会损害大型JVM的吞吐量(2)堆大小> 32 GB无法使用CompressedOoops
了解更多关于how to set up multiple worker instances的信息 .