None of the configured nodes are available: [{#transport#-1

when i connect remote ES server,the client can run a few minutes,then the server disconnected and the client throws None of the ..nodes ara available.
i'm sure the CONF is right,the port ,the ip,the firewall,all CONF is right...
ES version:5.4.1
client: TransportClient
client create code:`Settings config = Settings.builder().put("client.transport.ping_timeout", "30s")
TransportClient tc = new PreBuiltTransportClient(config,Collections.EMPTY_SET);
try {
new InetSocketTransportAddress(InetAddress.getByName("localhost"),9300)
// new InetSocketTransportAddress(InetAddress.getByName(""),9300)

	}catch(Exception e){
	return tc;`

if use,the client can only works a few minutes.........

English is too hard!!!!

Are you creating a new client each time you want to query the cluster?
Or you have just one instance shared in your app?

May be share more reproductible code?

i only create a transport connetion to create index and write data, and ES is not in cluster,simple node.

The transport connection will disconnect after a few minutes,every time.

write index data code:

   public static void insertIndexContent(String indexName,String type,
			String content,TransportClient client) throws IOException{
		IndexRequestBuilder builder = client.prepareIndex(indexName, type);
		XContentBuilder json = XContentFactory.jsonBuilder();

That part of your code sounds good to me.

May be you have a network equipment in the middle who is doing disconnect when nothing is happening on the network between your application and elasticsearch?

Anyway, I'd encourage you using instead the REST Client as the Transport Client is going to be deprecated. It's a low level one for now but the high level version is coming soon.

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