1
votes

I use the spring-data-elasticsearch with the version of 3.0.0 there has been a problem in use process, sometimes successfully, sometimes will report the error

None of the configured nodes are available: [ {#transport#-1} {S0DLwdVZRk-Osl4KgxM91A} {127.0.0.1} {127.0.0.1:9300}

Elasticsearch is version 5.4.0.

My spring configuration file is

 <elasticsearch:repositories base-package="com.ai.notify.es.repository"/>

 <elasticsearch:transport-client id="client" cluster-nodes="127.0.0.1:9300" 
 cluster-name="my-message" />

 <bean name="elasticsearchTemplate" 
    class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
    <constructor-arg name="client" ref="client"/>
 </bean>

and my elasticsearch.yml is

cluster.name: my-message
client.transport.ignore_cluster_name: true
http.cors.enabled: true

 http.cors.allow-origin: "*"

 client.transport.sniff: true

This is because what causes.

This error does not appear frequently, but occasionally

1
Just to be sure: You are using 3.0.0 M4 (so the pre release)?xeraa
3.0.0.BUILD-SNAPSHOT this version.yichidong

1 Answers

0
votes

spring-data-elastic 3.0.0.BUILD-SNAPSHOT uses version 5.5.0 of the elastic search client library. See pom.xml. So your elastic search server version must be exactly 5.5.0. Not even 5.5.1 or 5.5.2 or 5.5.3 or 5.5.4 etc. Exactly 5.5.0.