86 | Big Data Simplied
Depending upon the available capacity on a particular node, one Node Manager can have
more than one container, which means it can have multiple processes running on that node.
After a container has been assigned on a Node Manager, the Resource Manager starts off an
ApplicationMaster process within the container.
The Application Master process is actually responsible for processing the data. In the case of a
MapReduce, the Application Master process will either be a mapper process or the reduce logic,
depending upon the specific MapReduce step that it is handling.
The Application Master process is also responsible for figuring out whether additional pro-
cesses are required to complete the task. In that case, the Application Master requests the Resource
Manager running on the Master Node for additional resources. We also know that these addi-
tional resources are in the form of containers. The request will have CPU requirements, memory
requirements and disk space requirements.
Again, the Resource Manager scans the entire cluster and determines which nodes are avail-
able and have the required capacity, so that these additional processes can be run. The same job
will then be given additional resources in the form of additional containers on additional nodes.
The original Application Master process, which made the request for additional nodes, then
starts off new Application Master processes on these new nodes that have been assigned by the
Resource Manager.
Thus, the Node Managers and the Resource Manager communicate with each other and work
in tandem to accomplish parallel processing across the cluster.
4.5.3 Troubleshoot a MapReduce Job in Hadoop Cluster
Basically, RM is the responsible Hadoop process to handle a MapReduce job in Yarn container.
The following observations can be made after job execution.
• RM communicates with Yarn and the job is then ‘UNDEFINED’ state.
• Yarn checks the container queue and allows permission to the job enter in the queue, then
the state has changed to ‘ACCEPTED’.
• Now Yarn will take care of the job and continuously communicating with RM to arrange
required resources for that particular job.
• If Yarn receives the required resources (disk space, memory and CPU across all nodes), then
the state will change to ‘RUNNING’ and the job is getting to run in the container.
• ‘RUNNING’ means all the internal Mappers are executing in all the Node Managers with the
help of Application Master.
Here, at this point, if any particular Mapper or Reducer task is getting killed through an excep-
tion, then the overall job will be terminated from the Yarn container and the Yarn will show the
job state as ‘KILLED’.
Therefore, in this case, the best practice is to analyse the RM log to investigate the root cause.
Generally, this log is written inside of ‘hadoop-yarn’ folder under ‘/var/log’ path. There are numer-
ous reasons behind the termination of the MapReduce job, some of the reasons may arise from
M04 Big Data Simplified XXXX 01.indd 86 5/10/2019 9:58:22 AM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.42.176