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.

Oozie fails for Hive action Workflow

Oozie fails for Hive action Workflow

New Contributor

I am using quick start 5.13 and facing an issue:

2018-08-02 04:11:59,913  WARN HiveActionExecutor:523 - SERVER[quickstart.cloudera] USER[cloudera] GROUP[-] TOKEN[] APP[simple-Workflow] JOB[0000013-180729084125327-oozie-oozi-W] ACTION[0000013-180729084125327-oozie-oozi-W@Create_External_Table] Launcher exception: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found
java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found
	at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2279)
	at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:233)
	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
	at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:459)
	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:1917)
	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found
	at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2185)
	at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2277)
	... 9 more

My workflow.xml
<!-- This is a comment -->
<workflow-app xmlns = "uri:oozie:workflow:0.4" name = "simple-Workflow">
   <start to = "Create_External_Table" />

   <!-- Step 1 -->
   
   <action name = "Create_External_Table">
      <hive xmlns = "uri:oozie:hive-action:0.4">
         <job-tracker>http://quickstart.cloudera</job-tracker>
         <name-node>hdfs://quickstart.cloudera:8020</name-node>
 <job-xml>hive-site.xml</job-xml>
    <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>default</value>
                </property>
                <property>
                    <name>oozie.hive.defaults</name>
                    <value>/user/cloudera/oozie/hive-site.xml</value>
                </property>
        <property>
                    <name>oozie.libpath</name>
                    <value>oozie.libpath=hdfs://quickstart.cloudera:8020/user/oozie/share/lib</value>
                </property>
        <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>        
            </configuration>

     <!-- Above can be found these ports from core-site.xml and mapred-site.xml -->
         <script>/user/cloudera/externaltable.hql</script>
      </hive>
        
      <ok to = "Create_Final_Table" />
      <error to = "kill_job" />
   </action>

   <!-- Step 2 -->
   
   <action name = "Create_Final_Table">
      <hive xmlns = "uri:oozie:hive-action:0.4">
         <job-tracker>http://quickstart.cloudera</job-tracker>
         <name-node>hdfs://quickstart.cloudera:8020</name-node>
 <job-xml>hive-site.xml</job-xml>
     <!-- Above can be found from core-site.xml and mapred-site.xml -->
    <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>default</value>
                </property>
                <property>
                    <name>oozie.hive.defaults</name>
                    <value>/user/cloudera/oozie/hive-site.xml</value>
                </property>
        <property>
                    <name>oozie.libpath</name>
                    <value>oozie.libpath=hdfs://quickstart.cloudera:8020/user/oozie/share/lib</value>
                </property>        
        <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>        
            </configuration>
         <script>/user/cloudera/finaltable.hql</script>
      </hive>
        
      <ok to = "Insert_into_Table" />
      <error to = "kill_job" />
   </action>

   <!-- Step 3 -->
      
   <action name = "Insert_into_Table">
      <hive xmlns = "uri:oozie:hive-action:0.4">
        <job-tracker>http://quickstart.cloudera</job-tracker>
         <name-node>hdfs://quickstart.cloudera:8020</name-node>
 <job-xml>hive-site.xml</job-xml>
     <!-- Above can be found from core-site.xml and mapred-site.xml -->
    <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>default</value>
                </property>
                <property>
                    <name>oozie.hive.defaults</name>
                    <value>/user/cloudera/oozie/hive-site.xml</value>
                </property>
        <property>
                    <name>oozie.libpath</name>
                    <value>oozie.libpath=hdfs://quickstart.cloudera:8020/user/oozie/share/lib</value>
                </property>
        <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>        
            </configuration>

         <script>/user/cloudera/insertdata.hql</script>
         <param>mydb</param>  <!-- Your DB name -->
      </hive>
        
      <ok to = "end" />
      <error to = "kill_job" />
   </action>
   
   <kill name = "kill_job">
      <message>Job failed</message>
   </kill>
    
   <end name = "end" />

</workflow-app>


Hive script are correct and are on hdfs ...

> oozie job --oozie http://quickstart.cloudera:11000/oozie -D oozie.wf.application.path=hdfs://quickstart.cloudera:8020/user/cloudera/workflow.xml -run

Workflow is getting killed with error in log file shown above ..