<?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: Oozie spark action giving key not found SPARK_HOME error in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125494#M22734</link>
    <description>&lt;P&gt;oozie spark action is not supported in HDP 2.4 and earlier. We have it stated in release notes and Spark user guide.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2016 18:29:59 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2016-03-14T18:29:59Z</dc:date>
    <item>
      <title>Oozie spark action giving key not found SPARK_HOME error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125492#M22732</link>
      <description>&lt;P&gt;I recently tried spark action with Oozie and end up getting the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2753-oozieerror.png" style="width: 562px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/22674i59D2C5D32AF5929E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2753-oozieerror.png" alt="2753-oozieerror.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My job.properties file:&lt;/P&gt;&lt;P&gt;==============================================================&lt;/P&gt;&lt;P&gt;jobTracker=qxnn:8032 &lt;/P&gt;&lt;P&gt;master=local[2] &lt;/P&gt;&lt;P&gt;queueName=default &lt;/P&gt;&lt;P&gt;examplesRoot=spark-oozie &lt;/P&gt;&lt;P&gt;oozie.use.system.libpath=true &lt;/P&gt;&lt;P&gt;oozie.libpath=/user/oozie/share/lib &lt;/P&gt;&lt;P&gt;oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot} 
&lt;/P&gt;&lt;P&gt;workflow.xml:&lt;/P&gt;&lt;P&gt;================================================================&lt;/P&gt;&lt;P&gt;&amp;lt;workflow-app name="sparkJob" xmlns="uri:oozie:workflow:0.1"&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;start to="spark-node"/&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;action name="spark-node"&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&amp;lt;spark xmlns="uri:oozie:spark-action:0.1"&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;configuration&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;&amp;lt;property&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 100px;"&gt;&amp;lt;name&amp;gt;mapred.compress.map.output&amp;lt;/name&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 100px;"&gt;&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;&amp;lt;/property&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;/configuration&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;master&amp;gt;yarn&amp;lt;/master&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;mode&amp;gt;cluster&amp;lt;/mode&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;name&amp;gt;Spark Example&amp;lt;/name&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;jar&amp;gt;/user/yesuser3/spark-oozie/hive2.py&amp;lt;/jar&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;&amp;lt;spark-opts&amp;gt;--executor-memory 200M --num-executors 5&amp;lt;/spark-opts&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&amp;lt;/spark&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&amp;lt;ok to="end"/&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&amp;lt;error to="spark-fail"/&amp;gt;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;/action&amp;gt;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;kill name="spark-fail"&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&amp;lt;message&amp;gt;Spark action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]&amp;lt;/message&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;/kill&amp;gt; &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&amp;lt;end name="end"/&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;/workflow-app&amp;gt;
&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SureshKumar&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 10:08:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125492#M22732</guid>
      <dc:creator>msk88_in</dc:creator>
      <dc:date>2019-08-19T10:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie spark action giving key not found SPARK_HOME error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125493#M22733</link>
      <description>&lt;P&gt;Can you please share your HDP version? Also it looks like this issue is similar to oozie bug &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;</description>
      <pubDate>Mon, 14 Mar 2016 13:22:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125493#M22733</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-03-14T13:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie spark action giving key not found SPARK_HOME error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125494#M22734</link>
      <description>&lt;P&gt;oozie spark action is not supported in HDP 2.4 and earlier. We have it stated in release notes and Spark user guide.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 18:29:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125494#M22734</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-14T18:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie spark action giving key not found SPARK_HOME error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125495#M22735</link>
      <description>&lt;P&gt;
	As 
	&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; mentioned, Oozie Spark Action is not yet supported.  Instead you can follow the alternative from the tech note below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/content/kbentry/51582/how-to-use-oozie-shell-action-to-run-a-spark-job-i-1.html" target="_blank"&gt;https://community.hortonworks.com/content/kbentry/51582/how-to-use-oozie-shell-action-to-run-a-spark-job-i-1.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;
	--------------------&lt;/P&gt;&lt;P&gt;
	Begin Tech Note&lt;/P&gt;&lt;P&gt;
	--------------------&lt;/P&gt;&lt;P&gt;	Because spark action in oozie is not supported in HDP 2.3.x and HDP 2.4.0, there is no workaround especially in kerberos environment. We can use either java action or shell action to launch spark job in oozie workflow. In this article, we will discuss how to use oozie shell action to run a spark job in kerberos environment.&lt;/P&gt;&lt;P&gt;	&lt;STRONG&gt;Prerequisite: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;
	&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;	1. Spark client is installed on every host where nodemanager is running.  This is because we have no control over which node the&lt;/P&gt;&lt;P&gt;		2. Optionally, if the spark job need to interact with hbase cluster, hbase client need to be installed on every host as well.&lt;/P&gt;&lt;P&gt;		&lt;STRONG&gt;Steps:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;		1. Create a shell script with the spark-submit command. For example, in the script.sh:&lt;/P&gt;&lt;P&gt;
	/usr/hdp/current/spark-client/bin/spark-submit --keytab keytab --principal 
	&lt;A href="mailto:ambari-qa-falconJ@FALCONJSECURE.COM"&gt;ambari-qa-falconJ@FALCONJSECURE.COM&lt;/A&gt; --class org.apache.spark.examples.SparkPi --master yarn-client --driver-memory 500m --num-executors 1 --executor-memory 500m --executor-cores 1 spark-examples.jar 3&lt;/P&gt;&lt;P&gt;		2. Prepare kerberos keytab which will be used by the spark job. For example, we use ambari smoke test user, the keytab is already generated by Ambari in/etc/security/keytabs/smokeuser.headless.keytab.&lt;/P&gt;&lt;P&gt;		3. Create the oozie workflow with a shell action which will execute the script created above, for example, in the workflow.xml:
	&lt;/P&gt;
