# Allocating RAM to Elasticsearch nodes

**URL:** <https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080>\
**Category:** Elasticsearch\
**Created:** [October 27, 2015, 2:01pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080 "2015-10-27T14:01:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgirndt](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mgirndt](https://discuss.elastic.co/u/mgirndt)\
**Post date:** [October 27, 2015, 2:01pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080/1 "2015-10-27T14:01:38Z")

</div>

I have a server which that has multiple elasticsearch nodes on it, how do I allocate RAM for each specific node? I used  
export ES\_HEAP\_SIZE=30g for the first node. How do I allocate a specific amount for the second node?

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 27, 2015, 8:32pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080/2 "2015-10-27T20:32:42Z")

</div>

How are you starting your different instances?

---

<div class="post-metadata">

**Author:** ![mgirndt](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mgirndt](https://discuss.elastic.co/u/mgirndt)\
**Post date:** [October 27, 2015, 8:44pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080/3 "2015-10-27T20:44:52Z")

</div>

I'm wanting them to both have init.d scripts.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 27, 2015, 9:13pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080/4 "2015-10-27T21:13:55Z")

</div>

If you use the stock init scripts they'll load the /etc/default (or /etc/sysconfig) file with the same name, i.e. /etc/init.d/elasticsearch-foo loads /etc/default/elasticsearch-foo so just set ES\_HEAP\_SIZE in the file corresponding to each instance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:42pm UTC](https://discuss.elastic.co/t/allocating-ram-to-elasticsearch-nodes/33080/5 "2017-07-05T23:42:18Z")

</div>


