TransportClient logs errors as if it was a node?

My scenario: I am using the java TransportClient 18.7 in my Play!
application to query elasticsearch 18.6.

My questions:

  1. 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

  2. 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)

Thanks,
Mark

On Thu, Jan 19, 2012 at 7:42 PM, Mark Waddle mark@markwaddle.com wrote:

My scenario: I am using the java TransportClient 18.7 in my Play!
application to query elasticsearch 18.6.

My questions:

  1. 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.

  1. 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)

Thanks,
Mark

Oh ya, that's it. I'm closing the client. Guess I should have realized that
one. Thanks!