在Elasticsearch 官网下载了一个es的安装包,准备放在windows电脑上研究研究,下载下来之后启动报错。
JDK问题
jdk版本对应
warning: ignoring JAVA_HOME=E:\dev\jdk\jdk17\jdk-17.0.10; using bundled JDK
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8506048512 bytes for G1 virtual space
# An error report file with more information is saved as:
# logs/hs_err_pid18980.log
error:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000605000000, 8506048512, 0) failed; error='???????С?????????????' (DOS error/errno=1455)
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:120)
at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:87)
at org.elasticsearch.server.cli.JvmErgonomics.choose(JvmErgonomics.java:36)
at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:139)
at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:91)
at org.elasticsearch.server.cli.ServerProcess.createProcess(ServerProcess.java:208)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:104)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:88)
at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:247)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:100)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
度娘很多次,搜索warning: ignoring JAVA_HOME=E:\dev\jdk\jdk1.8; using bundled JDK
大多说的是JDK版本不一致,因此我又去下载了很多高版本的JDK,发现结果是一样的
warning: ignoring JAVA_HOME=E:\dev\jdk\jdk17; using bundled JDK
后面在elasticsearch-env.bat文件中发现他使用的是ES_JAVA_HOME,然后在环境变量中添加了ES_JAVA_HOME对应jdk17
内存问题
当然没有这么顺利一下子就弄好了,改完这个之后,发现还是报错
warning: ignoring JAVA_HOME=E:\dev\jdk\jdk17; using ES_JAVA_HOME
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8506048512 bytes for G1 virtual space
# An error report file with more information is saved as:
# logs/hs_err_pid8088.log
error:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000605000000, 8506048512, 0) failed; error='???????С?????????????' (DOS error/errno=1455)
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:120)
at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:87)
at org.elasticsearch.server.cli.JvmErgonomics.choose(JvmErgonomics.java:36)
at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:139)
at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:91)
at org.elasticsearch.server.cli.ServerProcess.createProcess(ServerProcess.java:208)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:104)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:88)
at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:247)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:100)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
warning: ignoring JAVA_HOME=E:\dev\jdk\jdk17; using ES_JAVA_HOME,这里已经发现他没有JDK的问题了,后面的意思是存在内存问题。
在jvm.options配置文件中,发现内存的配置是注释掉的,然后用的是多少我也不太清楚,当我把他修改为4g(把注释放开)后,就正常运行了
另外发现乱码的话,可以在文件中添加 -Dfile.encoding=GBK
SSL/TLS权限问题
当我看到启动成功,满环信心的时候,发现页面访问失败。
多方寻找后,发现有可能是权限问题,尝试用https去访问,发现访问成功了。
确认了是权限问题后,在elasticsearch.yml里面把这两个配置为false
再次访问localhost:9200,成功!
参考博客
jdk17安装 elasticsearch8 遇到的一个坑
Elasticsearch showing received plaintext http traffic on an https channel in console - Stack Overflow文章来源:https://www.toymoban.com/news/detail-843593.html
官方文档文章来源地址https://www.toymoban.com/news/detail-843593.html
到了这里,关于安装Elasticsearch 8.12.2版本出现的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!