【问题标题】:How to set spark.driver.extraClassPath through Apache Livy on Azure Spark cluster?如何在 Azure Spark 集群上通过 Apache Livy 设置 spark.driver.extraClassPath?
【发布时间】:2018-09-09 07:15:03
【问题描述】:

我想在通过 Apache Livy 将 Spark 作业提交到 Azure 集群时添加一些配置。目前要通过集群中的 Apache Livy 启动 spark Job,我使用以下命令

curl -X POST --data '{"file": "/home/xxx/lib/MyJar.jar", "className": "org.springframework.boot.loader.JarLauncher"}' -H "Content-Type: application/json" localhost:8998/batches

该命令生成如下进程

……. org.apache.spark.deploy.SparkSubmit --conf spark.master=yarn-cluster --conf spark.yarn.tags=livy-batch-51-qHXmHXWg --conf spark.yarn.submit.waitAppCompletion=false --class org.springframework.boot.loader.JarLauncher adl://home/home/xxx/lib/MyJar.jar

由于运行jar时的技术问题,需要在该命令中引入两个配置。

--conf "spark.driver.extraClassPath=/home/xxx/lib /jars/*"  
--conf "spark.executor.extraClassPath=/home/xxx/lib/jars/*"

这与在使用 log4j2 的 spark 上运行时出现 logback 问题有关。额外的类路径添加了 logback jars

我在这里找到https://groups.google.com/a/cloudera.org/forum/#!topic/hue-user/fcRM3YiqAAA 可以通过将此配置添加到 LIVY_SERVER_JAVA_OPTS 或 spark-defaults.conf 来完成

我从 Ambari 修改了 livy-env.sh 中的 LIVY_SERVER_JAVA_OPTS(在 spak2 和 livy 菜单中)和 Spark2 中的高级 spark2-defaults。

不幸的是,这对我们不起作用。甚至我可以看到 LivyServer 是使用 -Dspark.driver.extraClassPath 启动的

是否需要在 Azure Hdinsight 中添加任何特定配置以使其正常工作?

注意流程应该是这样的

……. org.apache.spark.deploy.SparkSubmit --conf spark.master=yarn-cluster --conf spark.yarn.tags=livy-batch-51-qHXmHXWg --conf spark.yarn.submit.waitAppCompletion=false **--conf "spark.driver.extraClassPath=/home/xxx/lib /jars/*"  --conf "spark.executor.extraClassPath=/home/xxx/lib/jars/*"**
 --class org.springframework.boot.loader.JarLauncher adl://home/home/xxx/lib/MyJar.jar

谢谢

【问题讨论】:

    标签: azure apache-spark spark-submit livy


    【解决方案1】:

    添加以下内容

    "conf":{ "spark.driver.extraClassPath":"wasbs:///pathtojar.jar","spark.yarn.user.classpath.first":"true"}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 2013-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多