gdk
gdk

Reputation: 89

how to use spring-data-elasticsearch in spring-boot starter 2.1.4?

How to use spring-data-elasticsearch in spring-boot 2.1.4 REALESE?

Current Error.

ERROR: org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{XGi_IpM0QHea4D3QbFbArQ}{HOST}{HOST:PORT}]]] with root cause
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available:

My Environment.

Hope.

Can i use elasticsearch 6.2.2 in spring-boot 2.1.4 RELEASE(spring-data-elasticsearch 3.1.4)?

What should I do?


ERROR: org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{XGi_xxxxxxxxxxx}{HOST}{HOST:PORT}]]] with root cause org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available:

There is a problem when connecting to Elasticsearch 6.2.2 on the srping-boot 2.1.4's spring-data-elasticsearch.

Upvotes: 0

Views: 827

Answers (1)

mst
mst

Reputation: 404

You are using tcp client for elasticsearch 6.2.2. No node available message comes from coordinate node when it does not find any available node to respond.

  1. I would HIGHLY RECFOMMEND to go for Rest client. Why? Elasticsearch considering to remove tcp client from 7.0 version.

  2. If you still considering tcp client:

    • 2.1 set longer tcp client read time out;
    • 2.2 Still getting error? Set your host to 0.0.0. (transport.host: 0.0.0.0) if it is localhost (127.0.0.0)
    • 2.3 Still getting error? Enable the sniffer, sniffer checks available nodes and updates the node state, add to your config map .put("client.transport.sniff", true)
    • 2.4 Set your all nodes as a master (I SOLVED MY ISSUE BY THIS)
    • 2.5 (ADVENCED) If you are still getting this error, carefully read this blog and update system TCP keep alive time, https://blog.trifork.com/2015/04/08/dealing-with-nodenotavailableexceptions-in-elasticsearch/

One of the 2nd section items has to work. If doesnt work, please post your configuration and metrics (how many what kind of requests coming to ES, consider the queue size). I hope this helps!

Upvotes: 0

Related Questions