Configuring the MapReduce Mode on the Command Line

You can set the MapReduce mode in the command line to override the MapReduce mode set in an environment variable, and the default mode of the client node and the cluster. Using this method, you can run MapReduce v1 and MapReduce v2 jobs one after the other from the same shell.

Use one of the following methods to specify the MapReduce mode when you run a MapReduce job or application from the command line:
MapReduce Version Methods
MapReduce v1
  • hadoop1 jar <jar file> [<arguments>]
  • hadoop -classic jar <jar file> [<arguments>]
  • hadoop1 job –submit <job file>
  • hadoop -classic job –submit <job file>
MapReduce v2
  • hadoop2 jar <jar file> [<arguments>]
  • hadoop -yarn jar <jar file> [<arguments>]
  • hadoop2 job –submit <job file>
  • hadoop -yarn job –submit <job file>
  • mapred job –submit <job file>
  • yarn jar <jar file> [<arguments>]
Use the MapReduce mode set by the MAPR_MAPREDUCE_MODE environment variable. If the MAPR_MAPREDUCE_MODE is not set, use the default_mode value in the hadoop_version file on the current node.
  • hadoop jar <jar file> [<arguments>]
  • hadoop job –submit <job file>