记录elasticsearch-analysis-dynamic-synonym从8.15.0升级到8.16.0所遇到的问题

记录elasticsearch-analysis-dynamic-synonym从8.15.0升级到8.16.0所遇到的问题

一、打包步骤

步骤一、linux系统下执行elasticsearch-module中的build.sh脚本

步骤二、maven环境下elasticsearch-cluster-runner执行maven install命令安装到本地maven仓库。

步骤三、修改版本号打包插件

二、记录步骤一到步骤二出现的问题

8.15.0是有这两个包的,但是到了8.16.0官方将这两个包去除了,看PR记录大致理由是说plugin-classloader这个插件类加载器重复了,去除了也不影响elasticsearch的正常工作,但是我一脸疑问,哥们您们没有考虑到下游插件synonym呀,这就属实有点难崩了,不过就这小问题,难不倒博主,我细看一下代码记录就知道如何解决问题了。

elasticsearch-cluster-runnerpom.xml这部分代码删除就可以了,然后继续maven install就没有问题啦。

三、将打包好的文件解压缩到es的plugin目录下出现数据库权限问题

当我装好同义词插件之后,发现了这个问题,经过我多番思考之后,看了一下日志,原来是权限的问题。

[2024-11-18T23:08:25,151][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [JAVAGPT] fatal error in thread [elasticsearch[JAVAGPT][clusterApplierService#updateTask][T#1]], exiting
java.lang.ExceptionInInitializerError: null
    at com.mysql.cj.protocol.a.NativeAuthenticationProvider.loadAuthenticationPlugins(NativeAuthenticationProvider.java:246) ~[?:?]
    at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:387) ~[?:?]
    at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) ~[?:?]
    at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) ~[?:?]
    at com.mysql.cj.NativeSession.connect(NativeSession.java:157) ~[?:?]
    at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) ~[?:?]
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ~[?:?]
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[?:?]
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[?:?]
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[?:?]
    at java.sql.DriverManager.getConnection(DriverManager.java:682) ~[java.sql:?]
    at java.sql.DriverManager.getConnection(DriverManager.java:230) ~[java.sql:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.getConnection(MySqlRemoteSynonymFile.java:244) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.getMySqlSynonymLastModify(MySqlRemoteSynonymFile.java:156) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.isNeedReloadSynonymMap(MySqlRemoteSynonymFile.java:134) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.<init>(MySqlRemoteSynonymFile.java:106) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getSynonymFile(DynamicSynonymTokenFilterFactory.java:159) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.buildSynonyms(DynamicSynonymTokenFilterFactory.java:148) ~[?:?]
    at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getChainAwareTokenFilterFactory(DynamicSynonymTokenFilterFactory.java:98) ~[?:?]
    at org.elasticsearch.index.analysis.AnalyzerComponents.createComponents(AnalyzerComponents.java:83) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.analysis.CustomAnalyzerProvider.create(CustomAnalyzerProvider.java:61) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.analysis.CustomAnalyzerProvider.build(CustomAnalyzerProvider.java:43) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.analysis.AnalysisRegistry.produceAnalyzer(AnalysisRegistry.java:708) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:616) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:214) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:511) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:761) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:651) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:189) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:582) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.cluster.IndicesClusterStateService.doApplyClusterState(IndicesClusterStateService.java:306) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:260) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:544) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:530) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:503) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:432) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:157) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:956) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:218) ~[elasticsearch-8.16.0.jar:?]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:184) ~[elasticsearch-8.16.0.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1575) ~[?:?]
