<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to fetch the number of containers and Vcores allocated for a application once it is completed from YARN/ATS REST API? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-the-number-of-containers-and-Vcores-allocated/m-p/214787#M176699</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/13950/dheervijjiraghu.html" nodeid="13950"&gt;@Venkata Sudheer Kumar M&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You can fetch total containers allocated for an application using YARN CLI -&lt;/P&gt;&lt;PRE&gt;1. Fetch applicationAttempt for the application using-  yarn applicationattempt -list &amp;lt;applicationID&amp;gt;
2. Fetch all containers for that applicationAttempt using-  yarn  container -list &amp;lt;appattempt&amp;gt;&lt;/PRE&gt;&lt;P&gt;In the step 2 above, you will also get NodeManager info on which the container was launched. From the nodemanager info on which the container was launched, you can obtain the vcores and memory allocated for that container using the below REST API&lt;/P&gt;&lt;PRE&gt;curl &lt;A href="http://&amp;lt;Nodemanager" target="_blank"&gt;http://&amp;lt;Nodemanager&lt;/A&gt; address&amp;gt;:&amp;lt;port&amp;gt;/ws/v1/node/containers/&amp;lt;containerID&amp;gt;&lt;/PRE&gt;&lt;P&gt;Hope this is helpful to you!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 01:37:32 GMT</pubDate>
    <dc:creator>ssathish</dc:creator>
    <dc:date>2018-04-10T01:37:32Z</dc:date>
  </channel>
</rss>

