spark client mode cluster mode 区别 与选择

1、在我们使用spark-submit 提交spark 任务一般有以下参数

clike 复制代码
/bin/spark-submit \
  --class <main-class> \
  --master <master-url> \
  --deploy-mode <deploy-mode> \
  --conf <key>=<value> \
  ... # other options
  <application-jar> \
  [application-arguments]

其中 deplay-mode是针对集群而言,是指集群的部署模式,根据Driver主进程放在哪的两种方式。:client和cluster,默认是client,下面我们就详细研究一下这两种模式的区别

2、spark-submit 详细参数说明

参数名 参数说明

--master master 的地址,提交任务到哪里执行,例如 spark://host:port, yarn, local

--deploy-mode 在本地 (client) 启动 driver 或在 cluster 上启动,默认是 client

--class 应用程序的主类,仅针对 java 或 scala 应用

--name 应用程序的名称

--jars 用逗号分隔的本地 jar 包,设置后,这些 jar 将包含在 driver 和 executor 的 classpath 下

--packages 包含在driver 和executor 的 classpath 中的 jar 的 maven 坐标

--exclude-packages 为了避免冲突 而指定不包含的 package

--repositories 远程 repository

--conf PROP=VALUE 指定 spark 配置属性的值,

( 例如 -conf spark.executor.extraJavaOptions="-XX:MaxPermSize=256m")

--properties-file 加载的配置文件,默认为 conf/spark-defaults.conf

--driver-memory Driver内存,默认 1G

--driver-java-options 传给 driver 的额外的 Java 选项

--driver-library-path 传给 driver 的额外的库路径

--driver-class-path 传给 driver 的额外的类路径

--driver-cores Driver 的核数,默认是1。在 yarn 或者 standalone 下使用

--executor-memory 每个 executor 的内存,默认是1G

--total-executor-cores 所有 executor 总共的核数。仅仅在 mesos 或者 standalone 下使用

--num-executors 启动的 executor 数量。默认为2。在 yarn 下使用

--executor-core 每个 executor 的核数。在yarn或者standalone下使用

3、spark deploy model 对于程序容错的处理

在spark 程序中 ,task 有失败重试机制)

相关推荐
Databend1 小时前
从湖仓升级为 Agent 时代的数据控制面,Snowflake 和 Databricks 有哪些布局
大数据·数据库·agent
阿里云大数据AI技术1 天前
StarRocks x Fluss x Paimon湖流一体方案:构建秒级响应、湖流一体的实时数据引擎
大数据·人工智能
Databend1 天前
Agent 轨迹分析与归因的数据工程实践
大数据·数据库·agent
喵个咪1 天前
Go Wind UBA 拆解系列 - 架构总览:三服务、数据流与契约优先
大数据·后端·go
喵个咪1 天前
Go Wind UBA 拆解系列 - 多租户与安全:两套隔离机制的边界
大数据·后端·go
喵个咪1 天前
Go Wind UBA 拆解系列 - OLAP 与 SQL 硬核:25 个分析模型怎么落地
大数据·后端·go
喵个咪1 天前
Go Wind UBA 拆解系列 - SDK 与采集层:从浏览器到 Kafka
大数据·后端·go
QCC产品中心1 天前
MiniMax Agent 接入实测:企业查询、股权穿透与 UBO 识别(附 Prompt 模板)
大数据·mcp·金融/非金融
SelectDB2 天前
Apache Doris Python UDF:让 SQL 直接调用 Python 生态,支撑 Agent 时代复杂业务逻辑
大数据·数据库·python
ApacheSeaTunnel2 天前
当多表数据涌入,Apache SeaTunnel 如何巧妙化解主键冲突?
大数据·开源·数据集成·seatunnel·技术分享·数据同步