MapReduce JobHistory Server
The MapReduce JobHistory Server is a service role in the YARN service that records and serves information about completed MapReduce jobs. You interact with it when you need to track, debug, or audit jobs that have already finished running.
Role overview
In Cloudera Manager, the JobHistory Server is a role within the YARN service. Cloudera Manager deploys one JobHistory Server per cluster. The role starts a persistent daemon that reads completed job records from HDFS and exposes them through a REST API and a web UI.
The JobHistory Server is separate from the ResourceManager. The ResourceManager manages running applications; the JobHistory Server manages records of applications that have already completed. When you open a completed job from the ResourceManager web UI, the ResourceManager proxies to the JobHistory Server to retrieve the job data.
Interaction with the JobHistory Server
You interact with the JobHistory Server in the following situations:
- Debugging failed jobs: Review task-level error messages and logs for map and reduce tasks that did not complete successfully.
- Analyzing job performance: Examine counters and metrics such as bytes read and written, time spent in map and reduce phases, and the number of task attempts.
- Auditing job history: Look up jobs by job ID, user, or time range to verify when a job ran and how long it took.
- Accessing aggregated logs: When YARN log aggregation is enabled, the JobHistory Server links to aggregated log files stored in HDFS so that you can view container logs after the NodeManager has reclaimed local disk space.
Accessing the JobHistory Server web UI
The JobHistory Server web UI is available by default at
<JobHistoryServer-host>:19888. The UI provides a list of completed
jobs and lets you drill down into each job to view individual tasks, map and reduce
counters, and logs.
You can also open a completed job directly from the ResourceManager web UI at
<ResourceManager-host>:8088. After a job finishes, the
ResourceManager redirects job links to the JobHistory Server automatically.
Job records and data
The JobHistory Server reads completed job information from job history log files stored in a designated HDFS directory. Each record includes:
- Job configuration, start and end times, duration, and final status (successful or failed)
- Number of map and reduce tasks, and per-task completion statistics
- Task-level metrics including data read and written, number of attempts, and execution time
- Job and task counters that show resource usage and any custom counters defined in the job
- Error messages for failed task attempts
Log aggregation and heap sizing
When YARN log aggregation is enabled, the JobHistory Server caches job records in memory. The default Java heap size for the JobHistory Server is 1 GB. Cloudera recommends allocating approximately 10 KB of heap per job. For example, 50,000 jobs require at least 0.5 GB of heap.
Increasing the log retention period set by yarn.log-aggregation.retain-seconds increases the number of cached jobs. Cloudera recommends increasing the JobHistory Server heap proportionally to prevent crashes caused by insufficient memory.
