TransportClient NoNodeAvailableException

Hi, I have a problem but no luck.
I use Elasticsearch v5.4.0 and v5.4.2 on Linux server.

Here is the situation, when my application start and construct using

TransportClient tc = new PrebuiltTransportClient()

At this moment, Elasticsearch is not started and NoNodeAvailableException was thrown, I think it should be expected(right?)

But later, when Elasticsearch server is available, in my application, I issue a query to Elasticsearch but also received same exception, unless I restart my application, the transport client will not work.

I try to surf the source code of TransportClient, it seems to me to check node available or not only happened when first time construct TransportClient? (am I right?)

The question:

  1. How to recover the client without restart application?
  2. Does this related to "sniff=true/false"? I set sniff enabled but no luck.
  3. Will there any setting can make TransportClient periodically re-check Elasticsearch server is available?

Thanks for you sharing and input.

I believe you need to rebuild the TransportClient in such a case.

Note that the TransportClient is going to be deprecated

Hi @dadoonet, thanks for you reply. But is this design intent or a defect? I wonder if an application using TransportNodeClient to do something, but later the ES cluster shutdown for 10 minutes and bring back, would the same problem hit?
Why not the client reconnect and need to rebuild again?

I don’t know. I think I read a comment on an issue about it a while ago. IIRC @javanna wrote the comment and could tell more.

I’m unsure if it will be fixed or improved as like I said this client will gone at some point. So people starting new prrojects should start using the REST one.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.