Configuring the MapReduce Mode with an Environment Variable

You can set the MapReduce mode with an environment variable on a client or cluster node. The MapReduce mode set in the environment variable overrides the default_mode set on the client node and the cluster.

Using this method, you can open multiple terminals and set each shell to use a different mode. Therefore, you can run both MapReduce v1 and MapReduce v2 jobs from the same client machine at the same time.

To set the MapReduce mode with an Environment Variable:

  1. Open terminal on the client node.
  2. Enter one of the following commands on the shell:
    • export MAPR_MAPREDUCE_MODE=yarn
    • export MAPR_MAPREDUCE_MODE=classic
    • Note: Setting the MapReduce mode on the shell configures all hadoop commands that are run on this shell to operate using the hadoop version associated with the mode that you selected. For example, if you set the MapReduce mode to yarn, when you run hadoop classpath the classpath associated with hadoop 2.x displays.