Configuring Mappers and Reducers in Hadoop: CLI and Code Approaches
To set the number of mappers and reducers when submitting a Hadoop job, use the -D flag with the appropriate property names. The correct properties depend on your Hadoop version. Hadoop 2.x and Later (YARN) Use the modern property names: hadoop jar -Dmapreduce.job.maps=5 -Dmapreduce.job.reduces=2 yourapp.jar The older mapred.map.tasks and mapred.reduce.tasks properties are deprecated in Hadoop…
