安装了ElasticSearch5.5.1后,每次启动服务的时候,都是启动了一下就自动停止了。查看了一下EventViewer, 错误信息如下:

Application: elasticsearch.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: Elastic.ProcessHosts.Process.StartupException

at Elastic.ProcessHosts.Process.ProcessBase.HandleException(System.Exception)

at System.Reactive.ObserverBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception)

at System.Reactive.Observer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception)

at System.Reactive.Linq.ObservableImpl.AsObservable`1+_[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception)

at System.Reactive.AutoDetachObserver`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnErrorCore(System.Exception)

at System.Reactive.ObserverBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception)

at Elastic.ProcessHosts.Process.ObservableProcess+<>c__DisplayClass22_0.<CreateProcessExitSubscription>b__0(System.Reactive.EventPattern`1<System.Object>)

at System.Reactive.AnonymousSafeObserver`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnNext(System.__Canon)

at System.EventHandler.Invoke(System.Object, System.EventArgs)

at System.Diagnostics.Process.OnExited()

at System.Diagnostics.Process.RaiseOnExited()

at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(System.Object, Boolean)

 

看不出来什么。

用命令行定位到ElasticSearch的安装目录,在命令行运行elasticsearch.exe, 错误信息如下:

C:\Program Files\Elastic\Elasticsearch\bin>elasticsearch.exe

java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearc

h : Unsupported major.minor version 52.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14

2)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

 

 

Exception in thread "main"

 

看来是Java的版本不对。然后再在命令行运行elasticsearch.exe --debug-env, 结果如下:

C:\Program Files\Elastic\Elasticsearch\bin>elasticsearch.exe --debug-env

-------------

Elasticsearch

-------------

ES_HOME (in order of precedence)

- HomeDirectoryProcessVariable = C:\Program Files\Elastic\Elasticsearch\

- HomeDirectoryUserVariable =

- HomeDirectoryMachineVariable = C:\Program Files\Elastic\Elasticsearch\

- From executable location = C:\Program Files\Elastic\Elasticsearch

ES_CONFIG (in order of precedence)

- ConfigDirectoryProcessVariable = C:\ProgramData\Elastic\Elasticsearch\config

- ConfigDirectoryUserVariable =

- ConfigDirectoryMachineVariable = C:\ProgramData\Elastic\Elasticsearch\config

- Fallback to ES_HOME = C:\Program Files\Elastic\Elasticsearch\config

 

-------------

Java

-------------

Java paths

- current = C:\Program Files\Java\jdk1.7.0_67\bin\java.exe

Java Candidates (in order of precedence)

- JavaHomeProcessVariable =

- JavaHomeUserVariable =

- JavaHomeMachineVariable =

- JdkRegistry64 = C:\Program Files\Java\jdk1.7.0_67

- JreRegistry64 = C:\Program Files\Java\jre1.8.0_144

- JdkRegistry32 =

- JreRegistry32 = C:\Program Files (x86)\Java\jre1.8.0_111

Java checks

- Using32BitJava = False

- JAVA_HOME as machine and user variable = False

 

搜索了一下错误信息:

org/elasticsearch/bootstrap/Elasticsearc h : Unsupported major.minor

 

上面说的是ElasticSearch5.0至少需要Java8。 于是安装了Java8 Update.

结果还是一样。难道需要重新安装ElasticSearch?

于是卸载重新安装。重新安装了还是不行。

仔细看了一下--debug-env的结果,发现jre虽然已经更新到了8,但是jdk还是7,那么就重新安装JDK8试试吧。

JDK8的下载地址在这里:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

安装后再运行--debug-env, 发现jdk和jre都是8了。

C:\Program Files\Elastic\Elasticsearch\bin>elasticsearch.exe --debug-env

-------------

Elasticsearch

-------------

ES_HOME (in order of precedence)

- HomeDirectoryProcessVariable = C:\Program Files\Elastic\Elasticsearch\

- HomeDirectoryUserVariable =

- HomeDirectoryMachineVariable = C:\Program Files\Elastic\Elasticsearch\

- From executable location = C:\Program Files\Elastic\Elasticsearch

ES_CONFIG (in order of precedence)

- ConfigDirectoryProcessVariable = C:\ProgramData\Elastic\Elasticsearch\config

- ConfigDirectoryUserVariable =

- ConfigDirectoryMachineVariable = C:\ProgramData\Elastic\Elasticsearch\config

- Fallback to ES_HOME = C:\Program Files\Elastic\Elasticsearch\config

 

-------------

Java

-------------

Java paths

- current = C:\Program Files\Java\jdk1.8.0_144\bin\java.exe

Java Candidates (in order of precedence)

- JavaHomeProcessVariable =

- JavaHomeUserVariable =

- JavaHomeMachineVariable =

- JdkRegistry64 = C:\Program Files\Java\jdk1.8.0_144

- JreRegistry64 = C:\Program Files\Java\jre1.8.0_144

- JdkRegistry32 =

- JreRegistry32 = C:\Program Files (x86)\Java\jre1.8.0_111

Java checks

- Using32BitJava = False

- JAVA_HOME as machine and user variable = False

 

再次启动ElasticSearch服务,成功了!不再自动停了。

ElasticSearch无法启动的更多相关文章

  1. 【spring boot】【elasticsearch】spring boot整合elasticsearch,启动报错Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8

    spring boot整合elasticsearch, 启动报错: Caused by: java.lang.IllegalStateException: availableProcessors ], ...

  2. ElasticSearch本人启动报错总结

    1.报错关键代码如下: Exception in thread "main" 2019-04-28 03:53:04,339 main ERROR No log4j2 config ...

  3. elasticsearch开机启动脚本

    最近搭建了一个elasticsearch服务,其中机器重启而ES服务没有重启是问题,就有下面的脚本 #!/bin/sh #chkconfig: #description: es export JAVA ...

  4. ElasticSearch停止启动

    1.查找ES进程 ps -ef | grep elastic 2.杀掉ES进程 kill -9 2382(进程号) 3.重启ES sh elasticsearch -d 注意:elasticsearc ...

  5. Elasticsearch之启动(前台和后台)

    分为两种情况,取决于是否安装了tomat. 一.若安装了tomcat 1.es的前台启动 需要先启动tomcat,再启动es,否则会报错! 所以,得 2.es的后台启动 [hadoop@HadoopM ...

  6. 配置ElasticSearch快捷启动

    在/etc/init.d目录下新建文件elasticsearch #!/bin/sh #chkconfig: 2345 80 05 #description: es #export JAVA_HOME ...

  7. 启动elasticsearch报错

    could not find java; set JAVA_HOME or ensure java is in PATH 首先需要安装java 1.yum list installed |grep j ...

  8. ElasticSearch 在3节点集群的启动

    ElasticSearch的启动分前台和后台启动 先介绍前台启动: 先在master节点上启动 可以看到已经启动了 同时在slave1.slave2节点上也启动 可以看到都已经启动了! 在浏览器分别打 ...

  9. Elasticsearch源码分析 | 单节点的启动和关闭

    本文主要简要介绍Elasticsearch单节点的启动和关闭流程.Elasticsearch版本:6.3.2 相关文章 1.Google Guice 快速入门 2.Elasticsearch 中的 G ...

随机推荐

  1. WPF中的3D变换PlaneProjection

    在UWP中有一个比较好用的伪3D变换PlaneProjection,可以以一种轻量级和非常简单的方式实现3D的效果.这种效果在Silverlight中也有这种变换,但在WPF中确一直没有提供. 虽然W ...

  2. 《Go语言实战》摘录:7.2 并发模式 - pool

    7.2 并发模式 - pool

  3. 源码编译Tkinter

    要让Python支持Tkinter, 需要首先安装tcl和tk两个软件包. 下载地址: http://www.tcl.tk/software/tcltk/download.html 或 tcl:htt ...

  4. 用Qemu搭建x86学习环境

    作者信息 作者:彭东林 邮箱:pengdonglin137@163.com QQ:405728433 软件平台 主机: Ubuntu14.04 64位版本 模拟器:Qemu-2.8.0 Linux内核 ...

  5. 布局控件Grid

    XAML概述 Silverlight的控件绘制是由XAML语言进行支持的.什么是XAML语言? 简单的说,XAML(Extensible Application Markup Language )是一 ...

  6. springcloud超时时间与重试次数配置

    #hystrix配置hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=120000ribbon.Conn ...

  7. Monitoring an IBM JVM with VisualVM

    Monitoring an IBM JVM with VisualVM 分类: Java 2013-06-09 16:15 250人阅读 评论(0) 收藏 举报 JDK6 update 7 and o ...

  8. [web 前端] web本地存储(localStorage、sessionStorage)

    cp from : https://blog.csdn.net/mjzhang1993/article/details/70820868 web 本地存储 (localStorage.sessionS ...

  9. [Web 前端] Jquery 复制元素,并修改属性, 追加到另一个元素后面

    cp from  : https://blog.csdn.net/cooledi/article/details/52813668 jquery 复制元素,并修改属性 $('#ID').clone() ...

  10. VMware vSphere中的HA工作原理介绍

    http://blog.51cto.com/linkinsds/416738 HA全称High Availability.它是VMware的企业应用环境中用来保障企业级应用的不间断运行需求所产生的一个 ...