Problems starting elasticsearch in Ubuntu 16.04

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

After you install elasticsearch in Ubuntu 16.04 (using apt install elasticsearch), you may notice it doesn't run.

# systemctl start elasticsearch       
# service elasticsearch status       
● elasticsearch.service - LSB: Starts elasticsearch
   Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
   Active: active (exited) since Sun 2016-08-14 13:53:08 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 26539 ExecStop=/etc/init.d/elasticsearch stop (code=exited, status=0/SUCCESS)
  Process: 26592 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=0/SUCCESS)

Aug 14 13:53:08 web3 systemd[1]: Starting LSB: Starts elasticsearch...
Aug 14 13:53:08 web3 systemd[1]: Started LSB: Starts elasticsearch.
Aug 14 13:56:18 web3 systemd[1]: Started LSB: Starts elasticsearch.
Aug 14 13:59:28 web3 systemd[1]: Started LSB: Starts elasticsearch.

Nothing interesting in the logs, but definitely the process is not running.

How to solve the problem?


  • in /etc/default/elasticsearch, make sure these are uncommented:
START_DAEMON=true
ES_USER=elasticsearch
ES_GROUP=elasticsearch
LOG_DIR=/var/log/elasticsearch
DATA_DIR=/var/lib/elasticsearch
WORK_DIR=/tmp/elasticsearch
CONF_DIR=/etc/elasticsearch
CONF_FILE=/etc/elasticsearch/elasticsearch.yml
RESTART_ON_UPGRADE=true


  • make sure /var/lib/elasticsearch is owned by elasticsearch user:
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch/


After that, elasticsearch should start properly.