<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark application fails on slaves when launching from Oozie on Yarn in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172113#M37476</link>
    <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/12021/shariyarmurtaza.html" nodeid="12021"&gt;@Shary M&lt;/A&gt; for providing the workflow. Looks like the arguments which we have passed might not be passed to the java application . The way we need to specify the argument in the application as args[0] .. args[n], where arg[0] is the argument passed first in the oozie workflow. In the above one, &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;arg[0] --&amp;gt; -logtype and &lt;/LI&gt;&lt;LI&gt;arg[1] --&amp;gt; adraw&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can refer the following examples.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Sample workflow: &lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/apps/spark/workflow.xml"&gt;https://github.com/apache/oozie/blob/master/examples/src/main/apps/spark/workflow.xml&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Sample java application : &lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java"&gt;https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let us know if you need more information. If it failing again, please share the snippet of your application also. &lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 20:54:08 GMT</pubDate>
    <dc:creator>mramasami</dc:creator>
    <dc:date>2016-08-11T20:54:08Z</dc:date>
    <item>
      <title>Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172107#M37470</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to launch a spark application which works perfectly well from shell but executors fail when launched from OOzie. On the slaves (Executors) side, I see the following:&lt;/P&gt;&lt;PRE&gt;Error: Could not find or load main
class org.apache.spark.executor.CoarseGrainedExecutorBackend&lt;/PRE&gt;&lt;P&gt;On the driver side I see the following, but it
is not really any null pointer in my code. My code is working fine when I
launch spark directly from shell. It has something to do with executors.&lt;/P&gt;&lt;PRE&gt;[Driver] ERROR ogminer.main.LogMinerMain - nulljava.lang.InterruptedExceptionat java.lang.Object.wait(Native Method) ~[?:1.8.0_66]at java.lang.Object.wait(Object.java:502) ~[?:1.8.0_66]
at org.apache.spark.scheduler.JobWaiter.awaitResult(JobWaiter.scala:73)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:513)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1466)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1484)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1498) ~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1512)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.rdd.RDD.collect(RDD.scala:813)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.api.java.JavaRDDLike$class.collect(JavaRDDLike.scala:320)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at org.apache.spark.api.java.AbstractJavaRDDLike.collect(JavaRDDLike.scala:46)~[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]
at logminer.main.LogSparkTester.test(LogSparkTester.java:214)~[__app__.jar:?]
at logminer.main.LogMinerMain.testTrainOnHdfs(LogMinerMain.java:232)~[__app__.jar:?]
at com.telus.argus.logminer.main.LogMinerMain.main(LogMinerMain.java:159)[__app__.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:1.8. 0_66]
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:1.8.0_66]at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:484)
[spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar:?]

&lt;/PRE&gt;&lt;P&gt;I am not sure how to solve this issue. I have put all the spark related jars in the lib folder for this oozie job. Here is my directory structure on hdfs for this OOzie job&lt;/P&gt;&lt;P&gt;oozie/
oozie/workflow.xml
oozie/job.properties&lt;/P&gt;&lt;P&gt;oozie/lib/argus-logminer-1.0.jar &lt;/P&gt;&lt;P&gt;oozie/lib/core-site.xml &lt;/P&gt;&lt;P&gt;oozie/lib/hdfs-site.xml &lt;/P&gt;&lt;P&gt;oozie/lib/kms-site.xml &lt;/P&gt;&lt;P&gt;oozie/lib/mapred-site.xml &lt;/P&gt;&lt;P&gt;oozie/lib/oozie-sharelib-spark-4.2.0.2.3.0.0-2557.jar &lt;/P&gt;&lt;P&gt;oozie/lib/spark-1.3.1.2.3.0.0-2557-yarn-shuffle.jar&lt;/P&gt;&lt;P&gt; oozie/lib/spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar &lt;/P&gt;&lt;P&gt;oozie/lib/yarn-site.xml&lt;/P&gt;&lt;P&gt;Does any know how to solve this? Any idea which jar has this: CoarseGrainedExceutorBackend class?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 02:14:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172107#M37470</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-08-11T02:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172108#M37471</link>
      <description>&lt;P&gt;What version of spark and hdp? Can you list out all jar under SPARK_HOME directory from worker machine in cluster?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 02:49:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172108#M37471</guid>
      <dc:creator>rreddy</dc:creator>
      <dc:date>2016-08-11T02:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172109#M37472</link>
      <description>&lt;P&gt;Spark: 1.3.1
