0

How do i get the total count i.e max capacity of containers from Resource Manager of YARN in Hadoop Cluster. I did try REST Api's and JMX metrics am getting only total allocated containers and pending containers.So is there any way i can retrieve the max containers that can be created count?

Sushil Ks
  • 403
  • 2
  • 10
  • 18

2 Answers2

0

In YARN, we have minimum allocation property, so all container have minimuum of that value. So based on that you can caluculate maximum number of containers that can be launched (divide by total memory available for yarn). I think this is the only way to get maximum containers that can be launched.

So in your programs, get these two properties and doing some math will get you required result.

Properties to look for are :

    <name>yarn.scheduler.minimum-allocation-mb</name>
    <value>1024</value>
    <name>yarn.scheduler.minimum-allocation-mb</name>
    <value>8192</value>
Karthik
  • 1,801
  • 1
  • 13
  • 21
0

The RM API cluster metrics shows you total vcores and total memory.

https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Metrics_API

So if you do a GET on RM-URL/ws/v1/cluster/metrics you'd see the values of "totalMB" and "totalVirtualCores".

tk421
  • 5,775
  • 6
  • 23
  • 34