Elasticsearch从1.4.1升级到1.4.4后无法启动服务

时间:2015-02-20 08:54:01

标签: elasticsearch windows-7-x64

我使用ELS 1.4.1在Windows 7版本x64上成功安装了Elasticsearch。升级到Kibana 4 RTM后,它需要ELS 1.4.4。

为了进行升级,我执行了以下步骤:

  1. 已下载ELS 1.4.4
  2. 停止并删除了ELS 1.4.1服务
  3. 将当前安装目录重命名为elasticsearch_bak
  4. 将1.4.4 zip解压缩到elasticsearch目录
  5. 比较/config/elasticsearch.yml和config / logging.yml并应用更改(底部包含以下附加设置)
  6. # Helps Chrome work properly
    http.cors.allow-origin: "/.*/"
    http.cors.enabled: true
    

    启动服务后,它会在几秒钟内停止。日志如下:

    Java版

    (注意这是出于开发目的)

    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)
    

    事件日志

    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-标准输出-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.
    

    如果我从命令提示符运行elasticsearch,我会收到此错误:

    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)
    

7 个答案:

答案 0 :(得分:24)

我遇到了完全相同的问题,以及我是如何修复的。

这是我的设置

我正在使用Windows Server 2008 R2 Enterprise - 64位版本。 Java(JRE)版本1.8.0_25一切正常。弹性搜索已安装为Windows服务。

在问题发生前我将Java更新为版本1.8.0_31 并重新启动了该计算机。

以下是我采取的步骤的历史

首先重启机器后,我注意到ElasticSearch服务已停止。试图启动它后再次停止。

以下是我在事件日志中遇到的问题:

  

Elasticsearch 1.4.1(elasticsearch-service-x64)服务以服务特定错误终止错误函数..

以下是我在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

然后我已将JAVA_HOME系统变量的值更改为C:\Program Files\Java\jre1.8.0_31

enter image description here

问题是:

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. 我已从ElasticSearch文件夹中完全删除了文件夹binconfiglibplugins

    请务必不要删除data目录,因为找到了索引!

  2. bin解压缩相同的文件夹(configlibelasticsearch-1.4.4.zip)。
  3. 在命令提示符下以管理员身份SC DELETE elasticsearch-service-x64(删除已安装的服务)
  4. 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.
    
  5. 开始服务

  6. 然后一切都开始正常工作

    enter image description here

答案 1 :(得分:18)

我有同样的问题。 它在更新到Java的新版本后出现。虽然我改变了" JAVA_HOME"变量到新的java目录,问题仍然存在。

我转到命令提示符,导航到ES目录并运行以下命令:

{ElasticSearch directory}\bin>service manager

此命令将打开Elasticsearch属性窗口。(http://i.stack.imgur.com/QQEPG.png

然后转到Java选项卡并将 Java虚拟机的路径更改为新版本的Java。之后才运行ES服务

{ElasticSearch directory}\bin>service start

答案 2 :(得分:11)

问题是由与{Elastic}分发的service.bat引起的,它依赖Apache Common Procrun并使用未正确解析的环境变量%JAVA_HOME%设置JVM。

所以我通过在service.bat manager出现的GUI上设置“Default JVM”来修复此问题。

通过命令行解决问题的另一种方法是

elasticsearch-service-x64.exe //US//YOUR_SERVICE_NAME --Jvm auto

elasticsearch-service-x64.exe //US//elasticsearch-service-x64 --Jvm auto

答案 3 :(得分:3)

将JDK从jdk1.7.0_21更新为jdk1.8.0_77。更改了Java_Home,它开始工作正常。

答案 4 :(得分:1)

我安装了另一个版本的elasticsearch。简单地删除旧版本对我有用。

elasticsearch-2.0.0 \ bin> service remove

答案 5 :(得分:1)

对我有用的是运营"服务经理"在bin文件夹中并将JVM设置为默认值。

答案 6 :(得分:0)

我遇到了同样的问题,即使使用了正确的JAVA_HOME系统变量集,它也无法正常工作。

最后我导航到弹性搜索安装的bin文件夹并运行:

service manager

在管理器中,在Java选项卡下,我设置了这些选项

-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

保存更改,然后运行

service start