• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Hadoop by
Q:
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

Related questions

0 votes
asked Nov 8, 2020 in Hadoop by rahuljain1
0 votes
asked Jan 26, 2020 in Big Data | Hadoop by rajeshsharma
...