cannot set to file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.4.2.jar“

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介: cannot set to file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.4.2.jar“

java.lang.IllegalStateException: codebase property already set: codebase.elasticsearch-analysis-ik -> file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.14.1.jar, cannot set to file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.4.2.jar"


安装ik分词器的时候,一直安装不成功,后面发现是安装的时候,是传过去虚拟机那边的,先下了7.14的版本,后面下了7.4.2的版本,然后解压到同一个目录下出现了jar包冲突了。


解决方法:


rm -rf elasticsearch-analysis-ik-7.14.1.jar


移除冲突的jar包


然后重新启动es


docker restart xxx


docker ps -a


最后的结果


42334bf19e9042dabf9656a948129232.png


docker logs xxx查看日志

测试

POST _analyze
{
  "analyzer": "ik_smart",
  "text": "我是中国人"
}
{
  "tokens" : [
    {
      "token" : "我",
      "start_offset" : 0,
      "end_offset" : 1,
      "type" : "CN_CHAR",
      "position" : 0
    },
    {
      "token" : "是",
      "start_offset" : 1,
      "end_offset" : 2,
      "type" : "CN_CHAR",
      "position" : 1
    },
    {
      "token" : "中国人",
      "start_offset" : 2,
      "end_offset" : 5,
      "type" : "CN_WORD",
      "position" : 2
    }
  ]
}

2805711d10434c799f985f53e53d8bd4.png

{"type": "server", "timestamp": "2023-01-01T03:21:10,415Z", "level": "WARN", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "7e12af5c1c7f", "message": "uncaught exception in thread [main]", 
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: codebase property already set: codebase.elasticsearch-analysis-ik -> file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.14.1.jar, cannot set to file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.4.2.jar",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.4.2.jar:7.4.2]",
"at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.4.2.jar:7.4.2]",
"Caused by: java.lang.IllegalStateException: codebase property already set: codebase.elasticsearch-analysis-ik -> file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.14.1.jar, cannot set to file:/usr/share/elasticsearch/plugins/ik/elasticsearch-analysis-ik-7.4.2.jar",
"at org.elasticsearch.bootstrap.Security.readPolicy(Security.java:226) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Security.getPluginPermissions(Security.java:184) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Security.configure(Security.java:121) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:216) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.4.2.jar:7.4.2]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.4.2.jar:7.4.2]",
"... 6 more"] }
相关实践学习
利用Elasticsearch实现地理位置查询
本实验将分别介绍如何使用Elasticsearch7.10版本进行全文检索、多语言检索和地理位置查询三个Elasticsearch基础检索子场景的实现。
ElasticSearch 入门精讲
ElasticSearch是一个开源的、基于Lucene的、分布式、高扩展、高实时的搜索与数据分析引擎。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr(也是基于Lucene)。 ElasticSearch的实现原理主要分为以下几个步骤: 用户将数据提交到Elastic Search 数据库中 通过分词控制器去将对应的语句分词,将其权重和分词结果一并存入数据 当用户搜索数据时候,再根据权重将结果排名、打分 将返回结果呈现给用户 Elasticsearch可以用于搜索各种文档。它提供可扩展的搜索,具有接近实时的搜索,并支持多租户。
相关文章
|
2月前
|
资源调度 前端开发
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
123 0
|
设计模式 Java 开发者
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
|
18天前
|
缓存 安全
max file descriptors [65535] for elasticsearch process is too low,【已解决】
max file descriptors [65535] for elasticsearch process is too low,【已解决】
20 1
|
9月前
|
JavaScript API
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
141 0
|
2月前
|
开发工具
百度搜索:蓝易云【使用vim编辑器,进行保存时报错:E382: Cannot write, ‘buftype‘ option is set详解。】
请注意,'buftype'选项的设置通常是由于某些插件或配置文件导致的。如果您在Vim的配置文件(如.vimrc)或使用的插件中设置了'buftype'选项,请检查相关配置并确保设置正确。
55 0
|
8月前
|
容器
解决java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes......
解决java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes......
339 0
解决java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes......
|
7月前
|
分布式计算 Hadoop 大数据
|
11月前
|
JavaScript
关于js报错Cannot set properties of undefined (setting ‘innerHTML‘)的问题
关于js报错Cannot set properties of undefined (setting ‘innerHTML‘)的问题
232 0
|
消息中间件 Kafka
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of
这个问题是gradle的build版本问题,我是在build kafka的老版本时报的错,这个问题我查了一遍网上的内容,发现很多博客忽略了IDEA settings关于gradle的build的一个配置。
388 0
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of
|
JavaScript
js代码Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML‘)问题解决
js代码Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML‘)问题解决
1200 0
js代码Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML‘)问题解决