最近在伪分布式模式下安装了hadoop 2.7.1,在8核,28GB内存虚拟机上运行Yarn,ubuntu 14.04 LTS。
我们的文件通常为20-40GB,因此试图找到单个VM的最佳配置。 我们在mapred-site.xml(下面)中设置了配置,以允许运行多个映射器和缩减器(使用slowstart = 1来顺序运行它们)。 我看到多个映射器,但只有1个reducer 。
我们之前的hadoop(2.2.0)群集在2-4个节点上,因此下面有很多配置来自该设置。
mapred-site.xml中:
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.task.io.sort.factor</name>
<value>48</value>
</property>
<property>
<name>mapreduce.task.io.sort.mb</name>
<value>512</value>
</property>
<property>
<name>mapred.child.java.opts</name>
<value>-Xmx4096m</value>
</property>
<property>
<name>mapreduce.map.memory.mb</name>
<value>3072</value>
<description>upper memory limit (MB) that Hadoop allows allocated to a mapper</description>
</property>
<property>
<name>mapreduce.map.java.opts</name>
<value>-Xmx2048m</value>
<description>maximum JVM heap size for map tasks</description>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>5120</value>
<description>upper memory limit (MB) that Hadoop allows allocated to a reducer</description>
</property>
<property>
<name>mapreduce.reduce.java.opts</name>
<value>-Xmx4096m</value>
<description>maximum JVM heap size for reduce tasks</description>
</property>
<property>
<name>mapreduce.tasktracker.map.tasks.maximum</name>
<value>8</value>
<description>maximum MAP tasks that can be run in parallel on this node </description>
</property>
<property>
<name>mapreduce.tasktracker.reduce.tasks.maximum</name>
<value>4</value>
<description>maximum REDUCE tasks that can be run in parallel on this node </description>
</property>
<property>
<name>mapred.reduce.slowstart.completed.maps</name>
<value>1</value>
<description>Fraction of the number of maps in the job which should be complete before reduces are scheduled for the job.</description>
</property>
核心-site.xml中:
<property>
<name>hadoop.tmp.dir</name>
<value>/mnt/drive1/cluster/hadoop/tmp</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
HDFS-site.xml中
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/mnt/drive1/cluster/hadoop/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/mnt/drive1/cluster/hadoop/hdfs/datanode</value>
</property>
纱-site.xml中:
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>24576</value>
</property>
<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>
<property>
<name>yarn.nodemanager.pmem-check-enabled</name>
<value>false</value>
</property>
答案 0 :(得分:2)
mapreduce.job.reduces默认为1.
描述:每个作业的默认减少任务数。
您可以通过在mapred-site.xml中设置该属性来覆盖每个作业的值,也可以在群集范围内覆盖该值。