# Benefits of using client=true over just data=false

**URL:** https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906
**Category:** Elasticsearch
**Created:** [February 26, 2013, 1:33pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906 "2013-02-26T13:33:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 26, 2013, 1:33pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/1 "2013-02-26T13:33:50Z")

</div>

Hi,

I've read about some "optimizations" in using a Client node as opposed to  
just using a non-data node. What are they exactly?

Some of my nodes are just "data shovelers" or web UIs which use the Java  
API to connect to the cluster and issue operations against it.

In particular, I'm interested in using a non-data node for them, but  
piggyback on the Stats endpoint (to get mem/FS/JVM stats) which doesn't  
seem to be available when the node is defined as client=true.

Thanks,

Itamar.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)
#### Post date: [February 26, 2013, 2:31pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/2 "2013-02-26T14:31:38Z")

</div>

Itamar Syn-Hershko wrote:

> In particular, I'm interested in using a non-data node for them,  
> but piggyback on the Stats endpoint (to get mem/FS/JVM stats) which  
> doesn't seem to be available when the node is defined as  
> client=true.

A client node is a first-class citizen in every sense other than 1)  
it doesn't store data, which means that it will never be routed an  
index or search request, and 2) it won't be elected master. It keeps  
cluster state and can answer any question about the other nodes that  
you would ask a data node.

If a client node can't reach any data node, requests sent to that  
client node may not do what you expect. Cluster state will block,  
for example. However, stats should still work. Which endpoint are  
you hitting?

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 26, 2013, 2:37pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/3 "2013-02-26T14:37:34Z")

</div>

So how is it different from simply setting data=false?

I'm using this using the Java API:

NodesStatsResponse nodesStatsResponse =  
client.admin().cluster().prepareNodesStats().all().execute().actionGet();

(where client was initialized with  
nodeBuilder().client(true).node().client())

And always getting the FS, JVM and memory data structures completely empty.

On Tue, Feb 26, 2013 at 4:31 PM, Drew Raines [aaraines@gmail.com](mailto:aaraines@gmail.com) wrote:

> Itamar Syn-Hershko wrote:
> 
> > In particular, I'm interested in using a non-data node for them,  
> > but piggyback on the Stats endpoint (to get mem/FS/JVM stats) which  
> > doesn't seem to be available when the node is defined as  
> > client=true.
> 
> A client node is a first-class citizen in every sense other than 1)  
> it doesn't store data, which means that it will never be routed an  
> index or search request, and 2) it won't be elected master. It keeps  
> cluster state and can answer any question about the other nodes that  
> you would ask a data node.
> 
> If a client node can't reach any data node, requests sent to that  
> client node may not do what you expect. Cluster state will block,  
> for example. However, stats should still work. Which endpoint are  
> you hitting?
> 
> -Drew
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 27, 2013, 12:33pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/4 "2013-02-27T12:33:43Z")

</div>

I just confirmed this is also the case for non-data nodes - the node stats  
will not provide full JVM / FS / OS stats for it.

Furthermore, if a data node hasn't been searched on, the getOs().getMem()  
in the NodesStatsResponse for that node will be null. It appears as if an  
actual search request has to be issued against a node for that to be  
populated.

Is any of this by design, or is a bug?

Either way, I'd really like to be able to piggyback on this functionality  
for monitoring also non-data nodes, if requested explicitly

On Tue, Feb 26, 2013 at 4:37 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:

> So how is it different from simply setting data=false?
> 
> I'm using this using the Java API:
> 
> NodesStatsResponse nodesStatsResponse =  
> client.admin().cluster().prepareNodesStats().all().execute().actionGet();
> 
> (where client was initialized with  
> nodeBuilder().client(true).node().client())
> 
> And always getting the FS, JVM and memory data structures completely empty.
> 
> On Tue, Feb 26, 2013 at 4:31 PM, Drew Raines [aaraines@gmail.com](mailto:aaraines@gmail.com) wrote:
> 
> > Itamar Syn-Hershko wrote:
> > 
> > > In particular, I'm interested in using a non-data node for them,  
> > > but piggyback on the Stats endpoint (to get mem/FS/JVM stats) which  
> > > doesn't seem to be available when the node is defined as  
> > > client=true.
> > 
> > A client node is a first-class citizen in every sense other than 1)  
> > it doesn't store data, which means that it will never be routed an  
> > index or search request, and 2) it won't be elected master. It keeps  
> > cluster state and can answer any question about the other nodes that  
> > you would ask a data node.
> > 
> > If a client node can't reach any data node, requests sent to that  
> > client node may not do what you expect. Cluster state will block,  
> > for example. However, stats should still work. Which endpoint are  
> > you hitting?
> > 
> > -Drew
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)
#### Post date: [February 27, 2013, 4:16pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/5 "2013-02-27T16:16:16Z")

</div>

Itamar Syn-Hershko wrote:

> I just confirmed this is also the case for non-data nodes - the  
> node stats will not provide full JVM / FS / OS stats for it.
> 
> Furthermore, if a data node hasn't been searched on, the  
> getOs().getMem() in the NodesStatsResponse for that node will be  
> null. It appears as if an actual search request has to be issued  
> against a node for that to be populated.
> 
> Is any of this by design, or is a bug?

I can reproduce on master, and it does seems like a bug to me.  
Please file an issue and we'll take a look.

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [February 27, 2013, 4:26pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/6 "2013-02-27T16:26:16Z")

</div>

I took the liberty of reporting both as issues

> <https://github.com/elastic/elasticsearch/issues/2703>
>
> Using 0.90
> 
> If a data node hasn't been searched on, the getOs().getMem() in the …NodesStatsResponse for that node will be null. It appears as if an actual search request has to be issued against a node for that to be populated.

> <https://github.com/elastic/elasticsearch/issues/2704>
>
> It can be super helpful to piggyback on ElasticSearch's node stats endpoint to r…eport various stats on all nodes on the cluster, however non-data nodes (data=false or client=true) do not seem to have this enabled, and node stats return mostly empty for them.

I'll be happy to investigate and fix both myself, however as I have too  
many pending PRs on this project I'd rather not do that before I'm sure  
they'll be processed...

On Wed, Feb 27, 2013 at 6:16 PM, Drew Raines [aaraines@gmail.com](mailto:aaraines@gmail.com) wrote:

> Itamar Syn-Hershko wrote:
> 
> > I just confirmed this is also the case for non-data nodes - the  
> > node stats will not provide full JVM / FS / OS stats for it.
> > 
> > Furthermore, if a data node hasn't been searched on, the  
> > getOs().getMem() in the NodesStatsResponse for that node will be  
> > null. It appears as if an actual search request has to be issued  
> > against a node for that to be populated.
> > 
> > Is any of this by design, or is a bug?
> 
> I can reproduce on master, and it does seems like a bug to me.  
> Please file an issue and we'll take a look.
> 
> -Drew
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)
#### Post date: [February 27, 2013, 5:14pm UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/7 "2013-02-27T17:14:25Z")

</div>

Itamar Syn-Hershko wrote:

> I took the liberty of reporting both as issues
> 
> [NodesStatsResponse isn't fully populated if search wasn't made · Issue #2703 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2703)  
> [Non-data nodes do not support node stats endpoint · Issue #2704 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2704)

Thanks! Followed up on the second ticket.

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:49am UTC](https://discuss.elastic.co/t/benefits-of-using-client-true-over-just-data-false/10906/8 "2017-07-06T02:49:15Z")

</div>


