gpt4 book ai didi

azure - 如何在Azure Spark集群上通过Apache Livy设置spark.driver.extraClassPath?

转载 作者:行者123 更新时间:2023-12-03 03:00:16 28 4
gpt4 key购买 nike

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

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可以通过将此conf添加到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

谢谢

最佳答案

添加以下内容

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

关于azure - 如何在Azure Spark集群上通过Apache Livy设置spark.driver.extraClassPath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49571156/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com