gpt4 book ai didi

java - 使用 Java 11 启动 Elastic Search 5.0.1 时出现 AccessControlException

转载 作者:太空宇宙 更新时间:2023-11-04 09:57:02 34 4
gpt4 key购买 nike

使用 Java 11 将索引从 Elastic Search 5.0.1 存储到 NFS 分区时遇到以下异常。

来自 Elasticsearch 日志的堆栈跟踪:

java.security.AccessControlException: access denied ("java.io.FilePermission" "/globalSearchElkData/nodes/0" "write")
at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
at java.base/java.security.AccessController.checkPermission(AccessController.java:895) ~[?:?]
at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322) ~[?:?]
at java.base/java.lang.SecurityManager.checkWrite(SecurityManager.java:752) ~[?:?]
at java.base/sun.nio.fs.UnixPath.checkWrite(UnixPath.java:824) ~[?:?]
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:377) ~[?:?]
at java.base/java.nio.file.Files.createDirectory(Files.java:689) ~[?:?]
at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:796) ~[?:?]
at java.base/java.nio.file.Files.createDirectories(Files.java:742) ~[?:?]
at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:92) ~[lucene-core-6.2.1.jar:6.2.1 43ab70147eb494324a1410f7a9f16a896a59bc6f - shalin - 2016-09-15 05:15:20]
at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-6.2.1.jar:6.2.1 43ab70147eb494324a1410f7a9f16a896a59bc6f - shalin - 2016-09-15 05:15:20]
at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-6.2.1.jar:6.2.1 43ab70147eb494324a1410f7a9f16a896a59bc6f - shalin - 2016-09-15 05:15:20]
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:225) ~[elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.node.Node.<init>(Node.java:240) ~[elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.node.Node.<init>(Node.java:220) ~[elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:191) ~[elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:191) ~[elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.cli.Command.main(Command.java:62) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-5.0.1.jar:5.0.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) [elasticsearch-5.0.1.jar:5.0.1]
[2018-12-28T10:50:38,107][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]

注意:相同的设置在 Java8 上运行良好

最佳答案

回答有关Java版本的问题:

this thread中的讨论据说 6.x 版本将支持 Java 11。

Here是当前支持的 Java 版本的概述。版本 6.5.x 支持 Java 11。

但是该异常更可能是由异常消息中的 elasic 进程没有对文件系统文件夹的写入权限引起的:

access denied ("java.io.FilePermission" "/globalSearchElkData/nodes/0" "write")

请检查文件夹/globalSearchElkData/nodes/0的权限

关于java - 使用 Java 11 启动 Elastic Search 5.0.1 时出现 AccessControlException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54007420/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com