# Automatic ES startup

**URL:** <https://discuss.elastic.co/t/automatic-es-startup/181953>\
**Category:** Elasticsearch\
**Created:** [May 21, 2019, 8:38am UTC](https://discuss.elastic.co/t/automatic-es-startup/181953 "2019-05-21T08:38:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrozan](https://avatars.discourse-cdn.com/v4/letter/w/7ea924/32.png) [@wrozan](https://discuss.elastic.co/u/wrozan)\
**Post date:** [May 21, 2019, 8:38am UTC](https://discuss.elastic.co/t/automatic-es-startup/181953/1 "2019-05-21T08:38:14Z")

</div>

Hi,

i have on an ElasticSearch server 3 different instances.  
Each of them is configured with a service so i can start them with commands like "systemctl start servicename"

service are configured like below :  
_[Unit]_

- Description=ElasticSearch SP7 Service\*

- After=syslog.target network.target sysinit.target\*

- [Service]\*

- Type=forking\*

- #Environment=JAVA\_HOME=/usr/lib/jvm/jre\*

- WorkingDirectory=/etc/elasticsearch/sp7\*

- ExecStart=/etc/elasticsearch/sp7/bin/elasticsearch -d\*

- ExecStop=/bin/kill -15 $MAINPID\*

- User=slan\*

- #Group=slan\*

- #UMask=0007\*

- RestartSec=10\*

- Restart=always\*

- [Install]\*

- #WantedBy=multi-user.target\*

- [Service]\*

- LimitMEMLOCK=infinity\*

i tried to get my instances starting automatically with command systemctl enable servicename.

Unfortunately it does not start whereas it works perfectly manually.  
There is nothing in my logs sicne i added  
[Service]  
LimitMEMLOCK=infinity  
thin king it could help me sorting this problem

i had previsouly following logs  
_[2019-05-16T00:45:52,199][INFO][o.e.n.Node] [leasing\_sp7] stopping ..._

- [2019-05-16T00:45:52,252][INFO][o.e.n.Node] [leasing\_sp7] stopped\*
- [2019-05-16T00:45:52,253][INFO][o.e.n.Node] [leasing\_sp7] closing ...\*
- [2019-05-16T00:45:52,259][INFO][o.e.n.Node] [leasing\_sp7] closed\*
- [2019-05-16T01:15:12,998][WARN][o.e.b.JNANatives] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory\*
- [2019-05-16T01:15:13,000][WARN][o.e.b.JNANatives] This can result in part of the JVM being swapped out.\*
- [2019-05-16T01:15:13,001][WARN][o.e.b.JNANatives] Increase RLIMIT\_MEMLOCK, soft limit: 65536, hard limit: 65536\*
- [2019-05-16T01:15:13,001][WARN][o.e.b.JNANatives] These can be adjusted by modifying /etc/security/limits.conf, for example: \*
- 

```
  # allow user 'slan' mlockall*

```

- 

```
  slan soft memlock unlimited*

```

- 

```
  slan hard memlock unlimited* 

```

my limit.conf file already contains  
_slan soft memlock unlimited_  
_slan hard memlock unlimited_  
_slan soft nofile 65536_  
_slan hard nofile 65536_

do you have any idea that could help ?

thanks

Willy

---

<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:** [May 21, 2019, 1:55pm UTC](https://discuss.elastic.co/t/automatic-es-startup/181953/2 "2019-05-21T13:55:24Z")

</div>

Why not install a packaged version of Elasticsearch, DEB/RPM? They include all the files you need to do this out of the box.

---

<div class="post-metadata">

**Author:** ![wrozan](https://avatars.discourse-cdn.com/v4/letter/w/7ea924/32.png) [@wrozan](https://discuss.elastic.co/u/wrozan)\
**Post date:** [May 21, 2019, 10:00pm UTC](https://discuss.elastic.co/t/automatic-es-startup/181953/3 "2019-05-21T22:00:10Z")

</div>

Hi,  
advantage is that i could define myself folders and i'm not sure with RPM i can install 3 different instances on the same server.

---

<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:** [May 21, 2019, 10:48pm UTC](https://discuss.elastic.co/t/automatic-es-startup/181953/4 "2019-05-21T22:48:56Z")

</div>

Why not use docker? It's much cleaner.

---

<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:** [June 18, 2019, 10:48pm UTC](https://discuss.elastic.co/t/automatic-es-startup/181953/5 "2019-06-18T22:48:58Z")

</div>

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