Spark-3.5版本以下使用Celeborn时,无法使用动态资源,对于低版本的Spark,Celeborn提供了patch。各版本patch如下

https://github.com/apache/incubator-celeborn/tree/main/assets/spark-patch

下载patch,这里下载spark-3版本,将Celeborn_Dynamic_Allocation_spark3_3.patch放至spark-3.3.1源码目录下,和core一层级,执行如下命令代码合并

patch -p1 < Celeborn_Dynamic_Allocation_spark3_3.patch

重新编译spark源码,并生成spark tgz

./dev/make-distribution.sh --tgz --name custom-spark -Phadoop-3.2 -Dhadoop.version=3.2.1 
 -Phive-3.2.1 -Phive-thriftserver -Pyarn -DskipTests

提交任务

 /opt/apps/SPARK3/spark-3.3.1-bin-custom-spark/bin/spark-submit 
--conf spark.shuffle.manager=org.apache.spark.shuffle.celeborn.SparkShuffleManager 
--conf spark.celeborn.client.spark.shuffle.writer=hash 
--conf spark.serializer=org.apache.spark.serializer.KryoSerializer 
--conf spark.celeborn.master.endpoints=celeborn-master:9097 
--conf spark.sql.adaptive.enabled=true 
--conf spark.sql.adaptive.skewJoin.enabled=false 
--conf spark.celeborn.client.push.replicate.enabled=false 
--conf spark.dynamicAllocation.enabled=true 
--conf spark.shuffle.service.enabled=false 
--conf spark.celeborn.storage.hdfs.dir=hdfs://hdfs-cluster/celeborn 
--conf spark.dynamicAllocation.initialExecutors=10 
--conf spark.dynamicAllocation.minExecutors=0 
--conf spark.dynamicAllocation.maxExecutors=10 
--conf spark.dynamicAllocation.executorIdleTimeout=30s 
--queue dataAnalysis 
--class com.rs.dsp.etl.jobs.CommonUserTrackSessionDetailD 
--master yarn 
--deploy-mode cluster 
--driver-memory 4GB 
--executor-memory 15G 
--executor-cores 2 
/root/rs-dsp-spark-1.0-SNAPSHOT-jar-with-dependencies.jar

原文地址:https://blog.csdn.net/woloqun/article/details/134731519

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_44042.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注