Allocating RAM to Elasticsearch nodes

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

How are you starting your different instances?

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

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.