elasticsearch - Spring Boot Elasticsearch 不起作用

标签 elasticsearch spring-boot

在 Spring 启动项目中。

gradle:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-elasticsearch')
    compile('io.searchbox:jest:2.0.3')
    runtime('net.java.dev.jna:jna')
}

config.yml:
spring:
  data:
    elasticsearch:
      cluster-nodes: 10.19.132.207:9300
      cluster-name: es
  elasticsearch:
    jest:
      uris: http://10.19.132.207:9200
      read-timeout: 10000

和我的ES配置:
cluster.name: es
node.name: node-1
network.host: 0.0.0.0
transport.tcp.port: 9300
http.port: 9200

当我想将数据保存到es时。控制台打印:
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{10.19.132.207}{10.19.132.207:9300}]
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:326) ~[elasticsearch-2.4.4.jar:2.4.4]
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:223) ~[elasticsearch-2.4.4.jar:2.4.4]
    at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55) ~[elasticsearch-2.4.4.jar:2.4.4]

和我的ES打印日志:
java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.0.0]
    at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1323) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74) ~[transport-netty4-5.2.2.jar:5.2.2]

我该如何解决这个问题?

最佳答案

乍一看,似乎“spring-boot-starter-data-elasticsearch”和“jest 2.0.3”都不支持Elasticsearch5。我尝试将您的Elasticsearch实例降级为2.4.4,看看是否可行。

关于elasticsearch - Spring Boot Elasticsearch 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42942186/

相关文章:

elasticsearch - 过滤器或分析器以等同于英文数字和阿拉伯数字

java - 如何使用IngestPlugin在Elasticsearch中基于IngestDocument填充indexableField

Azure Application Insights 控制台日志格式

java - Spring Boot 应用程序在部署到 Tomcat 时会出现 404,但适用于嵌入式服务器

java - Spring 批处理 DB 到 JSON 文件

elasticsearch - Elasticsearch:找出主碎片的运行节点名称吗?

elasticsearch - 使用streaming_bulk()时出现409错误-确定该文档仅包含一次。

amazon-web-services - aws elastic beanstalk不调用私有(private)API

Spring @Cacheable 默认 TTL

java - Spring Boot 用户注册 - 将验证错误发送到 UI