Automatic ES startup

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

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

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.

Why not use docker? It's much cleaner.

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