Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch service does not run at statup on Ubuntu 16.04

I installed elasticsearch on Ubuntu 16.04.

When I enter sudo service elasticsearch start, everything works.

But the service is not running on startup. Before starting it manually, sudo service elasticsearch status gives me:

elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vend
   Active: inactive (dead)
     Docs: http://www.elastic.co

I tried to add it to startup with: sudo update-rc.d elasticsearch defaults and sudo update-rc.d elasticsearch enable, but this changes nothing.

What could be the problem, and how can I debug this?

like image 267
user1383029 Avatar asked May 21 '16 12:05

user1383029


People also ask

How do I start Elasticsearch service in Linux?

One way to start Elasticsearch is by extracting the . tar file and entering the bin directory and running the command ./elasticsearch . The other way, if you install it using apt or apt-get is by running systemctl start elasticsearch or systemctl start elasticsearch. service .


1 Answers

The answer to your problem is running this:

sudo systemctl enable elasticsearch.service

Elasticsearch on Ubuntu 16.04 uses SystemD not System V anymore.

For some reason when (as of 9th Jan 2016) you install ES 5.1 (not sure if other versions are affected) from APT by default this service does not start.

like image 188
Tomasz Raganowicz Avatar answered Oct 24 '22 09:10

Tomasz Raganowicz