Spring Elasticsearch - 没有配置的节点可用

Jea*_*ean 9 spring elasticsearch jhipster

我正在使用Spring-boot和Elasticsearch.该项目是使用jhipster创建的.

pom.xml包含:

<parent>
  <artifactId>spring-boot-starter-parent</artifactId> 
  <groupId>org.springframework.boot</groupId>
  <version>1.4.0.RELEASE</version>
  <relativePath/>
</parent>
Run Code Online (Sandbox Code Playgroud)

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

在生产模式下,发生以下错误:

AbstractElasticsearchRepository : failed to load elasticsearch nodes :    
org.elasticsearch.client.transport.NoNodeAvailableException: None of  
the configured nodes are available: [{#transport#-1}{127.0.0.1}
{localhost/127.0.0.1:9300}]
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

Gaë*_*iou 5

在开发配置文件中,JHipster使用嵌入式Elasticsearch.

在生产配置文件中,它默认尝试连接到本地群集,因此您没有在本地计算机上安装Elasticsearch,或者您没有配置正确的URL application-prod.yml以连接到现有群集.