Spring boot 启动Spring启动应用程序时出错
我有一个Spring引导应用程序,它使用elasticsearch实现持久性。当我启动应用程序时。我得到这个错误Spring boot 启动Spring启动应用程序时出错,spring-boot,
spring-data-elasticsearch,Spring Boot,
spring Data Elasticsearch,我有一个Spring引导应用程序,它使用elasticsearch实现持久性。当我启动应用程序时。我得到这个错误 2019-03-10 13:40:34.969 ERROR 6442 --- [ restartedMain] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableExcept
2019-03-10 13:40:34.969 ERROR 6442 --- [ restartedMain] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{dwDmvmEpTaGofz678sLuFw}{localhost}{127.0.0.1:9300}, {#transport#-2}{3MRMgg73T1eBHFiozEJABw}{192.168.1.6}{192.168.1.6:9300}]
2019-03-10 13:40:35.176 DEBUG 6442 --- [ restartedMain] c.l.lociscore.services.LociScoreService : --LociScoreService Intialized------
我使用的是Spring Boot版本2.1.3.0
这是我的配置
server.port=29090
server.address=localhost
server.ssl.enabled=false
spring.data.elasticsearch.repositories.enabled=true
spring.data.elasticsearch.cluster-nodes=localhost:9300,192.168.1.6:9300
spring.data.elasticsearch.cluster-name= "elasticsearch"
spring.es.set.netty.runtime.available.processors = false
我正在使用docker运行弹性搜索。我用来启动ES的命令如下
docker run -p 9200:9200 -p 9300:9300 -e "http.host=0.0.0.0" -e "transport.host=0.0.0.0" -e "xpack.security.enabled=false" -e "cluster.name=loci-score" -d --name thesiselasticsearch -d --network mynetwork docker.elastic.co/elasticsearch/elasticsearch:6.4.3
我不明白为什么会发生错误。从我为SpringDataElasticSearch阅读的文档来看,我使用的版本是兼容的