用弹簧靴弹性搜索不起作用

时间:2017-03-22 03:25:47

标签: elasticsearch spring-boot

在春季启动项目中。

的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

我的配置:

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]

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

乍一看,似乎'spring-boot-starter-data-elasticsearch'和'jest 2.0.3'都不支持Elasticsearch 5.我会尝试将你的Elasticsearch实例降级到2.4.4,看看是否有效