0 votes
in Hadoop by
How can you set the mappers and reducers for a MapReduce job?

1 Answer

0 votes
by
The number of mappers and reducers can be set in the command line using:

-D mapred.map.tasks=5 –D mapred.reduce.tasks=2

In the code, one can configure JobConf variables:

job.setNumMapTasks(5); // 5 mappers

job.setNumReduceTasks(2); // 2 reducers
...