My scenario: I am using the java TransportClient 18.7 in my Play!
application to query elasticsearch 18.6.
My questions:
It is logging messages that look like it is acting like a node, based on
the "[Nodename]" in the message. I thought TransportClient did not join as
a node? What is happening here?
04:50:18,581 WARN ~ [Piper] failed to get node info for
[#transport#-1][inet[/127.0.0.1:9300]]
org.elasticsearch.transport.NodeDisconnectedException:
[][inet[/127.0.0.1:9300]][/cluster/nodes/info] disconnected
I have read posts about TransportClient being thread safe and not
needing pooling so I created a singleton class that has a static Client
field. It works on the first request, but it always fails on subsequent
requests. This is regardless of whether or not I am in dev or prod mode.
Any ideas?
org.elasticsearch.client.transport.NoNodeAvailableException: No node
available
at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:170)
at
org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:254)
at
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:310)
at
org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:697)
at
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)
at
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)
at models.SearchResults.executeQuery(SearchResults.java:105)
at controllers.Application$1.doJobWithResult(Application.java:86)
at controllers.Application$1.doJobWithResult(Application.java:1)
at play.jobs.Job.call(Job.java:146)
at play.jobs.Job$1.call(Job.java:66)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
My scenario: I am using the java TransportClient 18.7 in my Play!
application to query elasticsearch 18.6.
My questions:
It is logging messages that look like it is acting like a node, based
on the "[Nodename]" in the message. I thought TransportClient did not join
as a node? What is happening here?
04:50:18,581 WARN ~ [Piper] failed to get node info for
[#transport#-1][inet[/127.0.0.1:9300]]
org.elasticsearch.transport.NodeDisconnectedException:
[inet[/127.0.0.1:9300]][/cluster/nodes/info] disconnected
Its just the name associated with the client, it does not mean its a node
in the cluster.
I have read posts about TransportClient being thread safe and not
needing pooling so I created a singleton class that has a static Client
field. It works on the first request, but it always fails on subsequent
requests. This is regardless of whether or not I am in dev or prod mode.
Any ideas?
Are you sure you are not closing the client? Try and
set org.elasticsearch.client.transport to TRACE logging level and see what
happens.
org.elasticsearch.client.transport.NoNodeAvailableException: No node
available
at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:170)
at
org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:254)
at
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:310)
at
org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:697)
at
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)
at
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)
at models.SearchResults.executeQuery(SearchResults.java:105)
at controllers.Application$1.doJobWithResult(Application.java:86)
at controllers.Application$1.doJobWithResult(Application.java:1)
at play.jobs.Job.call(Job.java:146)
at play.jobs.Job$1.call(Job.java:66)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.