[Spark总结]Spark Core概述


  Spark Core实现了 Spark 的基本功能,包含任务调度、内存管理、错误恢复、与存储系统交互等模块。Spark Core 中还包含了对弹性分布式数据集RDD的 API 定义。

Spark Core相关术语

Spark Application

User program built on Spark. Consists of a driver program and executors on the cluster.

Application = a driver + some executors on the cluster

Driver Program

The process running the main() function of the application
 and creating the SparkContext

驱动程序主要完成两个工作:

  1. 运行main()
  2. 创建 SparkContext

Spark 的驱动器是执行开发程序中的 main 方法的进程。它负责开发人员编写的用来创建 SparkContext、创建 RDD,以及进行 RDD 的转化操作和行动操作代码的执行。如果你是用 spark shell,那么当你启动 Spark shell 的时候,系统后台自启了一个 Spark 驱动器程序,就是在 Spark shell 中预加载的一个叫作 sc 的 SparkContext 对象。如果驱动器程序终
止,那么 Spark 应用也就结束了。主要负责:

  • 将用户程序转化为任务(job);
  • 在 Executor 之间调度任务(task);
  • 跟踪 Executor 的执行情况;
  • 通过 UI 展示查询运行情况;

Cluster Manager

cluster manager is an external service for acquiring resources on the cluster

集群管理器主要是去 standalone/Mesos/Yarn/K8S/上申请资源

Worker Node

相当于 Yarn 上的 NodeManager
上面会有很多的 Executor 类似于container容器

Executor

A process launched for an application on a worker node,
that runs tasks and keeps data in memory or disk storage across them.
Each application has its own executors.

一个 Executor 可以运行多个 task

Task

A unit of work that will be sent to one executor

是最小的工作单元,跑在 Executor 上
一个分区就是一个 Task

Job

在Spark上,只要运行一个action就是一个Job。一个Job会包含多个Task

Deploy Mode

Distinguishes where the driver process runs. 
In "cluster" mode, the framework launches the driver inside of the cluster.
In "client" mode, the submitter launches the driver outside of the cluster.

Spark运行机制

Spark的运行架构包括

  • 集群资源管理器(Cluster Manager)
  • 每个应用的任务控制节点(Driver)
  • 运行作业任务的工作节点(Worker Node)
  • 每个工作节点上负责具体任务的执行进程(Executor)
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值