I am trying to start elasticsearch on windows.
ES 5.0.0, JDK 1.8.0.66, Windows 10
Service is installed properly but failed to start.
D:\Softwares\Elastic_Project\elasticsearch-5.0.0\bin>elasticsearch-service install
C:\Program Files\Java\jdk1.8.0_66
Installing service : "elasticsearch-service-x64"
Using JAVA_HOME (64-bit): "C:\Program Files\Java\jdk1.8.0_66"
The service 'elasticsearch-service-x64' has been installed.
D:\Softwares\Elastic_Project\elasticsearch-5.0.0\bin>elasticsearch-service start
C:\Program Files\Java\jdk1.8.0_66
Failed starting 'elasticsearch-service-x64' service
Logs
[2016-11-24 14:21:19] [info] [11120] Commons Daemon procrun (1.0.15.0 64-bit) started
[2016-11-24 14:21:20] [info] [11120] Starting service 'elasticsearch-service-x64' ...
[2016-11-24 14:21:20] [info] [11572] Commons Daemon procrun (1.0.15.0 64-bit) started
[2016-11-24 14:21:20] [info] [11572] Running 'elasticsearch-service-x64' Service...
[2016-11-24 14:21:20] [info] [ 5916] Starting service...
[2016-11-24 14:21:21] [info] [ 5916] Service started in 1487 ms.
[2016-11-24 14:21:21] [info] [11572] Run service finished.
[2016-11-24 14:21:21] [info] [11572] Commons Daemon procrun finished
[2016-11-24 14:21:23] [error] [11120] Failed to start 'elasticsearch-service-x64' service
[2016-11-24 14:21:23] [error] [11120] The data area passed to a system call is too small.
[2016-11-24 14:21:23] [info] [11120] Start service finished.
[2016-11-24 14:21:23] [error] [11120] Commons Daemon procrun failed with exit value: 5 (Failed to start service)
[2016-11-24 14:21:23] [error] [11120] The data area passed to a system call is too small.
I have added JAVA_HOME in system variable. System logs
The Elasticsearch 5.0.0 (elasticsearch-service-x64) service terminated with the following service-specific error:
Incorrect function.
Any help ?
In Windows 7 on a system that had Java 1.7 then upgraded to Oracle Java 1.8 SDK (jdk-8u45-windows-x64.exe) the system JAVA_HOME was different to the JAVA_HOME in the elasticsearch manager and a different version of java was in the path. Also, elasticsearch-service install failed as the system was not loading Java 8.
Set the system JAVA_HOME to the correct folder:
C:\Progra~1\Java\jre1.8.0_45
Check that JAVA_HOME is set and java works:
java -version
echo %JAVA_HOME%
If this fails then eleasticsearch-service install
won't work.
To fix in a DOS prompt:
set JAVA_HOME=C:\Progra~1\Java\jre1.8.0_45
path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%
Check the JAVA_PATH value in Elasticsearch manager and fix it if required. Open the manager program from a DOS prompt:
elasticsearch-service.bat manager
from a DOS prompt.%JAVA_HOME%\bin\server\jvm.dll
C:\Program Files\Java\jdk1.8.0_45\jre\bin\server\jvm.dll
Removing and re-adding the elasticsearch service may be needed:
elasticsearch-service.bat remove
elasticsearch-service.bat install
Open elasticsearch in a browser using the settings in config\elasticsearch.yml to check that it is running:
http://localhost:9200/
I had the same problem. I could find the cause of the issue by looking up the log file at e.g. ~/elasticsearch-5.2.1/log/elasticsearch-service-x64.2017-02-20. It complained about "Failed creating java %JAVA_HOME%\jre\bin\server\jvm.dll". So, I reset JAVA_HOME as system variable (not user variable) in environment variables, and it's resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With