最近在使用es集成springboot时出现的几个问题,总结一哈哈;
ERROR 12900 — [ main] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{PanWdX8cSCucApEt1af63Q}{127.0.0.1}{127.0.0.1:9300}]
***配置文件出现问题***
配置es时出现横线,表示es的安装包和springboot中spring-boot-starter-data-elasticsearch的jar包版本号不一致;
es安装包我使用的是5.2.2版本,spring-boot-starter-data-elasticsearch的jar包用的2.2.6,启动报错
更改springboot版本号为2.0.5
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘courseController’: Unsatisfied dependency expressed through field ‘courseServer’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘courseServerImpl’: Unsatisfied dependency expressed through field ‘courseElasticSearch’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘courseElasticSearch’: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Mapper for [intro] conflicts with existing mapping in other types:
原因是java代码中es的文档映射分词改变了,启动时报错找不到对应bean;
***解决:利用kibana清空es中的映射即可***
因篇幅问题不能全部显示,请点此查看更多更全内容