笔记:Hadoop权威指南 第5章 MapReduce 应用程序开发


一、代码结构

新接口的代码结构:


启动作业的命令:

hadoop jar   myjob.jar   com.test.MaxTemperature  -conf   conf/tempConf,xml      in/ncdn/1990   out/ncnd/1990


获取输出命令:

hadoop fs -getmerge  outDir     localFile

cat  localFile


二、Job、Task、TastAttempt 命名规范 

job_201412110823_002  :  job_运行时间_第几个JOb

task_201412110823_002_m_000003 / task_201412110823_002_r_000003:   task_JobId_map还是reduce_第几个task

attemp_201412110823_002_m_000003_0 : attempt_taskId_第几次尝试


三、作业状态

Pending、Running、Completed、Killed


四、作业调优

1、Mapper 数量:

2、Reducer数量:

3、使用Combiner

4、Mapper 的输出压缩:

5、自定义Writable 或Comparator 要实现 RawComparator

6、调整Shuffle



五、MapReduce 工作流

使用ChainMapper、ChainReducer






原文地址:https://www.cnblogs.com/leeeee/p/7276213.html