Title: Configuring NodeManager memory and vcores in a heterogenous YARN cluster?
Tags: memory-management;hadoop-yarn;ambari
Question: I am aware to set the memory and vcores in YARN using the following properties:

```
  
  yarn.nodemanager.resource.memory-mb
  yarn.nodemanager.resource.cpu-vcores
  
```

I have a heterogenous YARN cluster with nodes having following configuration:

```
  
  Node1 (8cores, 16GB RAM)
  Node2 (8cores, 16GB RAM)
  Node3 (32cores, 64GB RAM)
  Node4 (32cores, 64GB RAM)
  
```

I want to set the nodemanager memory and cores to be different for Node1,Node2 and Node3,Node4.

Node1 &amp; Node2

```
  
  yarn.nodemanager.resource.memory-mb = 10240
  yarn.nodemanager.resource.cpu-vcores = 15
  
```

Node3 &amp; Node4

```
  
  yarn.nodemanager.resource.memory-mb = 40240
  yarn.nodemanager.resource.cpu-vcores = 25
  
```

How to achieve this with/without using Ambari?


Here is the accepted answer: Without Ambari:

You can achieve the heterogeneous resource assignment directly by configuring the above properties in ```yarn-site.xml``` of individual nodes and restarting the YARN services.

With Ambari:

In Ambari, You can create ```Configuration Groups``` for ```individual nodes``` of cluster from the ```Manage Configuration Group``` link visible on the ```Configs``` tab next to ```Group drop down```. While creating the configuration groups you will find option of selecting the node where you wants to apply the configuration. Once configurations gets created for individual nodes, changes can be applied by restarting the YARN services. Follow Heterogeneous Configuration to know how it can be configured.

Comment for this answer: I am aware of this but this can be done using Ambari as well? I believe it applies the same copy to all nodes and you cannot manually change the per node config since Ambari syncs it back.
Comment for this answer: Thanks, this looks great
Comment for this answer: @RakeshRakshit, I have added details for Ambari configuration as well, please follow that.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:09/09/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<memory-management><hadoop-yarn><ambari>', 'Title': 'Configuring NodeManager memory and vcores in a heterogenous YARN cluster?', 'ViewCount': 1370, 'id': 39409582, 'user_AboutMe': '<p>I am a big data enthusiast.</p>\n', 'user_AccountId': 4414003.0, 'user_DisplayName': 'Rakesh Rakshit', 'user_Reputation': 552.0, 'user_Views': 120.0, 'user_id': 3596122.0}}