1

除了 map 函数输出的所有键相同之外,什么会导致 MapReduce 作业中只有一个 reducer?

4

1 回答 1

2

可能的原因:

  1. 您的集群仍然具有只有 1 个减速器的默认设置(= 默认值)。
  2. 您的代码将值明确设置为 1 reducer。
  3. 您正在本地模式下运行(即根本没有集群)。

引用自mapred-default.xml

<property>
  <name>mapred.reduce.tasks</name>
  <value>1</value>
  <description>The default number of reduce tasks per job. Typically set to 99%
  of the cluster's reduce capacity, so that if a node fails the reduces can 
  still be executed in a single wave.
  Ignored when mapred.job.tracker is "local".
  </description>
</property>
于 2011-03-30T12:21:09.850 回答