Specifying Driver Program for Map-Reduce Job in Oozie

298 views Asked by At
<workflow-app xmlns='uri:oozie:workflow:0.1' name='map-reduce-wf'>
    <start to='wordcount'/>

    <action name='wordcount'>
        <map-reduce>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <configuration>
                 <property>
                    <name>mapred.input.dir</name>
                    <value>${inputDir}</value>
                </property>
                <property>
                    <name>mapred.output.dir</name>
                    <value>${outputDir}</value>
                </property>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
                <property>
                    <name>mapred.reduce.tasks</name>
                    <value>${numberofReducers}</value>
                </property>
                <property>
                    <name>mapred.reducer.new-api</name>
                    <value>true</value>
                </property>
                <property>
                    <name>mapred.mapper.new-api</name>
                    <value>true</value>
                </property>
            </configuration>
        </map-reduce>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Map/Reduce failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name='end'/>
</workflow-app>

I am trying to run a map-reduce job using Oozie. Can anybody tell me how can I specify the Driver program in workflow.xml? {How will Oozie know which Mapper and Reducer to run?}

Can this be done without specifying properties like:

<property>
    <name>mapred.mapper.class</name>
    <value></value>
</property>
<property>
    <name>mapred.reducer.class</name>
    <value>org.myorg.WordCount.Reduce</value>
</property>
1

There are 1 answers

0
brandon.bell On

Oozie needs to be told which mapper/reducer to run, otherwise what is the purpose? If you would prefer not including it in the actual workflow, you could submit it in an xml file via the 'job-xml' configuration. See the following :

http://oozie.apache.org/docs/4.0.0/WorkflowFunctionalSpec.html#a4.1_Workflow_Job_Properties_or_Parameters http://oozie.apache.org/docs/4.0.0/WorkflowFunctionalSpec.html#a3.2.2_Map-Reduce_Action

Take note that later values override previous values. Meaning, if you have mapred.reducer.class configured twice, the last entry will be the one that ends up being used.