title: Why does YARN job not transition to RUNNING state?
body: <p>I've got a number of Samza jobs that I want to run.  I can get the first to run ok.  However, the second job seems to sit at the ACCEPTED state and never transitions into the RUNNING state until I kill the first job.</p>
  
  <p>Here is the view from the YARN UI:</p>
  
  <p><a href="https://i.stack.imgur.com/YPkWx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YPkWx.png" alt="YARN UI"></a></p>
  
  <p>Here are the details for the second job, where you can see no node has been allocated:
  <a href="https://i.stack.imgur.com/EG8Lu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EG8Lu.png" alt="enter image description here"></a></p>
  
  <p>I have 2 datanodes, so I should be able to run multiple jobs.  Here is the relevant section of my <code>yarn-site.xml</code> (the only other config I have in the file is to do with the HA config, Zookeeper etc):</p>
  
  <pre><code>&lt;property&gt;
      &lt;name&gt;yarn.scheduler.minimum-allocation-mb&lt;/name&gt;
      &lt;value&gt;128&lt;/value&gt;
      &lt;description&gt;Minimum limit of memory to allocate to each container request at the Resource Manager.&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;yarn.scheduler.maximum-allocation-mb&lt;/name&gt;
      &lt;value&gt;2048&lt;/value&gt;
      &lt;description&gt;Maximum limit of memory to allocate to each container request at the Resource Manager.&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;yarn.scheduler.minimum-allocation-vcores&lt;/name&gt;
      &lt;value&gt;1&lt;/value&gt;
      &lt;description&gt;The minimum allocation for every container request at the RM, in terms of virtual CPU cores. Requests lower than this won't take effect, and the specified value will get allocated the minimum.&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;yarn.scheduler.maximum-allocation-vcores&lt;/name&gt;
      &lt;value&gt;2&lt;/value&gt;
      &lt;description&gt;The maximum allocation for every container request at the RM, in terms of virtual CPU cores. Requests higher than this won't take effect, and will get capped to this value.&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;yarn.nodemanager.resource.memory-mb&lt;/name&gt;
      &lt;value&gt;4096&lt;/value&gt;
      &lt;description&gt;Physical memory, in MB, to be made available to running containers&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;yarn.nodemanager.resource.cpu-vcores&lt;/name&gt;
      &lt;value&gt;4&lt;/value&gt;
      &lt;description&gt;Number of CPU cores that can be allocated for containers.&lt;/description&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I can see in the resource manager logs:</p>
  
  <pre><code>2015-11-01 17:47:37,151 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue: assignedContainer application attempt=appattempt_1446300861747_0018_000001 container=Container: [ContainerId: container_1446300861747_0018_01_000002, NodeId: yarndata-01:41274, NodeHttpAddress: yarndata-01:8042, Resource: &lt;memory:1024, vCores:1&gt;, Priority: 0, Token: null, ] queue=default: capacity=1.0, absoluteCapacity=1.0, usedResources=&lt;memory:1024, vCores:1&gt;, usedCapacity=0.125, absoluteUsedCapacity=0.125, numApps=1, numContainers=1 clusterResource=&lt;memory:8192, vCores:8&gt;
  2015-11-01 17:47:37,151 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue: Re-sorting assigned queue: root.default stats: default: capacity=1.0, absoluteCapacity=1.0, usedResources=&lt;memory:2048, vCores:2&gt;, usedCapacity=0.25, absoluteUsedCapacity=0.25, numApps=1, numContainers=2
  2015-11-01 17:47:37,151 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue: assignedContainer queue=root usedCapacity=0.25 absoluteUsedCapacity=0.25 used=&lt;memory:2048, vCores:2&gt; cluster=&lt;memory:8192, vCores:8&gt;
  2015-11-01 17:47:37,658 INFO org.apache.hadoop.yarn.server.resourcemanager.security.NMTokenSecretManagerInRM: Sending NMToken for nodeId : yarndata-01:41274 for container : container_1446300861747_0018_01_000002
  2015-11-01 17:47:37,659 INFO org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerImpl: container_1446300861747_0018_01_000002 Container Transitioned from ALLOCATED to ACQUIRED
  2015-11-01 17:47:39,154 INFO org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerImpl: container_1446300861747_0018_01_000002 Container Transitioned from ACQUIRED to RUNNING
  2015-11-01 17:48:03,821 INFO org.apache.hadoop.yarn.server.resourcemanager.ClientRMService: Allocated new applicationId: 19
  2015-11-01 17:48:04,339 WARN org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: The specific max attempts: 0 for application: 19 is invalid, because it is out of the range [1, 2]. Use the global max attempts instead.
  2015-11-01 17:48:04,339 INFO org.apache.hadoop.yarn.server.resourcemanager.ClientRMService: Application with id 19 submitted by user www-data
  2015-11-01 17:48:04,339 INFO org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=www-data IP=192.168.2.81 OPERATION=Submit Application Request    TARGET=ClientRMService  RESULT=SUCCESS  APPID=application_1446300861747_0019
  2015-11-01 17:48:04,340 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: Storing application with id application_1446300861747_0019
  2015-11-01 17:48:04,340 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: application_1446300861747_0019 State change from NEW to NEW_SAVING
  2015-11-01 17:48:04,340 INFO org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore: Storing info for app: application_1446300861747_0019
  2015-11-01 17:48:04,342 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: application_1446300861747_0019 State change from NEW_SAVING to SUBMITTED
  2015-11-01 17:48:04,342 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue: Application added - appId: application_1446300861747_0019 user: www-data leaf-queue of parent: root #applications: 2
  2015-11-01 17:48:04,342 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler: Accepted application application_1446300861747_0019 from user: www-data, in queue: default
  2015-11-01 17:48:04,343 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: application_1446300861747_0019 State change from SUBMITTED to ACCEPTED
  2015-11-01 17:48:04,343 INFO org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService: Registering app attempt : appattempt_1446300861747_0019_000001
  2015-11-01 17:48:04,343 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl: appattempt_1446300861747_0019_000001 State change from NEW to SUBMITTED
  2015-11-01 17:48:04,343 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue: not starting application as amIfStarted exceeds amLimit
  2015-11-01 17:48:04,343 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue: Application added - appId: application_1446300861747_0019 user: org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue$User@202c5cd5, leaf-queue: default #user-pending-applications: 1 #user-active-applications: 1 #queue-pending-applications: 1 #queue-active-applications: 1
  </code></pre>
  
  <p>What am I not doing correctly please?</p>