Job for elasticsearch.service failed because the control process exited with error code

root@d-gp2-es46-1:~# service elasticsearch start
Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@d-gp2-es46-1:~# service elasticsearch status

  • elasticsearch.service - Elasticsearch
    Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Thu 2017-11-30 17:09:48 UTC; 3s ago
    Docs: http://www.elastic.co
    Process: 29382 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=203/EXEC)
    Main PID: 4426 (code=exited, status=143)

Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: Starting Elasticsearch...
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Control process exited, code=exited status=203
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: Failed to start Elasticsearch.
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Unit entered failed state.
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

1 Like

Upgrading from 5.6.1 to 6.0.0. I install and when trying to start elasticsearch, it fails. Any ideas why?

This file exists in 5.6.1 but after installing 6.0.0 on Ubuntu 16.04 .... it does not exist anymore.

/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec

-- vi /usr/lib/systemd/system/elasticsearch.service ... make the below changes for it to startup.
[Service]
LimitMEMLOCK=infinity
Environment=ES_HOME=/usr/share/elasticsearch
Environment=CONF_DIR=/etc/elasticsearch
Environment=DATA_DIR=/data/elasticsearch
Environment=LOG_DIR=/var/log/elasticsearch
Environment=PID_DIR=/var/run/elasticsearch
EnvironmentFile=-/etc/default/elasticsearch
#ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec
ExecStart=/usr/share/elasticsearch/bin/elasticsearch
-p ${PID_DIR}/elasticsearch.pid
--quiet
-Epath.logs=${LOG_DIR}
-Epath.data=${DATA_DIR}

Specifies the maximum number of processes

LimitNPROC=4096

This file exists in 5.6.1 but after installing 6.0.0 on Ubuntu 16.04 .... it does not exist anymore.

That is correct. We no longer use this file in 6.0.0.
The core issue you have is that your elasticsearch.service file still refers to it (although you've since resolved that).

It is likely that you edited that elasticsearch.service at some point in the past, so when you upgraded your elasticsearch install, the package manager was unable to reconcile the changes in the .deb with your local installation.
Even though you have worked around this issue, you should check the logs from your upgrade because it is possible that you have missed other installation steps that could be important.

Please see the first half of this thread:

The only change I made was the following that is documented on elasticsearch's website. Is there another way to be able to set "bootstrap.memory_lock: true" in the config file and have it start up?

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html

-- vi /usr/lib/systemd/system/elasticsearch.service
[Service]
LimitMEMLOCK=infinity

I see in the doc it says to put it in the following file "/etc/systemd/system/elasticsearch.service.d/override.conf" ... i'll give that a try.

so i was misinformed by someone at work and by updating that file with the following command ... it works fine for upgrading.

systemctl edit elasticsearch

[Service]
LimitMEMLOCK=infinity

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