愚者求师之过,智者从师之长。

新人求助。es7.16.1启动报错

Elasticsearch | 作者 Peterrin | 发布于2022年07月11日 | 阅读数:1845

es7.16.1用自带的jdk启动报:Caused by: java.security.AccessControlException: access denied ("java.lang.management.ManagementPermission" "control"),网上搜的加java.permission语句也加了
已邀请:

Peterrin

赞同来自:

启动全过程的日志
 

God_lockin

赞同来自:

看起来是加载你ik分词器的时候出的问题,这部分的路径、读写权限……检查下

Peterrin

赞同来自:

现在我使用系统的jdk启动能正常启动了,但是一段时间后es服务还是会掉,报错日志还是这个:Caused by: java.security.AccessControlException: access denied ("java.lang.management.ManagementPermission" "control")
 
  

[2022-07-12T22:41:33,491][INFO ][o.e.x.s.a.AuthorizationService] [node-1] Took [189ms] to resolve [35] indices for action [indices:admin/refresh] and user [elastic]
[2022-07-12T23:06:22,590][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] fatal error in thread [elasticsearch[node-1][masterService#updateTask][T#1]], exiting
java.lang.ExceptionInInitializerError: null
at oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource.<clinit>(BlockSource.java:402) ~[?:?]
at oracle.jdbc.driver.BlockSource.createBlockSource(BlockSource.java:80) ~[?:?]
at oracle.jdbc.driver.BlockSource.createBlockSource(BlockSource.java:70) ~[?:?]
at oracle.jdbc.driver.PhysicalConnection.setBlockSource(PhysicalConnection.java:593) ~[?:?]
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:631) ~[?:?]
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:398) ~[?:?]
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31) ~[?:?]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566) ~[?:?]
at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_282]
at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_282]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DBRemoteSynonymFile.getLastModify(DBRemoteSynonymFile.java:148) ~[?:?]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DBRemoteSynonymFile.isNeedReloadSynonymMap(DBRemoteSynonymFile.java:124) ~[?:?]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DBRemoteSynonymFile.<init>(DBRemoteSynonymFile.java:54) ~[?:?]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getSynonymFile(DynamicSynonymTokenFilterFactory.java:173) ~[?:?]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.buildSynonyms(DynamicSynonymTokenFilterFactory.java:161) ~[?:?]
at com.sunwayworld.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getChainAwareTokenFilterFactory(DynamicSynonymTokenFilterFactory.java:111) ~[?:?]
at org.elasticsearch.index.analysis.AnalyzerComponents.createComponents(AnalyzerComponents.java:80) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.analysis.CustomAnalyzerProvider.create(CustomAnalyzerProvider.java:57) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.analysis.CustomAnalyzerProvider.build(CustomAnalyzerProvider.java:40) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.analysis.AnalysisRegistry.produceAnalyzer(AnalysisRegistry.java:695) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:612) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:218) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:454) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:720) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.indices.IndicesService.withTempIndexService(IndicesService.java:663) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexWithTemporaryService(MetadataCreateIndexService.java:451) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequestWithV1Templates(MetadataCreateIndexService.java:567) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:413) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:420) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService$1.execute(MetadataCreateIndexService.java:319) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:51) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:836) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:403) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:243) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.MasterService.access$100(MasterService.java:63) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:170) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:146) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:202) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:718) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:262) ~[elasticsearch-7.16.1.jar:7.16.1]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:225) ~[elasticsearch-7.16.1.jar:7.16.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_282]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_282]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.security.AccessControlException: access denied ("java.lang.management.ManagementPermission" "control")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_282]
at java.security.AccessController.checkPermission(AccessController.java:886) ~[?:1.8.0_282]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_282]
at sun.management.Util.checkAccess(Util.java:77) ~[?:?]
at sun.management.Util.checkControlAccess(Util.java:85) ~[?:?]
at sun.management.MemoryPoolImpl.setCollectionUsageThreshold(MemoryPoolImpl.java:215) ~[?:?]
at oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaserListener$1.run(BlockSource.java:376) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_282]
at oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaserListener.<init>(BlockSource.java:374) ~[?:?]
at oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaserListener.<clinit>(BlockSource.java:348) ~[?:?]
... 44 more

Peterrin

赞同来自:

问题解决了 ,在java.police文件中添加如下语句赋予报错相关的权限。
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.security.SecurityPermission "putProviderProperty.MySQLScramShaSasl";
permission java.security.SecurityPermission "insertProvider.MySQLScramShaSasl";
permission java.lang.management.ManagementPermission "control";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.krb5";

要回复问题请先登录注册