# Bin elasticsearch-env file - possible bug?

**URL:** <https://discuss.elastic.co/t/bin-elasticsearch-env-file-possible-bug/109266>\
**Category:** Elasticsearch\
**Created:** [November 27, 2017, 6:18pm UTC](https://discuss.elastic.co/t/bin-elasticsearch-env-file-possible-bug/109266 "2017-11-27T18:18:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![morphers82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morphers82/32/22904_2.png) [@morphers82](https://discuss.elastic.co/u/morphers82)\
**Post date:** [November 27, 2017, 6:18pm UTC](https://discuss.elastic.co/t/bin-elasticsearch-env-file-possible-bug/109266/1 "2017-11-27T18:18:37Z")

</div>

I've only been able to run 2-6.0 ES nodes on a single server by manually editing the /usr/share/elasticsearch/bin/elasticsearch-env file before running the seperately configured elasticsearch.service files (ie running systemctl using elasticsearch-node-1.service, then elasticsearch-node-2.service)

specifically, i had to change the line towards the end that says:  
if [-f /etc/default/elasticsearch]; then source /etc/default/elasticsearch; fi  
to a new default config file for the second instance (@ /etc/default/elasticsearch-node-2 by editing the line to:  
if [-f /etc/default/elasticsearch-node-2]; then source /etc/default/elasticsearch-node-2; fi

Shouldn't this line be getting its setting from a configuration Variable Setting that is setup in my 2nd node's config file?

Without editing this file manually, when trying to startup the 2nd instance, it uses original /etc/elasticsearch/elasticsearch.yml file for configuration, instead of the second config directory i setup so it gives an error about not being able to use an already locked data directory, because its using the exact same config as the first instance.

---

<div class="post-metadata">

**Author:** ![morphers82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morphers82/32/22904_2.png) [@morphers82](https://discuss.elastic.co/u/morphers82)\
**Post date:** [November 27, 2017, 6:36pm UTC](https://discuss.elastic.co/t/bin-elasticsearch-env-file-possible-bug/109266/2 "2017-11-27T18:36:26Z")

</div>

So i was able to get it to work without this manual edit by commenting out the "ES\_PATH\_CONF=/etc/elasticsearch" line in the /etc/default/elasticsearch 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:** [December 25, 2017, 6:36pm UTC](https://discuss.elastic.co/t/bin-elasticsearch-env-file-possible-bug/109266/3 "2017-12-25T18:36:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
