0

On ubuntu 16 lts server system, a newly installed elasticsearch instance won't start up with systemctl restart elasticsearch (or with start). No logs are created, manually running /usr/share/elasticsearch/bin/elasticsearch as user elasticsearch WORKS, so permissions or the configuration file are not the issue (I think), and there's no logs in /var/log/elasticsearch when I run the systemctl commands, so I assume systemctl just fails silently to do anything.

I have no idea what to check next. Is there some /etc/init.d/##elasticsearch script or something that is bad and needs to be replaced?

What does systemctl do on ubuntu? Does it find and run /etc/rc4.d/S01elasticsearch? Something else?

systemctl status elasticsearch says:

● elasticsearch.service - LSB: Starts elasticsearch
   Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
   Active: active (exited) since Mon 2016-11-07 16:29:25 EST; 2min 26s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1151 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=0

Nov 07 16:29:25 webci systemd[1]: Starting LSB: Starts elasticsearch...
Nov 07 16:29:25 webci elasticsearch[1151]:  * Starting Elasticsearch Server
Nov 07 16:29:25 webci elasticsearch[1151]:    ...done.
Nov 07 16:29:25 webci systemd[1]: Started LSB: Starts elasticsearch.

I think the above means it started and silently exited giving no useful log output. No additional logging from journalctl either.

If I use journalctl -xe I get a pile of clock noise, but nothing interesting:

Nov 07 16:33:44 webci elasticsearch[2273]:  * Starting Elasticsearch Server
Nov 07 16:33:44 webci elasticsearch[2273]:    ...done.
Nov 07 16:33:44 webci systemd[1]: Started LSB: Starts elasticsearch.
-- Subject: Unit elasticsearch.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit elasticsearch.service has finished starting up.
--
-- The start-up result is done.
Nov 07 16:33:44 webci sudo[2233]: pam_unix(sudo:session): session closed for use
Nov 07 16:34:08 webci smbd[2343]: pam_unix(samba:session): session closed for us
Nov 07 16:35:01 webci CRON[2356]: pam_unix(cron:session): session opened for use
Nov 07 16:35:01 webci CRON[2357]: (root) CMD (command -v debian-sa1 > /dev/null
Nov 07 16:35:01 webci CRON[2356]: pam_unix(cron:session): session closed for use
lin

It looks like a success, but the elasticsearch process is not running, and has exited.

1

You can use

systemctl status <service>

to get basic information about the status of the service an d

journalctl -xe

will show the contents of the systemd journal in a pager program and jump to the end of the journal. You may need to scroll up to get to the information you want.

|improve this answer|||||
  • Thanks. This helped me figure out I had to edit a system service configuration file to enable the daemon (which is disabled by default in ubuntu 16, for some crazy reason) fixed it. – Warren P Nov 9 '16 at 12:17
  • 1
    You can enable a service with systemctl enable <service> – user9517 Nov 9 '16 at 13:07
  • Warren, it would be nice if you updated your post to say which configuration file and how you fixed it (the reply comment about systemctl enable is irrelevant because the problem has nothing to do with systemctl). I found working instructions here: discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/… – James Roper Feb 22 '17 at 6:06
-1

The solution to getting elasticsearch running on Ubuntu 16.04 is to edit /etc/default/elasticsearch, uncommenting the line that says START_DAEMON=true, and then run systemctl restart elasticsearch.

|improve this answer|||||
  • Isn't this exactly what systemctl does? – Warren P Feb 22 '17 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.