&lt;PRE&gt;&amp;lt;workflow-app name="WorkFlowForShellAction" xmlns="uri:oozie:workflow:0.4"&amp;gt;
  &amp;lt;start to="shellAction"/&amp;gt;
    &amp;lt;action name="shellAction"&amp;gt;
      &amp;lt;shell xmlns="uri:oozie:shell-action:0.2"&amp;gt;
        &amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
        &amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
        &amp;lt;exec&amp;gt;script.sh&amp;lt;/exec&amp;gt;
        &amp;lt;file&amp;gt;/user/oozie/shell/script.sh#script.sh&amp;lt;/file&amp;gt;
        &amp;lt;file&amp;gt;/user/oozie/shell/smokeuser.headless.keytab#keytab&amp;lt;/file&amp;gt;
        &amp;lt;file&amp;gt;/user/oozie/shell/spark-examples.jar#spark-examples.jar&amp;lt;/file&amp;gt;
        &amp;lt;capture-output/&amp;gt;
      &amp;lt;/shell&amp;gt;
      &amp;lt;ok to="end"/&amp;gt;
      &amp;lt;error to="killAction"/&amp;gt;
  &amp;lt;/action&amp;gt;
  &amp;lt;kill name="killAction"&amp;gt;
    &amp;lt;message&amp;gt;"Killed job due to error"&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;&lt;P&gt;		4. Create the oozie job properties file. For example, in job.properties:&lt;/P&gt;&lt;P&gt;
	nameNode=hdfs://falconJ1.sec.support.com:8020&lt;/P&gt;&lt;P&gt;
	jobTracker=falconJ2.sec.support.com:8050&lt;/P&gt;&lt;P&gt;
	queueName=default&lt;/P&gt;&lt;P&gt;
	oozie.wf.application.path=${nameNode}/user/oozie/shell&lt;/P&gt;&lt;P&gt;
	oozie.use.system.libpath=true&lt;/P&gt;&lt;P&gt;		5. Upload the following files created above to the oozie workflow application path in HDFS (In this example: /user/oozie/shell):&lt;/P&gt;&lt;P&gt;
	- workflow.xml&lt;/P&gt;&lt;P&gt;
	- smokeuser.headless.keytab&lt;/P&gt;&lt;P&gt;
	- script.sh&lt;/P&gt;&lt;P&gt;
	- spark uber jar (In this example: /usr/hdp/current/spark-client/lib/spark-examples*.jar)&lt;/P&gt;&lt;P&gt;
	- Any other configuration file mentioned in workflow (optional)&lt;/P&gt;&lt;P&gt;		6. Execute the oozie command to run this workflow. For example:&lt;/P&gt;&lt;P&gt;
	oozie job -oozie 
	&lt;A href="http://%3coozie-server%3e:11000/oozie"&gt;http://&amp;lt;oozie-server&amp;gt;:11000/oozie&lt;/A&gt; -config job.properties -run&lt;/P&gt;&lt;P&gt;		--------------------&lt;/P&gt;&lt;P&gt;
	End Tech Note&lt;/P&gt;&lt;P&gt;
	--------------------&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 06:54:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-spark-action-giving-key-not-found-SPARK-HOME-error/m-p/125495#M22735</guid>
      <dc:creator>egarelnabi</dc:creator>
      <dc:date>2016-07-20T06:54:05Z</dc:date>
    </item>
  </channel>
</rss>

