设置reduce数量的以下3个选项的优先级是什么?换句话说,如果三个都设置了,会考虑哪一个?
选项 1:
setNumReduceTasks(2) within the application code
选项 2:
-D mapreduce.job.reduces=2 as command line argument
选项 3:
through $HADOOP_CONF_DIR/mapred-site.xml file
<property>
<name>mapreduce.job.reduces</name>
<value>2</value>
</property>
最佳答案
根据Hadoop - 权威指南
The -D option is used to set the configuration property with key color to the value yellow. Options specified with -D take priority over properties from the configuration files. This is very useful because you can put defaults into configuration files and then override them with the -D option as needed. A common example of this is setting the number of reducers for a MapReduce job via -D mapred.reduce.tasks=n. This will override the number of reducers set on the cluster or set in any client-side configuration files.
关于Hadoop reducer 数量配置选项优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20696449/