HDP: 2.3.0.0-2557&lt;/P&gt;&lt;P&gt;I don't see any SPARK_HOME variable in my shell. But here is the list of jar from hdp/currrent/spark-client
/usr/hdp/current/spark-client/lib&lt;/P&gt;&lt;P&gt;datanucleus-api-jdo-3.2.6.jar&lt;/P&gt;&lt;P&gt;datanucleus-rdbms-3.2.9.jar&lt;/P&gt;&lt;P&gt;spark-assembly-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar&lt;/P&gt;&lt;P&gt;datanucleus-core-3.2.10.jar&lt;/P&gt;&lt;P&gt;spark-1.3.1.2.3.0.0-2557-yarn-shuffle.jar &lt;/P&gt;&lt;P&gt;spark-examples-1.3.1.2.3.0.0-2557-hadoop2.7.1.2.3.0.0-2557.jar&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 03:15:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172109#M37472</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-08-11T03:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172110#M37473</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;CoarseGrainedExecutorBackend should be in spark-assembly.&lt;/P&gt;Might be relevant to you...&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/OOZIE-2482" target="_blank"&gt;https://issues.apache.org/jira/browse/OOZIE-2482&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/49479/how-to-use-oozie-shell-action-to-run-a-spark-job-i.html" target="_blank"&gt;https://community.hortonworks.com/articles/49479/how-to-use-oozie-shell-action-to-run-a-spark-job-i.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.ibm.com/hadoop/2015/11/05/run-spark-job-yarn-oozie/" target="_blank"&gt;https://developer.ibm.com/hadoop/2015/11/05/run-spark-job-yarn-oozie/&lt;/A&gt;&lt;/P&gt;Try setting SPARK_HOME variable in hadoop-env.sh&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 08:39:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172110#M37473</guid>
      <dc:creator>andrew_sears</dc:creator>
      <dc:date>2016-08-11T08:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172111#M37474</link>
      <description>&lt;P&gt;Can you tell me which mode you are using? yarn-cluster/yarn-client mode.&lt;/P&gt;&lt;P&gt;Also can you share the workflow.xml you are using? &lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:57:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172111#M37474</guid>
      <dc:creator>mramasami</dc:creator>
      <dc:date>2016-08-11T12:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172112#M37475</link>
      <description>&lt;P&gt;yarn-cluster &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;workflow-app name="${wf_name}" xmlns="uri:oozie:workflow:0.4"&amp;gt;
  &amp;lt;start to="spark"/&amp;gt;
  &amp;lt;action name="spark"&amp;gt;
  &amp;lt;spark xmlns="uri:oozie:spark-action:0.1"&amp;gt;
  &amp;lt;job-tracker&amp;gt;${job_tracker}&amp;lt;/job-tracker&amp;gt;
  &amp;lt;name-node&amp;gt;${name_node}&amp;lt;/name-node&amp;gt;
  &amp;lt;master&amp;gt;${master}&amp;lt;/master&amp;gt;
  &amp;lt;mode&amp;gt;cluster&amp;lt;/mode&amp;gt;
  &amp;lt;name&amp;gt;logminer&amp;lt;/name&amp;gt;
  &amp;lt;class&amp;gt;logminer.main.LogMinerMain&amp;lt;/class&amp;gt;
  &amp;lt;jar&amp;gt;${filesystem}/${baseLoc}/oozie/lib/argus-logminer-1.0.jar&amp;lt;/jar&amp;gt;
  &amp;lt;spark-opts&amp;gt;--driver-memory 4G --executor-memory 4G --num-executors 3 --executor-cores 5&amp;lt;/spark-opts&amp;gt;
  &amp;lt;arg&amp;gt;-logtype&amp;lt;/arg&amp;gt; &amp;lt;arg&amp;gt;adraw&amp;lt;/arg&amp;gt;
  &amp;lt;arg&amp;gt;-inputfile&amp;lt;/arg&amp;gt; &amp;lt;arg&amp;gt;/user/inputfile-march-3.txt&amp;lt;/arg&amp;gt;
  &amp;lt;arg&amp;gt;-configfile&amp;lt;/arg&amp;gt; &amp;lt;arg&amp;gt;${filesystem}/${baseLoc}/oozie/logminer.properties&amp;lt;/arg&amp;gt;
  &amp;lt;arg&amp;gt;-mode&amp;lt;/arg&amp;gt; &amp;lt;arg&amp;gt;test&amp;lt;/arg&amp;gt;
  &amp;lt;/spark&amp;gt;
  &amp;lt;ok to="success_email"/&amp;gt;
  &amp;lt;error to="fail_email"/&amp;gt;
  &amp;lt;/action&amp;gt;
  &amp;lt;action name="success_email"&amp;gt;
  &amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
  &amp;lt;to&amp;gt;${emailTo}&amp;lt;/to&amp;gt;
  &amp;lt;cc&amp;gt;${emailCC}&amp;lt;/cc&amp;gt;
  &amp;lt;subject&amp;gt;${wf_name}: Successful run at ${wf:id()}&amp;lt;/subject&amp;gt;
  &amp;lt;body&amp;gt;The workflow [${wf:id()}] ran succesfully.&amp;lt;/body&amp;gt;
  &amp;lt;/email&amp;gt;
  &amp;lt;ok to="end"/&amp;gt;
  &amp;lt;error to="fail_email"/&amp;gt;
  &amp;lt;/action&amp;gt;
  &amp;lt;action name="fail_email"&amp;gt;
  &amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
  &amp;lt;to&amp;gt;${emailTo}&amp;lt;/to&amp;gt;
  &amp;lt;cc&amp;gt;${emailCC}&amp;lt;/cc&amp;gt;
  &amp;lt;subject&amp;gt;${wf_name}: Failed at ${wf:id()}&amp;lt;/subject&amp;gt;
  &amp;lt;body&amp;gt;The workflow [${wf:id()}] failed at [${wf:lastErrorNode()}] with the following message: ${wf:errorMessage(wf:lastErrorNode())}&amp;lt;/body&amp;gt;
  &amp;lt;/email&amp;gt;
  &amp;lt;ok to="fail"/&amp;gt;
  &amp;lt;error to="fail"/&amp;gt;
  &amp;lt;/action&amp;gt;
  &amp;lt;kill name="fail"&amp;gt;
  &amp;lt;message&amp;gt;Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]&amp;lt;/message&amp;gt;
  &amp;lt;/kill&amp;gt;
  &amp;lt;end name="end"/&amp;gt;
