# Cant find /etc/default/elasticsearch

**URL:** <https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294>\
**Category:** Elasticsearch\
**Created:** [April 13, 2016, 6:21pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294 "2016-04-13T18:21:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [April 13, 2016, 6:21pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/1 "2016-04-13T18:21:22Z")

</div>

Hello, I cant seem to locate the elasticsearch's file in the /etc/default/ path on our production server.  
(ubuntu 14.04)

I need it to change the heap size of of elasticsearch which has been giving the **java.lang.OutOfMemoryError: Java heap space** error.

Although, there is an elasticsearch conf file in the /etc/init.d/ path. We upgraded sometime ago from elasticsearch 1.7 to 2.0.

---

<div class="post-metadata">

**Author:** ![neu5ron](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@neu5ron](https://discuss.elastic.co/u/neu5ron)\
**Post date:** [April 13, 2016, 7:49pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/2 "2016-04-13T19:49:44Z")

</div>

It should be "/etc/elasticsearch/elasticsearch.yml"

---

<div class="post-metadata">

**Author:** ![Ryan\_Hadley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_hadley/32/9070_2.png) [@Ryan\_Hadley](https://discuss.elastic.co/u/Ryan_Hadley)\
**Post date:** [April 13, 2016, 7:59pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/3 "2016-04-13T19:59:07Z")

</div>

Changing your heap size really depends on the distribution you're running on.

Read through the init script that starts elasticsearch to see if it's sourcing an external file for environment variables that you can customize.

Or, just put a line like this inside your init script at an appropriate spot, setting the "31g" to what you want your heap to be at:

export ES\_HEAP\_SIZE=31g

The elasticsearch.yml Nate mentioned isn't going to allow you to modify your heap size.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 13, 2016, 9:19pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/4 "2016-04-13T21:19:15Z")

</div>

`/etc/default/elasticsearch` is where you define variables for the init file to use.

---

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [April 14, 2016, 8:45am UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/5 "2016-04-14T08:45:40Z")

</div>

> [@Ryan\_Hadley](#):
>
> Or, just put a line like this inside your init script at an appropriate spot, setting the "31g" to what you want your heap to be at:

Hi @Ryan_Hadley, thanks , but I have already tried that and it doesn't work when I check through sense `GET _nodes/stats`.

Any ideas @warkolm?

---

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [April 14, 2016, 10:20am UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/6 "2016-04-14T10:20:15Z")

</div>

Hi thanks all, I was able to resolve it by changing `ES_MIN_MEM` and `ES_MIN_MAX` in the [elasticsearch.in.sh](http://elasticsearch.in.sh) file.

---

<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, 10:59pm UTC](https://discuss.elastic.co/t/cant-find-etc-default-elasticsearch/47294/7 "2017-07-05T22:59:20Z")

</div>


