Related Run command
Run an app: Bin/oozie Job-oozie http://hadoop-1:11000/oozie-config examples/apps/map-reduce/ Job.properties-run Kill a jobbin/oozie job-oozie http://Hadoop-1:11000/oozie -kill 0000001-160702224410648-oozie-beif-w View Job log information bin/oozie Job-oozie http://hadoop-1 : 11000/oozie-log 0000001-160702224410648-oozie-beif-w View job Information bin/oozie Job-oozie http:// hadoop-1:11000/oozie-info 0000001-160702224410648-oozie-beif-w
1. Define Job.properties
Namenode=hdfs://hadoop-1:9000jobtracker=hadoop-1:8032queuename= defaultexamplesroot=mr-wordcountoozie.wf.application.path=${namenode}/user/${user.name}/${ examplesroot}/Workflow.xmloutputdir=output-data
2. Define Workflow.xml
<Workflow-appxmlns= "uri:oozie:workflow:0.2"name= "MAP-REDUCE-WF"> <Start to= "Mr-node"/> <Actionname= "Mr-node"> <Map-reduce> <Job-tracker>${jobtracker}</Job-tracker> <Name-node>${namenode}</Name-node> <Prepare> <DeletePath= "${namenode}/user/${wf:user ()}/${examplesroot}/${outputdir}"/> </Prepare> <Configuration> < Property> <name>Mapred.job.queue.name</name> <value>${queuename}</value> </ Property> <!--new API Flag - < Property> <name>Mapred.mapper.new-api</name> <value>True</value> </ Property> < Property> <name>Mapred.reducer.new-api</name> <value>True</value> </ Property> <!--Map Task - < Property> <name>Mapreduce.job.map.class</name> <value>Org.gh.hadoop.mapreduce.wordcount$wcmapper</value> </ Property> < Property> <name>Mapreduce.map.output.key.class</name> <value>Org.apache.hadoop.io.Text</value> </ Property> < Property> <name>Mapreduce.map.output.value.class</name> <value>Org.apache.hadoop.io.IntWritable</value> </ Property> <!--Reduce Task - < Property> <name>Mapreduce.job.reduce.class</name> <value>Org.gh.hadoop.mapreduce.wordcount$wcreducer</value> </ Property> < Property> <name>Mapreduce.job.output.key.class</name> <value>Org.apache.hadoop.io.Text</value> </ Property> < Property> <name>Mapreduce.job.output.value.class</name> <value>Org.apache.hadoop.io.IntWritable</value> </ Property> < Property> <name>Mapred.map.tasks</name> <value>1</value> </ Property> <!--input Data dir - < Property> <name>Mapred.input.dir</name> <value>/user/${wf:user ()}/${examplesroot}/input-data</value> </ Property> <!--Output Data dir - < Property> <name>Mapred.output.dir</name> <value>/user/${wf:user ()}/${examplesroot}/${outputdir}</value> </ Property> </Configuration> </Map-reduce> <OK to= "End"/> <Error to= "Fail"/> </Action> <Killname= "Fail"> <message>Map/reduce failed, error Message[${wf:errormessage (Wf:lasterrornode ())}]</message> </Kill> <Endname= "End"/></Workflow-app>
Oozie Case-Custom MapReduce workflow