&amp;lt;/workflow-app&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 20:26:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172112#M37475</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-08-11T20:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172113#M37476</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/12021/shariyarmurtaza.html" nodeid="12021"&gt;@Shary M&lt;/A&gt; for providing the workflow. Looks like the arguments which we have passed might not be passed to the java application . The way we need to specify the argument in the application as args[0] .. args[n], where arg[0] is the argument passed first in the oozie workflow. In the above one, &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;arg[0] --&amp;gt; -logtype and &lt;/LI&gt;&lt;LI&gt;arg[1] --&amp;gt; adraw&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can refer the following examples.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Sample workflow: &lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/apps/spark/workflow.xml"&gt;https://github.com/apache/oozie/blob/master/examples/src/main/apps/spark/workflow.xml&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Sample java application : &lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java"&gt;https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://github.com/apache/oozie/blob/master/examples/src/main/java/org/apache/oozie/example/SparkFileCopy.java"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let us know if you need more information. If it failing again, please share the snippet of your application also. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 20:54:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172113#M37476</guid>
      <dc:creator>mramasami</dc:creator>
      <dc:date>2016-08-11T20:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172114#M37477</link>
      <description>&lt;P&gt;No arguments are passed correctly. This is how my application is accepting it as I am using &lt;/P&gt;&lt;P&gt;
&lt;/P&gt;&lt;P&gt;org.apache.commons.cli.BasicParser. I verified it multiple times by printing them inside the application. There is nothing wrong there. Thanks for you help.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 21:05:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172114#M37477</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-08-11T21:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Spark application fails on slaves when launching from Oozie on Yarn</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172115#M37478</link>
      <description>&lt;P&gt;Setting SPARK_HOME in hadoopn-env.sh solved the issue.&lt;/P&gt;&lt;P&gt;For others who have the same issue. Just add the following line in this file:  /usr/hdp/your_version_number/hadoop/conf &lt;/P&gt;&lt;P&gt;export
SPARK_HOME=/usr/hdp/current/spark-client&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 01:16:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-application-fails-on-slaves-when-launching-from-Oozie/m-p/172115#M37478</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-08-13T01:16:37Z</dc:date>
    </item>
  </channel>
</rss>

