Error: Failed to start ‘elasticsearch-service-x64’ service
Sometimes Elasticsearch service installation on Windows goes fine but when starting the service Elasticsearch, it does not start or it starts but dies after a few seconds.
If you’d visit the <ES_HOME>\logs directory, you will be able to see what is going wrong. You see error like the one listed below:
[info] [12056] Starting service... [error] [12056] Failed creating java %JAVA_HOME%\bin\server\jvm.dll [error] [12056] The system cannot find the path specified. [error] [12056] ServiceStart returned 1 [error] [12056] The system cannot find the path specified. [info] [ 9824] Run service finished. [info] [ 9824] Commons Daemon procrun finished [error] [11336] Failed to start 'elasticsearch-service-x64' service [error] [11336] The data area passed to a system call is too small. [info] [11336] Start service finished. [error] [11336] Commons Daemon procrun failed with exit value: 5 (Failed to start service) [error] [11336] The data area passed to a system call is too small. [info] [ 5180] Commons Daemon procrun (1.0.15.0 64-bit) started [info] [ 5180] Service elasticsearch-service-x64 name Elasticsearch 2.3.2 (elasticsearch-service-x64) [info] [ 5180] Service 'elasticsearch-service-x64' installed [info] [ 5180] Commons Daemon procrun finished [info] [ 8332] Commons Daemon procrun (1.0.15.0 64-bit) started [info] [ 8332] Starting service 'elasticsearch-service-x64' ... [info] [10816] Commons Daemon procrun (1.0.15.0 64-bit) started [info] [10816] Running 'elasticsearch-service-x64' Service...
Resolution:
If you did Elasticsearch DPK install, this error is most likely due to incorrect JAVA_HOME reference and if you did manual install of Elasticsearch, this error is either due to incorrect elasticsearch.yml file or incorrect JAVA_HOME reference.
Try the following troubleshooting options:
- Verify elasticsearch.yml does not have syntax or indentation errors. You can open it in Notepad++ or Sublime Text editors for better reference.
- Verify that the JAVA_HOME environment variable specified is correct.
- Verify that PATH environment variable does not point to a different JAVA_HOME. Elasticsearch needs a specific version of JRE to work properly and the your PATH variable may be referencing old JRE path.
- If it still does not work, try deleting your Elasticsearch service and installing it again. Run the following command under admin mode: SC DELETE elasticsearch-service-x64
[…] Tip: If Elasticsearch service does not start or starts and stops, try the troubleshooting steps mentioned in this post: […]
Just adding one more scenario. This error may come If the JAVA_OPTS environment variable is configured already in the system. So remove the variable before you start install.