Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Elasticsearch - None of the configured nodes are available

I am using spring-boot with Elasticsearch. The project was created using jhipster.

pom.xml contains:

<parent>
  <artifactId>spring-boot-starter-parent</artifactId> 
  <groupId>org.springframework.boot</groupId>
  <version>1.4.0.RELEASE</version>
  <relativePath/>
</parent>

and

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>

In production mode, the following error occurs:

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}]

How can I resolve this error?

like image 728
Jean Avatar asked Aug 26 '16 20:08

Jean


1 Answers

In development profile, JHipster uses an embedded Elasticsearch.

In production profile, it tries by default to connect to a local cluster, so either you don't have installed Elasticsearch on your local machine or you haven't configured the right URL in application-prod.yml to connect to an existing cluster.

like image 71
Gaël Marziou Avatar answered Oct 13 '22 01:10

Gaël Marziou