Created
October 20, 2015 10:26
-
-
Save venkateshshukla/de0dc395797a7ffba153 to your computer and use it in GitHub Desktop.
oozie sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oozie.coord.application.path=hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<coordinator-app | |
name="basic" | |
frequency="5" | |
start="2015-10-19T00:00Z" | |
end="2015-10-20T00:00Z" | |
timezone="UTC" | |
xmlns="uri:oozie:coordinator:0.1"> | |
<controls> | |
<timeout>1</timeout> | |
<concurrency>5</concurrency> | |
<execution>FIFO</execution> | |
</controls> | |
<datasets> | |
<include>hdfs://quickstart.cloudera:8020/user/cloudera/oozie/datasets.xml</include> | |
<dataset | |
name="in" | |
frequency="1" | |
initial-instance="2015-10-19T00:00Z" | |
timezone="UTC"> | |
<uri-template>hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic/in/${YEAR}/${MONTH}/${DAY}/${HOUR}/${MINUTE}</uri-template> | |
</dataset> | |
<dataset | |
name="out" | |
frequency="1" | |
initial-instance="2015-10-19T00:00Z" | |
timezone="UTC"> | |
<uri-template>hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic/out/${YEAR}/${MONTH}/${DAY}/${HOUR}/${MINUTE}</uri-template> | |
</dataset> | |
</datasets> | |
<input-events> | |
<data-in name="input_present" dataset="in"> | |
<instance>${coord:current(0)}</instance> | |
</data-in> | |
<data-in name="input_past" dataset="in"> | |
<start-instance>${coord:current(-4)}</start-instance> | |
<end-instance>${coord:current(-1)}</end-instance> | |
</data-in> | |
</input-events> | |
<output-events> | |
<data-out name="output_present" dataset="out"> | |
<instance>${coord:current(0)}</instance> | |
</data-out> | |
</output-events> | |
<action> | |
<workflow> | |
<app-path>hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic</app-path> | |
</workflow> | |
</action> | |
</coordinator-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dirname="dir_$(date +%Y%m%d_%H.%M.%S)" | |
basedir='hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic/task' | |
dirpath="${basedir}/${dirname}" | |
hadoop fs -mkdir $dirpath | |
if [ $? == 0 ] ; then | |
echo "Made directory $dirname" | |
exit 0 | |
else | |
echo "Task failed" | |
exit -1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<workflow-app xmlns="uri:oozie:workflow:0.2" name="basic-wf"> | |
<start to="shellAction"/> | |
<action name="shellAction"> | |
<shell xmlns="uri:oozie:shell-action:0.1"> | |
<job-tracker>localhost:8032</job-tracker> | |
<name-node>hdfs://quickstart.cloudera:8020</name-node> | |
<exec>touch.sh</exec> | |
<file>hdfs://quickstart.cloudera:8020/user/cloudera/oozie/basic/touch.sh</file> | |
</shell> | |
<ok to="end"/> | |
<error to="fail"/> | |
</action> | |
<kill name="fail"> | |
<message>Workflow 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