Managing MapReduce and YARN
CDH supports two versions of the MapReduce computation framework: MRv1 and MRv2, which are implemented by the MapReduce (MRv1) and YARN (MRv2) services. YARN is backwards-compatible with MapReduce. (All jobs that run against MapReduce will also run in a YARN cluster).
The MRv2 YARN architecture splits the two primary responsibilities of the JobTracker — resource management and job scheduling/monitoring — into separate daemons: a global ResourceManager (RM) and per-application ApplicationMasters (AM). With MRv2, the ResourceManager (RM) and per-node NodeManagers (NM) form the data-computation framework. The ResourceManager service effectively replaces the functions of the JobTracker, and NodeManagers run on worker hosts instead of TaskTracker daemons. The per-application ApplicationMaster is, in effect, a framework-specific library and negotiates resources from the ResourceManager and works with the NodeManagers to execute and monitor the tasks. For details of this architecture, see Apache Hadoop NextGen MapReduce (YARN).
- The Cloudera Manager Admin Console has different methods for displaying MapReduce and YARN job history. See Monitoring MapReduce Jobs and Monitoring YARN Applications.
- For information on configuring the MapReduce and YARN services for high availability, see MapReduce (MRv1) and YARN (MRv2) High Availability
- For information on configuring MapReduce and YARN resource management features, see Resource Management.
Defaults and Recommendations
- In a Cloudera Manager deployment of a CDH 4 cluster, the MapReduce service is the default MapReduce computation framework.You can create a YARN service in a CDH 4 cluster, but it is not considered production ready.
- In a Cloudera Manager deployment of a CDH 5 cluster, the YARN service is the default MapReduce computation framework.In CDH 5, the MapReduce service has been deprecated. However, the MapReduce service is fully supported for backward compatibility through the CDH 5 lifecycle.
- For production uses, Cloudera recommends that only one MapReduce framework should be running at any given time. If development needs or other use case requires switching between MapReduce and YARN, both services can be configured at the same time, but only one should be running (to fully optimize the hardware resources available).
Migrating from MapReduce to YARN
Cloudera Manager provides a wizard described in Importing MapReduce Configurations to YARN to easily migrate MapReduce configurations to YARN. The wizard performs all the steps (Switching Between MapReduce and YARN Services, Updating Dependent Services, and Configuring Alternatives Priority) on this page.
- Do one of the following:
- Select .
- On the Status tab of the Cloudera Management Service table, click the Cloudera Management Service link. tab, in
- Click the Instances tab.
- Select checkbox for Activity Monitor, select Stop to confirm. , and click
- Select checkbox for Activity Monitor, select Delete to confirm. , and click
- Manage the Activity Monitor database. The example below is for a MySQL backend database:
- Verify the Activity Monitor database:
mysql> show databases; +--------------------+ | Database | +--------------------+ | amon | +--------------------+
- Back up the database:
$ mysqldump -uroot -pcloudera amon > /safe_backup_directory/amon.sql
Drop the database:mysql> drop database amon;
- Verify the Activity Monitor database:
Once you have migrated to YARN and deleted the MapReduce service, you can remove local data from each TaskTracker node. The mapred.local.dir parameter is a directory on the local filesystem of each TaskTracker that contains temporary data for MapReduce. Once the service is stopped, you can remove this directory to free disk space on each node.
For detailed information on migrating from MapReduce to YARN, see Migrating from MapReduce 1 (MRv1) to MapReduce 2 (MRv2, YARN).
Switching Between MapReduce and YARN Services
Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)
- (Optional) Configure the new MapReduce or YARN service.
- Update dependent services to use the chosen framework.
- Configure the alternatives priority.
- Redeploy the Oozie ShareLib.
- Redeploy the client configuration.
- Start the framework service to switch to.
- (Optional) Stop the unused framework service to free up the resources it uses.
Updating Dependent Services
Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)
- Hive
- Sqoop 2
- Oozie
- Go to the service.
- Click the Configuration tab.
- Select .
- Select .
- Locate the MapReduce Service property and select the YARN or MapReduce service.
- Click Save Changes to commit the changes.
- Select .
- Go to the Hue service.
- Select .
Configuring Alternatives Priority
Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)
The alternatives priority property determines which service—MapReduce or YARN—is used by clients to run MapReduce jobs. The service with a higher value of the property is used. In CDH 4, the MapReduce service alternatives priority is set to 92 and the YARN service is set to 91. In CDH 5, the values are reversed; the MapReduce service alternatives priority is set to 91 and the YARN service is set to 92.
- Go to the MapReduce or YARN service.
- Click the Configuration tab.
- Select .
- Select .
- Type Alternatives in Search box.
- In the Alternatives Priority property, set the priority value.
- Click Save Changes to commit the changes.
- Redeploy the client configuration.