gpt4 book ai didi

hadoop - 通过Uber Jar和Oozie和Hue运行Spark Job

转载 作者:行者123 更新时间:2023-12-02 21:13:23 31 4
gpt4 key购买 nike

我目前正在学习如何使用Apache Oozie在CDH 5.8中运行Spark Jobs,但似乎发现了问题。

我正在使用IntelliJ> Build Artifact(编译到Uber JAR / Fat JAR)来编译我的spark作业,然后删除其 list 文件。然后我运行spark-submit来运行JAR。它工作正常。

但是当我与Oozie指定一个Spark Action时。我收到以下错误:

Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SparkMain], exception invoking main(), java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2199)
at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:234)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2105)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2197)
... 9 more

job.properties:
oozie.use.system.libpath=false
security_enabled=False
dryrun=False
jobTracker=master.meshiang:8032
nameNode=hdfs://master.meshiang:8020

我的工作流程:
<workflow-app name="CSV" xmlns="uri:oozie:workflow:0.4">
<start to="spark-2bab"/>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="spark-2bab">
<spark xmlns="uri:oozie:spark-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<master>local[*]</master>
<mode>client</mode>
<name>MySpark</name>
<class>ETL.CSVTransform</class>
<jar>/user/meshiang/jar/Spark-GetData.jar</jar>
<arg>work_id</arg>
<arg>csv_table</arg>
<arg>id/FirstName/Lastname</arg>
<arg>/user/meshiang/csv/ST1471448595.csv</arg>
<arg>,</arg>
</spark>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
</workflow-app>

我已经做了:
  • 当我将相同的jar放入工作区的/ lib文件夹中时,以与上面相同的方式使用它。作业运行了10分钟,被杀死,并且没有显示任何错误代码或消息。
  • 我在Hue中运行了Spark Example作业。我收到以下消息

  • 错误:
    JA018
    Error Message Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.RuntimeException: Stream '/jars/oozie-examples.jar' was not found. at org.apache.spark.network.client.TransportResponseHandler.handle(TransportResponseHandler.java:219) at org.apache.spark.network.server.TransportChannelHandler.channelRead0(TransportChannelHandler.java:106) at org.apache.spark.network.server.TransportChannelHandler.channelRead0(Tr

    我的问题:
  • 我应该只编译所需的类并使用Oozie ShareLibs吗? Oozie总体上是否支持Uber JARS?
  • 如果我使用的是Pig / Sqoop,是否也需要这样做?
  • 最佳答案

    要解决ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain,您需要启用oozie system lib属性。

    oozie.use.system.libpath=true.

    这是运行任何Hive,Pig,Sqoop,Spark等作业所必需的。

    您可以编译并构建spark应用程序jar,并将其放入oozie应用程序路径下的 lib目录中。 Oozie应用程序路径是HDFS中存储和引用 workflow.xml文件的目录。

    希望这会有所帮助。谢谢。

    关于hadoop - 通过Uber Jar和Oozie和Hue运行Spark Job,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39538094/

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