How to: Use the Oozie Shell and Java Actions
Blog Post: http://blog.cloudera.com/blog/2013/03/how-to-use-oozie-shell-and-java-actions
Building the Java Code
The Java code used in the Java action is located in the Earthquake-J folder and is a standard maven project.
- cd to Earthquake-J
- Run
mvn clean package
to generatetarget/Earthquake-J-1.0-SNAPSHOT.jar
Preparing the Workflow
The Oozie Workflow is located in the Earthquake-WF folder.
- After building it, copy the Earthquake-J-1.0-SNAPSHOT.jar file to the
Earthquake-WF/lib/
folder (this allows the WF to find the JAR) - Upload the Earthquake-WF folder somewhere in HDFS (e.g.
/user/${user.name}/Earthquake-WF
) - Open job.properties and adjust the various properties as necessary; these four in particular:
oozie.wf.application.path
should point to where you uploaded Earthquake-WFdataInputDir
should point to where you want the data downloaded tooutputDir
should point to where you want the processed output dataearthquakeMinThreshold
the minimum earthquake magnitude to use
Running the Workflow
You can now create a Coordinator job to run the workflow every hour. If you'd like to test it out by running the Workflow directly you can follow these instructions (from the Earthquake folder):
- Run
hadoop fs -put Earthquake-WF Earthquake-WF
- Run
oozie job -config Earthquake-WF/job.properties -run -oozie http://some.hostname:11000/oozie