spark提交模式
- --class: 主函数所在的类。
- --master: master的url,后面会解释 (e.g. spark://23.195.26.187:7077)
- --deploy-mode: 部署driver在本地还是集群的一个work节点上,这也是client模式与cluster模式的区别。默认是client的模式。
- --conf:用 key=value形式指定参数,如果包含空格那么要用双引号引起来,例如“key=value”
- application-jar:jar包的路径.该路径必须在集群内全局可见。 例如: hdfs:// path 或者 file:// 这个path必须是所有节点都存在。.
- application-arguments: 传递给main函数 参数,如java main方法中的args[].
#本地运行,指定8个core
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master local[] \
/path/to/examples.jar \
100
# 在 Spark standalone 集群并且是client模式
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
1000
# 在 Spark standalone 集群并且是cluster模式 并指定supervise
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
1000
# Yarn cluster模式export HADOOP_CONF_DIR=XXX
./bin/spark-submit\
--class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode cluster \
# can be client for client mode
--executor-memory 20G \
--num-executors 50 \
/path/to/examples.jar \
1000
# python提交到standalone的cluster模式
./bin/spark-submit \
--master spark://207.184.161.138:7077 \
examples/src/main/python/pi.py \
1000
# mesos cluster模式,并指定supervise。
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master mesos://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
http://path/to/examples.jar \
1000
local | 本地worker线程中运行spark,完全没有并行 |
local[K] | 在本地work线程中启动K个线程运行spark |
local[*] | 启动与本地work机器的core个数想通的线程数来运行spark |
spark://HOST:PORT | 连接指定的standalone集群的master,默认7077端口 |
mesos://HOST:PORT | 连接到mesos集群,默认5050端口。如果mesos使用了zk,那么也可以mesos://zk://.... 加 --deploy-mode cluster这种形式。 |
yarn | 使用yarn的cluster或者yarn的client模式连接。取决于--deploy-mode参数,集群的位置需要使用hadoop的配置或者yarn的配置中去寻找。 |
- file: - 绝对路径 file:/ dirver的http file server。executors会从该driver上拉取jar。
- hdfs:, http:, https:, ftp: -从这些位置拉取
- local: - 从worke所在 每台机器本地拉取文件,适合于jar包很大的场景。
spark提交模式的更多相关文章
- 【Spark篇】--Spark中Standalone的两种提交模式
一.前述 Spark中Standalone有两种提交模式,一个是Standalone-client模式,一个是Standalone-master模式. 二.具体 1.Standalon ...
- Spark Standalone 提交模式
一.Client提交模式 提交命令: ./spark-submit --master spark://node1:7077 --class org.apache.spark.examples.Spar ...
- Spark学习之路(五)—— Spark运行模式与作业提交
一.作业提交 1.1 spark-submit Spark所有模式均使用spark-submit命令提交作业,其格式如下: ./bin/spark-submit \ --class <main- ...
- Spark 系列(五)—— Spark 运行模式与作业提交
一.作业提交 1.1 spark-submit Spark 所有模式均使用 spark-submit 命令提交作业,其格式如下: ./bin/spark-submit \ --class <ma ...
- spark基于yarn的两种提交模式
一.spark的三种提交模式 1.第一种,Spark内核架构,即standalone模式,基于Spark自己的Master-Worker集群. 2.第二种,基于YARN的yarn-cluster模式. ...
- 小记--------spark的两种提交模式
spark的两种提交模式:yarn-cluster . yarn-client 图解
- 入门大数据---Spark部署模式与作业提交
一.作业提交 1.1 spark-submit Spark 所有模式均使用 spark-submit 命令提交作业,其格式如下: ./bin/spark-submit \ --class <ma ...
- Spark剖析-宽依赖与窄依赖、基于yarn的两种提交模式、sparkcontext原理剖析
Spark剖析-宽依赖与窄依赖.基于yarn的两种提交模式.sparkcontext原理剖析 一.宽依赖与窄依赖 二.基于yarn的两种提交模式深度剖析 2.1 Standalne-client 2. ...
- 大数据学习day18----第三阶段spark01--------0.前言(分布式运算框架的核心思想,MR与Spark的比较,spark可以怎么运行,spark提交到spark集群的方式)1. spark(standalone模式)的安装 2. Spark各个角色的功能 3.SparkShell的使用,spark编程入门(wordcount案例)
0.前言 0.1 分布式运算框架的核心思想(此处以MR运行在yarn上为例) 提交job时,resourcemanager(图中写成了master)会根据数据的量以及工作的复杂度,解析工作量,从而 ...
随机推荐
- ElasticSearch(十七)初识倒排索引
现在有两条document: doc1:I really liked my small dogs, and I think my mom also liked them. doc2:He never ...
- CF451E Devu and Flowers(容斥)
CF451E Devu and Flowers(容斥) 题目大意 \(n\)种花每种\(f_i\)个,求选出\(s\)朵花的方案.不一定每种花都要选到. \(n\le 20\) 解法 利用可重组合的公 ...
- [APIO2008]免费道路
[APIO2008]免费道路 BZOJ luogu 先把必须连的鹅卵石路连上,大于k条no solution 什么样的鹅卵石路(u,v)必须连?所有水泥路都连上仍然不能使u,v连通的必须连 补全到k条 ...
- 我的Android进阶之旅------>启动Activity的标准Action和标准Category
Android内部提供了大量标准的Action和Category常量. 除了参考本文外,您还可以参考了以下链接: http://developer.android.com/reference/andr ...
- linux基础part2
linux基础 一.linux基础命令 1.pwd:用来显示当前目录位置 2.cd:用来切换目录位置.(eg:cd...cd../...cd-.cd~) 3.ls:用来查看目录或文件信息(eg:ls ...
- TCP标准模板
伪代码 #创建一个TCP服务器 ss = socket() #创建服务器套接字 ss.bind() #把地址绑定到套接字上 ss.listen() #监听连接 inf_loop: #服务器无线循环 c ...
- Ubuntu 14.04 或者16.04开启root账户登录和图形界面登录root时候的报错解决方法
1.打开终端 2.输入sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 3.添加一行:greeter-show-manual-login ...
- 【leetcode刷题笔记】Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent n ...
- poj 3006 Dirichlet's Theorem on Arithmetic Progressions【素数问题】
题目地址:http://poj.org/problem?id=3006 刷了好多水题,来找回状态...... Dirichlet's Theorem on Arithmetic Progression ...
- java入门了解08
1.集合深入 (一)hashSet实现原理: 当我们添加一个元素,HashSet会计算出其Hash值,再根据hash值在哈希表中找出存储他的位置 有两种情况:a.如果算出的hash值在哈希表中位置没有 ...