# userSparkSQL **Repository Path**: wubaidev/userSparkSQL ## Basic Information - **Project Name**: userSparkSQL - **Description**: spark-submit cluster模式业务开发 --解决 配置文件读取不到、 安全认证不过等问题 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-03-05 - **Last Updated**: 2025-03-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: Java, Scala ## README # userSparkSQL #### 介绍 spark-submit cluster模式业务开发 --解决 配置文件读取不到、 安全认证不过等问题 详细介绍及使用请参考:[spark-submit cluster模式业务开发 --解决 配置文件读取不到、 安全认证不过等问题](https://blog.csdn.net/m0_57874805/article/details/145510874?spm=1001.2014.3001.5502) #### 使用说明 目的:使用spark-submit cluster模式 提交spark-sql类型任务 cluster 模式优势: 相对client模式,driver端在集群内部,资源更好管理,减少垮节点IO cluster模式常见问题: 相对client模式,存在读取不到配置文件及安全认证不过 √ 本案例:可以解决 配置文件读取不到、 安全认证不过等问题 调用slala-sdk版本要求:2.12.14 #### 调用示例: ```shell #!/bin/bash ​ function envInit(){ spark_submit_path=$(dirname "${BASH_SOURCE-$0}") spark_submit_path=$(cd "$spark_submit_path"; pwd) client=$(cd "$spark_submit_path"/../../../;pwd) source "$client"/bigdata_env } envInit ${spark_submit_path}/spark-submit \ --master yarn \ --deploy-mode cluster \ --conf spark.sql.autoBroadcastJoinThreshold=-1 \ --conf spark.driver.memory=50g \ --conf spark.logOptimization.enable=false \ --conf spark.sql.shuffle.partitions=400 \ --conf spark.serializer=org.apache.spark.serializer.KryoSerializer \ --conf spark.network.timeout=300 \ --num-executors 12 \ --executor-memory 6g \ --executor-cores 10 \ --name ExecSqlc\ --files /opt/client2/Spark2x/spark/bin/conf/user.keytab,/opt/client2/Spark2x/spark/bin/conf/krb5.conf,/opt/client2/Spark2x/spark/bin/conf/2.hql \ --class com.xx.spark.security.bigdata.ExecSqlc /opt/client2/Spark2x/spark/bin/userSparkSQL.jar \ --userPrincipal=hcqs \ --sparkSqlPath=/opt/client2/Spark2x/spark/bin/conf/2.hql \ --params="cloumn1=0201,cloumn2=2059881123" #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request