赞
踩
在windows上搭建elasticsearch的时候,启动服务起不来
看日志报错如下信息:
[2023-10-31T16:56:21,138][ERROR][o.e.b.Bootstrap ] [WNT123s] Exception java.lang.SecurityException: Security misconfiguration: cannot access java.io.tmpdir at org.elasticsearch.bootstrap.Security.selfTest(Security.java:423) ~[elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Security.configure(Security.java:133) ~[elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:216) ~[elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) [elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-7.2.0.jar:7.2.0] at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) [elasticsearch-7.2.0.jar:7.2.0] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.2.0.jar:7.2.0] Caused by: java.lang.SecurityException: Unable to create temporary file or directory at java.nio.file.TempFileHelper.create(TempFileHelper.java:142) ~[?:?] at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:160) ~[?:?] at java.nio.file.Files.createTempFile(Files.java:915) ~[?:?] at org.elasticsearch.bootstrap.Security.selfTest(Security.java:416) ~[elasticsearch-7.2.0.jar:7.2.0] ... 10 more
解决方案:
1、解压缩elasticsearch之后会出现一个jna–1391746105这个文件夹,找到它
在elasticsearch/bin目录中打开cmd命令框
输入:.\elasticsearch-service manager
找到如图所示-Djava.io.tmpdir=
将jna–1391746105的路径填到这里就可以了
2、重启elasticsearch服务,成功解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。