简体   繁体   English

在hue中使用oozie工作流执行MapReduce作业,给出错误的输出

[英]Executing MapReduce job using oozie workflow in hue giving wrong output

I'm trying to execute MapReduce job using oozie workflow in hue. 我正在尝试使用色调中的oozie工作流执行MapReduce作业。 When I submit the job, oozie successfully executes but I don't get the expected output. 当我提交作业时,oozie成功执行但我没有得到预期的输出。 It seems that either mapper or reducer never invoked.here is my workflow.xml: 似乎mapper或reducer都没有调用过。我的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.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: jobtracker日志:

1) 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) 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)

Check out the instructions for using the new API here 在此处查看有关使用新API的说明

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. 但是,如果您确实需要在Oozie中运行使用20 API编写的MapReduce作业,则下面是您需要在workflow.xml中进行的更改。

  1. change mapred.mapper.class to mapreduce.map.class 将mapred.mapper.class更改为mapreduce.map.class
  2. change mapred.reducer.class to mapreduce.reduce.class 将mapred.reducer.class更改为mapreduce.reduce.class
  3. add mapred.output.key.class 添加mapred.output.key.class
  4. add mapred.output.value.class 添加mapred.output.value.class
  5. and, include the following property into MR action configuration 并且,将以下属性包含在MR操作配置中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM