安装Elasticsearch遇到的问题(个人)

安装Elasticsearch遇到的问题

warning: ignoring JAVA_HOME=(路径)\jdkXXXX; using bundled JDK
[2024-01-21T14:21:35,292][ERROR][o.e.b.Elasticsearch      ] [WIN-N2RNKF1VIC2] fatal exception while booting Elasticsearch
java.nio.file.NoSuchFileException: E:\Program Files\Java\jdk-17.0.1\lib\dt.jar
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38) ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:197) ~[?:?]
	at java.nio.file.Files.readAttributes(Files.java:1853) ~[?:?]
	at java.util.zip.ZipFile$Source.get(ZipFile.java:1445) ~[?:?]
	at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:251) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:180) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:345) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:316) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:255) ~[?:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:221) ~[elasticsearch-core-8.12.0.jar:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84) ~[elasticsearch-core-8.12.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:181) ~[elasticsearch-8.12.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:72) ~[elasticsearch-8.12.0.jar:?]

看到有教程说需要改jdk配置的classpath。

于是删除了classpath中的%JAVA_HOME%\lib\dt.jar

但还是报错,相同报错内容

还有一种说法是jdk版本冲突,可以改jdk或elasticsearch版本,或者使用elasticsearch自带jdk

我是使用了elasticsearch自带jdk

在elasticsearch的bin目录中,改elasticsearch-env和elasticsearch-env.bat

在elasticsearch-env添加

ES_JAVA_HOME="/home/elasticsearch-8.7.1/jdk/"

在elasticsearch-env.bat中修改

set JAVA="%ES_HOME%\jdk\bin\java.exe"
set JAVA_HOME="%ES_HOME%\jdk"

这是修改后的结果,原先有部分删去了

再次运行

报错为

[2024-01-21T14:59:23,957][ERROR][o.e.b.Elasticsearch      ] [WIN-N2RNKF1VIC2] fatal exception while booting Elasticsearch
java.nio.file.NoSuchFileException: E:\Program Files\Java\jdk-17.0.1\lib\tools.jar
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38) ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:197) ~[?:?]
	at java.nio.file.Files.readAttributes(Files.java:1853) ~[?:?]
	at java.util.zip.ZipFile$Source.get(ZipFile.java:1445) ~[?:?]
	at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:251) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:180) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:345) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:316) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:255) ~[?:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:221) ~[elasticsearch-core-8.12.0.jar:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84) ~[elasticsearch-core-8.12.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:181) ~[elasticsearch-8.12.0.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:72) ~[elasticsearch-8.12.0.jar:?]

于是我又删去classpath中的%JAVA_HOME%\lib\tool.jar

再次运行

报错

[2024-01-21T15:05:17,438][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50390}
[2024-01-21T15:05:17,440][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50391}
[2024-01-21T15:05:17,443][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50392}
[2024-01-21T15:06:32,782][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50417}
[2024-01-21T15:06:32,783][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50418}
[2024-01-21T15:06:32,784][WARN ][o.e.h.n.Netty4HttpServerTransport] [WIN-N2RNKF1VIC2] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:50419}
……

是由于Elasticsearch在Windows下开启了安全认证

修改elasticsearch.yml,true改为false

再运行,成功!

总结

warning: ignoring JAVA_HOME=(路径)\jdkXXXX; using bundled JDK问题:

jdk版本冲突,可以改jdk或elasticsearch版本,或者使用elasticsearch自带jdk

java.nio.file.NoSuchFileException: E:\Program Files\Java\jdk-17.0.1\lib\dt.jar或tool.jar问题:

删去classpath中对应部分

received plaintext http traffic on an https channel, closing connection问题:取消安全认证

文章有参考

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值