spark运行方式及其常用参数
来源:互联网 发布:网络主播收入来源 编辑:程序博客网 时间:2024/06/05 15:05
本文将介绍spark的几种运行方式,及常用的参数
yarn cluster模式
例行任务一般会采用这种方式运行
指定固定的executor数
作业常用的参数都在其中指定了,后面的运行脚本会省略
spark-submit \ --master yarn-cluster \ --deploy-mode cluster \ #集群运行模式 --name wordcount_${date} \ #作业名 --queue production.group.yanghao \ #指定队列 --conf spark.default.parallelism=1000 \ #并行度,shuffle后的默认partition数 --conf spark.network.timeout=1800s \ --conf spark.yarn.executor.memoryOverhead=1024 \ #堆外内存 --conf spark.scheduler.executorTaskBlacklistTime=30000 \ --conf spark.core.connection.ack.wait.timeout=300s \ --conf spark.storage.memoryFraction=0.3 \ #默认值是0.6,executor用于持久化rdd的内存占比。如果程序中持久化的操作比较少,建议调低该参数 --conf spark.shuffle.memoryFraction=0.5 \ #默认值是0.2,executor用于shuffle的内存,如果shuffle中的数据量操过了shuffle允许的内存,则将数据放在磁盘上。如果shuffle操作较多,持久化操作较少,可以调节该参数 --num-executors 200 \ #executor数目 --executor-memory 4G \ #executor中堆的内存 --executor-cores 2 \ #executor执行core的数目,设置大于1 --driver-memory 2G \ #driver内存,不用过大 --class ${main_class} \ #主类 ${jar_path} \ #jar包位置 param_list \ #mainClass接收的参数列表
动态调整executor数目
spark-submit \ --master yarn-cluster \ --deploy-mode cluster \ --name wordcount_${date} \ --queue production.group.yanghao \ --conf spark.dynamicAllocation.enabled=true \ #开启动态分配 --conf spark.shuffle.service.enabled=true \ #shuffle service,可以保证executor被删除时,shuffle file被保留 --conf spark.dynamicAllocation.minExecutors=200 \ #最小的executor数目 --conf spark.dynamicAllocation.maxExecutors=500 \ #最大的executor数目 --class ${main_class} \ ${jar_path} \ param_list
yarn client模式
边写脚本,边在集群上运行。这样调试会很方便
spark-shell \ --master yarn-client \ --queue production.group.yanghao \ #指定队列 --num-executors 200 \ #executor数目 --executor-memory 4G \ #executor中堆的内存 --executor-cores 2 \ #executor执行core的数目,设置大于1 --driver-memory 2G \ #driver内存,不用过大 --jars ${jar_path} #jar包位置
yarn cluster模式 vs yarn client模式
yarn cluster模式:spark driver和application master在同一个节点上
yarn client模式:spark driver和client在同一个节点上,支持shell
参考
http://stackoverflow.com/questions/21138751/spark-java-lang-outofmemoryerror-java-heap-space
0 0
- spark运行方式及其常用参数
- Spark 运行方式
- spark-submit常用参数
- spark job运行参数优化
- Spark参数配置及其性能优化
- Spark简介及其生态圈及Spark-core运行机理
- Java常用参数及其作用
- Maven常用参数及其说明
- Maven常用参数及其说明
- Maven常用参数及其说明
- spark-submit 运行参数问题记录
- spark 运行内存异常及参数调整
- spark jar包方式运行hive步骤
- localhost方式提交作业到spark运行
- Spark不常用的参数调节
- Hadoop与Spark常用配置参数总结
- Hadoop与Spark常用配置参数总结
- Hadoop与Spark常用配置参数总结
- ionic cordova 打开外部网站
- HTML 常用标签及示例
- Redis集群配置
- android怎样判断应用程序退到后台
- Tarjan模板
- spark运行方式及其常用参数
- 数组排序法(二)
- Android Support兼容包详解
- Android中的“智能指针”——RefBase
- Android开发之InstanceState详解
- 第四周 项目3-单链表的应用(3)
- ubuntu 设置 静态IP
- VIM教程
- jquery填充select下拉列表,三级联动