springboot使用elasticsearch踩得坑(Windows版)

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

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

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>

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

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-elasticsearch</artifactId>
    <version>3.0.3.RELEASE</version>
</dependency>

这里写图片描述

posted @ 2018-01-30 11:47  qwer78  阅读(20)  评论(0)    收藏  举报