Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hive action failing in oozie (on cloudera CDH 4.1.1)

When I run a hive script with from oozie od CDH 4.1.1

The run fails with:

Error Code  JA018
Error Message   org/apache/hadoop/hive/cli/CliDriver

Details
Property    Value
External Id job_201211281608_0112
External Status FAILED/KILLED
Data    None
Start time   Sat, 01 Dec 2012 03:02:37
End time     Sat, 01 Dec 2012 03:03:07
Id  0000007-121128160850795-oozie-oozi-W@ExchangeRateTest
Retries 0
TrackerUri  overlord-datanode1:8021
Transition  kill

Googling JA018 reveals only one cryptic hint: JA018 is output directory exists error in workflow map-reduce action.

I copied my hiv-site.xml to HDFS and set in the workflow.xml: oozie.hive.defaults /user/hue/oozie/workspaces/overlord-oozie-1/hive-site.xml

Here is the complete workflow.xml:

<workflow-app name="HiveTest" xmlns="uri:oozie:workflow:0.4">
    <start to="ExchangeRateTest"/>
    <action name="ExchangeRateTest">
        <hive xmlns="uri:oozie:hive-action:0.2">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <prepare>
                <delete path="${nameNode}${jobOutput}"/>
            </prepare>
            <configuration>
                <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>
                <property>
                    <name>oozie.hive.defaults</name>
                    <value>/user/hue/oozie/workspaces/_overlord_-oozie-1/hive-site.xml</value>
                </property>
            </configuration>
            <script>/user/hue/oozie/workspaces/_overlord_-oozie-1/03_update_exchange_rates_final.hive</script>
              <param>OUTPUT=${jobOutput}</param>
        </hive>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

How can get this to work?

like image 599
Cilvic Avatar asked Nov 04 '22 09:11

Cilvic


1 Answers

The class org/apache/hadoop/hive/cli/CliDriver is required for execution of a Hive Action. This much is obvious from the error message. This class is within this jar file: hive-cli-0.7.1-cdh3u5.jar. (In my case cdh3u5 in my cloudera version).

Oozie checks for this jar in the ShareLib directory. The location of this directory is usually configured in hive-site.xml, with the property name as oozie.service.WorkflowAppService.system.libpath, so Oozie should find the jar easily.

But in my case, hive-site.xml did not include this property, so Oozie didn't know where to look for this jar, hence the java.lang.NoClassDefFoundError.

To resolve this, I had to include a parameter in my job.properties file to point oozie to the location of the ShareLib directory, as follows: oozie.libpath=${nameNode}/user/oozie/share/lib. (depends on where SharedLib directory is configured on your cluster).

like image 81
Chaos Avatar answered Nov 08 '22 08:11

Chaos