accesscontrolexception使用java 11启动elasticsearch 5.0.1

cs7cruho  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(1)|浏览(442)

在使用Java11存储从ElasticSearch5.0.1到nfs分区的索引时,我遇到了以下异常。
ElasticSearch日志中的stacktrace:

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中运行良好

eufgjt7s

eufgjt7s1#

要回答有关java版本的问题:
本文中的讨论是说版本6.x将支持Java11。
下面是当前支持的java版本的概述。版本6.5.x支持java 11。
但异常更可能是由于elasic进程在异常消息中没有对filesystem文件夹的写入权限:

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

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

相关问题