hadoop单机映射
How to set the number of mappers and reducers of Hadoop in command line?
Number of mappers and reducers can be set like (5 mappers, 2 reducers):
可以设置映射器和缩减器的数量,例如(5个映射器,2个缩减器):
-D mapred.map.tasks=5 -D mapred.reduce.tasks=2
in the command line.
在命令行中。
In the code, one can configure JobConf variables.
在代码中,可以配置JobConf变量。
job.setNumMapTasks(5); // 5 mappers
job.setNumReduceTasks(2); // 2 reducers
Note that on Hadoop 2 (YARN), the mapred.map.tasks and mapred.reduce.tasks are deprecated and are replaced by other variables:
请注意,在Hadoop 2(YARN)上,已弃用 mapred.map.tasks和mapred.reduce.tasks并由其他变量替换:
mapred.map.tasks -->mapreduce.job.maps
mapred.reduce.tasks --> mapreduce.job.reduces
Using map reduce.job.maps on command line does not work. Is there a particular syntax to use?
在命令行上使用地图reduce.job.maps不起作用。 有没有要使用的特定语法?
You can add the options to the command like
您可以将选项添加到命令中,例如
bin/hadoop jar -Dmapreduce.job.maps=5 yourapp.jar ...
hadoop单机映射
本文详细介绍了如何在Hadoop命令行中设置映射器和缩减器的数量,包括在不同版本的Hadoop中(如Hadoop1和Hadoop2)的设置方法。此外,还提供了在代码中通过JobConf配置这些参数的具体示例。

1万+

被折叠的 条评论
为什么被折叠?



