# Start up ES with environment and variables in systemd

**URL:** <https://discuss.elastic.co/t/start-up-es-with-environment-and-variables-in-systemd/183896>\
**Category:** Elasticsearch\
**Created:** [June 3, 2019, 6:57am UTC](https://discuss.elastic.co/t/start-up-es-with-environment-and-variables-in-systemd/183896 "2019-06-03T06:57:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon17386273](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@anon17386273](https://discuss.elastic.co/u/anon17386273)\
**Post date:** [June 3, 2019, 6:57am UTC](https://discuss.elastic.co/t/start-up-es-with-environment-and-variables-in-systemd/183896/1 "2019-06-03T06:57:49Z")

</div>

For config directory, I am trying to "eliminate" the need to use the elasticsearch.yml for each instance by having each instance start up with the environment and variables.

Eg. Using systemd  
Environment="ES\_JAVA\_OPTS=-Xms1g Xmx1g"  
ExecStart=/opt/elasticsearch/bin/elasticsearch  
-Ecluster.name=production  
-Ecluster.initial\_master\_nodes=es01,es02,es03  
-Ediscovery.seed\_hosts=192.168.100.1,192.168.100.2,192.168.100.3  
-Enetwork.host=192.168.100.1  
-Ehttp.port=9200  
-Enode.name=es01  
-Epath.logs=/var/log/elasticsearch/es01  
-Epath.data=/data/es01

Seems that all the required settings can be placed in the service file and "eliminate" the need to use elasticsearch.yml.

Is there any caveat in doing this?

---

<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 1, 2019, 6:57am UTC](https://discuss.elastic.co/t/start-up-es-with-environment-and-variables-in-systemd/183896/2 "2019-07-01T06:57:54Z")

</div>

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