Executing MapReduce job using oozie workflow in hue giving wrong output

青春壹個敷衍的年華 提交于 2019-12-13 02:50:56

问题


I'm trying to execute MapReduce job using oozie workflow in hue. When I submit the job, oozie successfully executes but I don't get the expected output. It seems that either mapper or reducer never invoked.here is my workflow.xml:

<workflow-app name="wordCount" xmlns="uri:oozie:workflow:0.4">
    <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>/user/root/jane/inputPath</value>
                </property>
                <property>
                    <name>mapred.output.dir</name>
                    <value>/user/root/jane/outputPath17</value>
                </property>
                <property>
                    <name>mapred.mapper.class</name>
                    <value>MapReduceGenerateReports.Map</value>
                </property>
                <property>
                    <name>mapred.reducer.class</name>
                    <value>MapReduceGenerateReports.Reduce</value>
                </property>
                <property>
                    <name>mapred.mapper.new-api</name>
                    <value>true</value>
                </property>
                <property>
                    <name>mapred.reducer.new-api</name>
                    <value>true</value>
                </property>
            </configuration>
        </map-reduce>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

Can anyone please tell what is the problem?

my new workflow.xml :

<workflow-app name="wordCount" xmlns="uri:oozie:workflow:0.4">
    <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>/user/root/jane/inputPath</value>
                </property>
                <property>
                    <name>mapred.output.dir</name>
                    <value>/user/root/jane/outputPath3</value>
                </property>
                <property>
                    <name>mapred.mapper.new-api</name>
                    <value>true</value>
                </property>
                <property>
                    <name>mapred.reducer.new-api</name>
                    <value>true</value>
                </property>
                <property>
                    <name>mapreduce.map.class</name>
                    <value>MapReduceGenerateReports$Map</value>
                </property>
                <property>
                    <name>mapreduce.reduce.class</name>
                    <value>MapReduceGenerateReports$Reduce</value>
                </property>
                <property>
                    <name> mapred.output.key.class</name>
                    <value>org.apache.hadoop.io.LongWritable</value>
                </property>
                <property>
                    <name>mapred.output.value.class</name>
                    <value>org.apache.hadoop.io.Text</value>
                </property>
            </configuration>
        </map-reduce>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

jobtracker log:

1)

Kind    % Complete  Num Tasks   Pending Running Complete    Killed  Failed/Killed
Task Attempts
map 100.00%
1   0   0   1   0   0 / 0
reduce  100.00%
0   0   0   0   0   0 / 0

2)

   Kind Total Tasks(successful+failed+killed)   Successful tasks    Failed tasks    Killed tasks    Start Time  Finish Time
    Setup    1   1   0   0  5-Apr-2014 18:36:22 5-Apr-2014 18:36:23 (1sec)
    Map  1   1   0   0  5-Apr-2014 18:33:27 5-Apr-2014 18:33:33 (5sec)
    Reduce   0   0   0   0      
    Cleanup  1   1   0   0  5-Apr-2014 18:33:33 5-Apr-2014 18:33:37 (4sec)

回答1:


Check out the instructions for using the new API here

However, if you really need to run MapReduce jobs written using the 20 API in Oozie, below are the changes you need to make in workflow.xml.

  1. change mapred.mapper.class to mapreduce.map.class
  2. change mapred.reducer.class to mapreduce.reduce.class
  3. add mapred.output.key.class
  4. add mapred.output.value.class
  5. and, include the following property into MR action configuration


来源:https://stackoverflow.com/questions/22863419/executing-mapreduce-job-using-oozie-workflow-in-hue-giving-wrong-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!