Skip to content

Instantly share code, notes, and snippets.

@tmusabbir
Last active December 25, 2015 18:19
Show Gist options
  • Save tmusabbir/7019540 to your computer and use it in GitHub Desktop.
Save tmusabbir/7019540 to your computer and use it in GitHub Desktop.
Oozie Example: Java Action / MapReduce Jobs
Oozie Example: Java Action / MapReduce Jobs
[ambari-qa@ip-10-0-0-51 ~]$ hadoop fs -lsr /user/ambari-qa/example/java-oozie
drwxrwx--- - ambari-qa hdfs 0 2013-03-03 01:53 /user/ambari-qa/example/java-oozie/lib
-rwxrwx--- 3 ambari-qa hdfs 473690 2013-03-03 01:53 /user/ambari-qa/example/java-oozie/lib/TestMR.jar
-rwxrwx--- 3 ambari-qa hdfs 1700 2013-03-03 01:47 /user/ambari-qa/example/java-oozie/workflow.xml
nameNode=hdfs://ip-10-0-0-52:8020
jobTracker=ip-10-0-0-53:50300
queueName=default
exampleRoot=example
oozie.use.system.libpath=true
oozie.libpath=/user/oozie/share/lib
oozie.wf.application.path=${nameNode}/user/${user.name}/${exampleRoot}/java-oozie
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns='uri:oozie:workflow:0.4' name='java-workflow'>
<start to='java-action' />
<action name="java-action">
<java>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/user/${wf:user()}/${exampleRoot}/output"/>
</prepare>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<main-class>org.apache.example.TestMR</main-class>
<arg>-r</arg>
<arg>6</arg>
</java>
<ok to="end"/>
<error to="java-action-fail"/>
</action>
<kill name="java-action-fail">
<message>Java action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name='end' />
</workflow-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment