springboot使用elasticsearch踩得坑(Windows版)

<parent>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-starter-parentartifactId>
    <version>1.5.9.RELEASEversion>
    <relativePath/>
parent>

我的springboot版本如上。
pom依赖加入:

<dependency>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-starter-data-elasticsearchartifactId>
dependency>

由于这个版本依赖的elasticsearch为2.4.0 而我本地安装的是6.1.1,在springboot项目启动后head插件死活找不到springboot启动的节点(开始是注释掉cluster-nodes,后来又开启的)
springboot使用elasticsearch踩得坑(Windows版)_第1张图片
然后看spring-boot-starter-data-elasticsearch里面依赖的elasticsearch为2.4.0版本,之后把本机的改成相同版本后正常。
(尝试覆盖依赖为3.0.3版本,它依赖的elasticsearch为5.5.0,但是报错,细节略。最后改本地版本启动正常

<dependency>
    <groupId>org.springframework.datagroupId>
    <artifactId>spring-data-elasticsearchartifactId>
    <version>3.0.3.RELEASEversion>
dependency>

springboot使用elasticsearch踩得坑(Windows版)_第2张图片

你可能感兴趣的:(elasticsearch)