title: Number of application masters in a mapreduce job?? And mapreduce processing steps in YARN
body: <p>I know that there is only Resource Manager in a hadoop cluster. 
  From my understanding, there should be only one Application Master for a cluster as well. Is that right? Following is my understanding of how a mapreduce job is run in YARN. Please correct if my understanding is not right.</p>
  
  <p>Application execution sequence of steps on YARN:</p>
  
  <ol>
  <li>Client submits a job to the Resource Manager (RM). RM runs on Master Node. There is only one RM across the cluster to manage the resources. Resource Manager is a Daemon process.</li>
  <li>RM will go to HDFS thru Name Node.</li>
  <li>RM spins up an Application Master (AM). AM will reach HDFS thru Name Node. It will create a mapper matrix. This is the mapper phase. Like if Block 1 is available on Name Node 5 or 6. </li>
  <li>Based on Mapper matrix information, AM sends requests to individual Node managers (NM) to run a particular task for each block. NM runs on slave node.</li>
  <li>Each NM sends a request to RM to get a container. A container executes an application specific process with a constrained set of resources (memory, CPU etc).</li>
  <li>Mapper task runs in the container and sends the heart beat to the Application master. AM also sends the heart beat to RM.</li>
  <li>After all the processes are done, AM starts another matrix for Reducer tasks.</li>
  <li>After all the reducer tasks are completed, the AM sends the results to RM.</li>
  <li>RM lets the client know the results and kills the AM.
  Application Master can get stuck. That is why it is sending heart beats to Resource Manager</li>
  </ol>
  
  <p>Thanks much
  Nath</p>