Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to run Oozie Spark action properly?

Highlighted

How to run Oozie Spark action properly?

Contributor

Hi guys,

I am on HDP 2.5 and I would like to run a Spark action within Oozie. The jar was tested with spark-submit beofre. My action looks like this:

(Namenode etc. from global settings)

<action name="spark-action" retry-max="1">  
<spark xmlns="uri:oozie:spark-action:0.2">  
<master>yarn-cluster</master>  
<name>Spark Test</name> 
<class>org.SparkTest</class>  
<jar>/myhdfs/spark_test.jar</jar>  
<spark-opts>--executor-memory 2G</spark-opts>  
</spark>  
<ok to="end"/>  
<error to="kill"/>  
</action>

At first I tried with mode="locale" but then I get an error that the master and mode don't fit together. (Client deploy mode is not compatible with master "yarn-cluster")

When I leave it open, so no declaration of mode I get an error that the file does not exist. But the file is definetly in the HDFS in the right place. What do I need to change??

The error is:

Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SparkMain], main() threw exception, Application application_1491479953113_0414 finished with failed status
org.apache.spark.SparkException: Application application_1491479953113_0414 finished with failed status
        at org.apache.spark.deploy.yarn.Client.run(Client.scala:1122)
        at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1169)
        at org.apache.spark.deploy.yarn.Client.main(Client.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
        at org.apache.oozie.action.hadoop.SparkMain.runSpark(SparkMain.java:289)
        at org.apache.oozie.action.hadoop.SparkMain.run(SparkMain.java:211)
        at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:51)
        at org.apache.oozie.action.hadoop.SparkMain.main(SparkMain.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:242)
        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:168)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)
log4j:WARN No appenders could be found for logger (org.apache.spark.util.ShutdownHookManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

In my job.properties I added the following:

oozie.use.system.libpath=trueoozie.action.sharelib.for.spark = spark,hcatalog,hive

Thanks for your help!!

5 REPLIES 5

Re: How to run Oozie Spark action properly?

Expert Contributor

Hi Ken, quick question--in your job.properties did you add two separate lines, they're just running together here?

Re: How to run Oozie Spark action properly?

Contributor

Yes i did. Sorry that was a copy paste error.

Re: How to run Oozie Spark action properly?

Expert Contributor

Re: How to run Oozie Spark action properly?

Re: How to run Oozie Spark action properly?

New Contributor

Hi All,

I'm also facing the same issue while using spark action with oozie .

Any solution for the same ??