Caused by: java.security.AccessControlException: access denied ("java.security.SecurityPermission" "insertProvider")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:488) ~[?:?]
    at java.security.AccessController.checkPermission(AccessController.java:1085) ~[?:?]
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:411) ~[?:?]
    at java.lang.SecurityManager.checkSecurityAccess(SecurityManager.java:1517) ~[?:?]
    at java.security.Security.checkInsertProvider(Security.java:802) ~[?:?]
    at java.security.Security.insertProviderAt(Security.java:341) ~[?:?]
    at java.security.Security.addProvider(Security.java:385) ~[?:?]
    at com.mysql.cj.protocol.a.authentication.AuthenticationLdapSaslClientPlugin.<clinit>(AuthenticationLdapSaslClientPlugin.java:59) ~[?:?]
    ... 43 more
    Suppressed: java.security.AccessControlException: access denied ("java.security.SecurityPermission" "insertProvider.MySQLScramSha1Sasl")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:488) ~[?:?]
        at java.security.AccessController.checkPermission(AccessController.java:1085) ~[?:?]
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:411) ~[?:?]
        at java.lang.SecurityManager.checkSecurityAccess(SecurityManager.java:1517) ~[?:?]
        at java.security.Security.checkInsertProvider(Security.java:805) ~[?:?]
        at java.security.Security.insertProviderAt(Security.java:341) ~[?:?]
        at java.security.Security.addProvider(Security.java:385) ~[?:?]
        at com.mysql.cj.protocol.a.authentication.AuthenticationLdapSaslClientPlugin.<clinit>(AuthenticationLdapSaslClientPlugin.java:59) ~[?:?]
        at com.mysql.cj.protocol.a.NativeAuthenticationProvider.loadAuthenticationPlugins(NativeAuthenticationProvider.java:246) ~[?:?]
        at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:387) ~[?:?]
        at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) ~[?:?]
        at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) ~[?:?]
        at com.mysql.cj.NativeSession.connect(NativeSession.java:157) ~[?:?]
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) ~[?:?]
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ~[?:?]
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[?:?]
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[?:?]
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:682) ~[java.sql:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:230) ~[java.sql:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.getConnection(MySqlRemoteSynonymFile.java:244) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.getMySqlSynonymLastModify(MySqlRemoteSynonymFile.java:156) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.isNeedReloadSynonymMap(MySqlRemoteSynonymFile.java:134) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.MySqlRemoteSynonymFile.<init>(MySqlRemoteSynonymFile.java:106) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getSynonymFile(DynamicSynonymTokenFilterFactory.java:159) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.buildSynonyms(DynamicSynonymTokenFilterFactory.java:148) ~[?:?]
        at com.bellszhu.elasticsearch.plugin.synonym.analysis.DynamicSynonymTokenFilterFactory.getChainAwareTokenFilterFactory(DynamicSynonymTokenFilterFactory.java:98) ~[?:?]
        at org.elasticsearch.index.analysis.AnalyzerComponents.createComponents(AnalyzerComponents.java:83) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.analysis.CustomAnalyzerProvider.create(CustomAnalyzerProvider.java:61) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.analysis.CustomAnalyzerProvider.build(CustomAnalyzerProvider.java:43) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.analysis.AnalysisRegistry.produceAnalyzer(AnalysisRegistry.java:708) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:616) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:214) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:511) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:761) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:651) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:189) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:582) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.doApplyClusterState(IndicesClusterStateService.java:306) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:260) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:544) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:530) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:503) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:432) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:157) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:956) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:218) ~[elasticsearch-8.16.0.jar:?]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:184) ~[elasticsearch-8.16.0.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1575) ~[?:?]

于是我就去修改elasticsearch-8.16.0\jdk\conf\security\java.policy文件,加入SocketPermission、RuntimePermission和SecurityPermission这几行,重启之后完美解决问题。

//
// This system policy file grants a set of default permissions to all domains
// and can be configured to grant additional permissions to modules and other
// code sources. The code source URL scheme for modules linked into a
// run-time image is "jrt".
//
// For example, to grant permission to read the "foo" property to the module
// "com.greetings", the grant entry is:
//
// grant codeBase "jrt:/com.greetings" {
//     permission java.util.PropertyPermission "foo", "read";
// };
//

// default permissions granted to all domains
grant {
    // allows anyone to listen on dynamic ports
    permission java.net.SocketPermission "localhost:0", "listen";

    // "standard" properties that can be read by anyone
    permission java.util.PropertyPermission "java.version", "read";
    permission java.util.PropertyPermission "java.vendor", "read";
    permission java.util.PropertyPermission "java.vendor.url", "read";
    permission java.util.PropertyPermission "java.class.version", "read";
    permission java.util.PropertyPermission "os.name", "read";
    permission java.util.PropertyPermission "os.version", "read";
    permission java.util.PropertyPermission "os.arch", "read";
    permission java.util.PropertyPermission "file.separator", "read";
    permission java.util.PropertyPermission "path.separator", "read";
    permission java.util.PropertyPermission "line.separator", "read";
    permission java.util.PropertyPermission
                   "java.specification.version", "read";
    permission java.util.PropertyPermission
                   "java.specification.maintenance.version", "read";
    permission java.util.PropertyPermission "java.specification.vendor", "read";
    permission java.util.PropertyPermission "java.specification.name", "read";
    permission java.util.PropertyPermission
                   "java.vm.specification.version", "read";
    permission java.util.PropertyPermission
                   "java.vm.specification.vendor", "read";
    permission java.util.PropertyPermission
                   "java.vm.specification.name", "read";

    permission java.net.SocketPermission "*", "connect,resolve";
    permission java.lang.RuntimePermission "setContextClassLoader";
    permission java.lang.RuntimePermission "accessDeclaredMembers";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.security.SecurityPermission "putProviderProperty.MySQLScramSha1Sasl";
    permission java.security.SecurityPermission "insertProvider";

    permission java.util.PropertyPermission "java.vm.version", "read";
    permission java.util.PropertyPermission "java.vm.vendor", "read";
    permission java.util.PropertyPermission "java.vm.name", "read";
};

编程精选网(www.codehuber.com),程序员的终身学习网站已上线!

如果这篇【文章】有帮助到你,希望可以给【JavaGPT】点个赞👍,创作不易,如果有对【后端技术】、【前端领域】感兴趣的小可爱,也欢迎关注❤️❤️❤️ 【JavaGPT】❤️❤️❤️,我将会给你带来巨大的【收获与惊喜】💝💝💝!

本文由博客一文多发平台 OpenWrite 发布!

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,222评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,455评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,720评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,568评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,696评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,879评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,028评论 3 409
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,773评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,220评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,550评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,697评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,360评论 4 332
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,002评论 3 315
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,782评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,010评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,433评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,587评论 2 350

推荐阅读更多精彩内容