问题
I have installed Elasticsearch successfully on Windows 7 version x64, using ELS 1.4.1. After upgrading to Kibana 4 RTM, it required ELS 1.4.4.
To carry out the upgrade, I performed the following steps:
- Downloaded ELS 1.4.4
- Stopped and removed the ELS 1.4.1 service
- Renamed the current install directory to elasticsearch_bak
- Extracted the 1.4.4 zip to the elasticsearch directory
- Compared the /config/elasticsearch.yml and config/logging.yml and applied the changes (which contains the following additional settings at the bottom)
# Helps Chrome work properly
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
Upon starting the service, it stops within a few seconds. The logs are as follows:
Java Version
(Note this is for development purposes)
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)
Event Log
The Elasticsearch 1.4.4 (elasticsearch) service terminated with service-specific error Incorrect function..
elasticsearch-stderr-2015.05.20.log
2015-02-20 08:49:13 Commons Daemon procrun stderr initialized
Exception in thread "main" ror: Could not initialize class org.elasticsearch.Version
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
The data area passed to a system call is too small.
Failed to start service
elasticsearch-stdout-2015.05.20.log
2015-02-20 08:46:03 Commons Daemon procrun stdout initialized
elasticsearch.2015-02-20.log
[2015-02-20 08:49:14] [info] ( prunsrv.c:1284) [ 8560] Service started in 1198 ms.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 4, 0, 0, 0
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1528) [ 8560] Waiting for worker to finish...
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1533) [ 8560] Worker finished.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1559) [ 8560] Waiting for all threads to exit
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 3, 0, 0, 0
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1563) [ 8560] JVM destroyed.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 1, 1066, 0, 1
[2015-02-20 08:49:14] [info] ( prunsrv.c:1598) [10064] Run service finished.
[2015-02-20 08:49:14] [info] ( prunsrv.c:1764) [10064] Commons Daemon procrun finished
[2015-02-20 08:49:14] [info] ( prunsrv.c:1764) [10064] Commons Daemon procrun finished
[2015-02-20 08:49:16] [error] ( prunsrv.c:746 ) [10116] Failed to start 'elasticsearch' service
[2015-02-20 08:49:16] [error] ( prunsrv.c:746 ) [10116] The data area passed to a system call is too small.
[2015-02-20 08:49:16] [info] ( prunsrv.c:754 ) [10116] Start service finished.
[2015-02-20 08:49:16] [error] ( prunsrv.c:1755) [10116] Commons Daemon procrun failed with exit value: 5 (Failed to start service)
[2015-02-20 08:49:16] [error] ( prunsrv.c:1755) [10116] The data area passed to a system call is too small.
If I run elasticsearch from the command prompt, I get this error:
c:\elk\elasticsearch\bin>elasticsearch
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
回答1:
I had the exact same issue and here is how I've fixed it.
Here is my setup
I am using Windows Server 2008 R2 Enterprise
- 64-bit version. Everything worked fine with Java (JRE) version 1.8.0_25
. Elastic search was installed as Windows Service.
Exactly before the issue I updated Java to version 1.8.0_31
and restarted the machine.
Here is the history of steps I took
Firstly after restarting the machine I've noticed that ElasticSearch service was stopped. After trying to start it it stopped again.
Here is what I get in my Events Log for the issue:
The Elasticsearch 1.4.1 (elasticsearch-service-x64) service terminated with service-specific error Incorrect function..
Here is what I had in my elasticsearch-service-x64.2015-02-27.log
:
[2015-02-27 14:38:29] [info] [ 4948] Commons Daemon procrun (1.0.15.0 64-bit) started
[2015-02-27 14:38:29] [info] [ 4948] Running 'elasticsearch-service-x64' Service...
[2015-02-27 14:38:29] [info] [ 3048] Starting service...
[2015-02-27 14:38:29] [error] [ 3048] Failed creating java C:\Program Files\Java\jre1.8.0_25\bin\server\jvm.dll
[2015-02-27 14:38:29] [error] [ 3048] The system cannot find the path specified.
[2015-02-27 14:38:29] [error] [ 3048] ServiceStart returned 1
[2015-02-27 14:38:29] [error] [ 3048] The system cannot find the path specified.
[2015-02-27 14:38:29] [info] [ 4948] Run service finished.
[2015-02-27 14:38:29] [info] [ 4948] Commons Daemon procrun finished
Then I've changed the value of JAVA_HOME
system variable to C:\Program Files\Java\jre1.8.0_31

The issue then was:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
What fixed the problem
I've completely deleted folders
bin
,config
,lib
andplugins
from the ElasticSearch folder.Be sure to not to delete
data
directory because there are located your indexes!- Unzipped the same folders (
bin
,config
andlib
) fromelasticsearch-1.4.4.zip
. - Ran
SC DELETE elasticsearch-service-x64
as administrator in Command Prompt (to delete the installed service) Ran
F:\Services\elasticsearch\bin>service.bat install
Installing service : "elasticsearch-service-x64" Using JAVA_HOME (64-bit): "C:\Program Files\Java\jre1.8.0_31" The service 'elasticsearch-service-x64' has been installed.
Started the service
And then everything started to work correctly.

回答2:
I have the same problem. Its appear after update to new version of Java. Although I change value of "JAVA_HOME" variable to new java directory, the problem stay.
Than I go to command prompt, navigate to ES directory and run the following command:
{ElasticSearch directory}\bin>service manager
This command will open Elasticsearch properties window.(http://i.stack.imgur.com/QQEPG.png)
Than go to Java tab and change path of Java Virtual Machine to new version of Java. After that just run ES service
{ElasticSearch directory}\bin>service start
回答3:
The issue is caused by service.bat
distributed with Elastic which rely on Apache Common Procrun and sets the JVM using the environment variable %JAVA_HOME%
which is not resolved correctly.
So I fixed the issue by setting "Default JVM" on the GUI that appears with service.bat manager
.
Another way to fix the issue via command line is
elasticsearch-service-x64.exe //US//YOUR_SERVICE_NAME --Jvm auto
i.e.
elasticsearch-service-x64.exe //US//elasticsearch-service-x64 --Jvm auto
回答4:
Updated the JDK from jdk1.7.0_21 to jdk1.8.0_77.Changed the Java_Home and it started working fine.
回答5:
I had another version of elasticsearch installed. Simply removing old version worked for me.
elasticsearch-2.0.0\bin>service remove
回答6:
What worked for me was to run "service manager" within the bin folder and set the JVM to default.
回答7:
I ran into the same issue, and even with the proper JAVA_HOME system variable set, it did not work.
Eventually I navigated to the bin folder of my elastic search install and ran:
service manager
Within the manager, under the Java tab, I set these options
-Delasticsearch
-Des.path.home=C:\elasticsearch-2.4.5
-Des.default.path.logs=C:\elasticsearch-2.4.5\logs
-Des.default.path.data=C:\elasticsearch-2.4.5\data
-Des.default.path.conf=C:\elasticsearch-2.4.5\config
Saved the changes, and then ran
service start
来源:https://stackoverflow.com/questions/28624943/cannot-start-service-after-elasticsearch-upgrade-from-1-4-1-to-1-4-4