# Client node settitng

**URL:** <https://discuss.elastic.co/t/client-node-settitng/40448>\
**Category:** Elasticsearch\
**Created:** [January 29, 2016, 7:11am UTC](https://discuss.elastic.co/t/client-node-settitng/40448 "2016-01-29T07:11:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![tianzongqi](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tianzongqi](https://discuss.elastic.co/u/tianzongqi)\
**Post date:** [January 29, 2016, 7:11am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/1 "2016-01-29T07:11:20Z")

</div>

I setting two ES nodes as client node in my ES cluster, i want the application only connect the client node for query or index. But when set client node's IP for connection, found that my application also connect the master node or data node .

how can i force the application only connect the client node ? then client nodes handle the task(query or index) distribution.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 29, 2016, 7:19am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/2 "2016-01-29T07:19:17Z")

</div>

What are you using to connect to the client nodes?

---

<div class="post-metadata">

**Author:** ![tianzongqi](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tianzongqi](https://discuss.elastic.co/u/tianzongqi)\
**Post date:** [January 29, 2016, 7:44am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/3 "2016-01-29T07:44:21Z")

</div>

TransportClient to connect the nodes

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 29, 2016, 7:46am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/4 "2016-01-29T07:46:10Z")

</div>

Then that's why. You will need to use just HTTP and only list those two clients.

---

<div class="post-metadata">

**Author:** ![tianzongqi](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tianzongqi](https://discuss.elastic.co/u/tianzongqi)\
**Post date:** [January 29, 2016, 7:48am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/5 "2016-01-29T07:48:35Z")

</div>

ok! you mean client nodes only used for HTTP connection? TCP connection can not do the work that the question shows ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 29, 2016, 7:58am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/6 "2016-01-29T07:58:58Z")

</div>

No, I mean that using either transport or node clients will cause your client to load balance across all nodes in the cluster.

---

<div class="post-metadata">

**Author:** ![Xiaojun\_Yue](https://avatars.discourse-cdn.com/v4/letter/x/fbc32d/32.png) [@Xiaojun\_Yue](https://discuss.elastic.co/u/Xiaojun_Yue)\
**Post date:** [January 29, 2016, 8:07am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/7 "2016-01-29T08:07:53Z")

</div>

which http client you suggest ? [https://github.com/searchbox-io/Jest](https://github.com/searchbox-io/Jest) is stable for production environment ? thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 29, 2016, 8:24am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/8 "2016-01-29T08:24:54Z")

</div>

Using TransportClient is the way to go. As long you don't set `client.transport.sniff` to `true`, the TransportClient will connect only to the nodes you defined in it.

I'm surprised you are seeing something else.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 29, 2016, 8:27am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/9 "2016-01-29T08:27:36Z")

</div>

@dadoonet is right there, that's my mistake sorry!

---

<div class="post-metadata">

**Author:** ![tianzongqi](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tianzongqi](https://discuss.elastic.co/u/tianzongqi)\
**Post date:** [January 29, 2016, 9:49am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/10 "2016-01-29T09:49:37Z")

</div>

i have set "client.transport.sniff=false" already.

but i can see other nodes which are not client node type. when check the ES nodes' connections, i am sure the application servers connect the master node and data node, not only client node.

the shell code "netstat -anp | grep "9300"

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 29, 2016, 10:49am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/11 "2016-01-29T10:49:22Z")

</div>

Any chance you can share details about your findings?

- Java client code
- Output of `_cat/nodes?v`
- Output of `netstat -anp | grep "9300"`

---

<div class="post-metadata">

**Author:** ![tianzongqi](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tianzongqi](https://discuss.elastic.co/u/tianzongqi)\
**Post date:** [February 1, 2016, 2:19am UTC](https://discuss.elastic.co/t/client-node-settitng/40448/12 "2016-02-01T02:19:45Z")

</div>

our ES version is 1.4.2;

id ip port v m  
DiJ- 10.4.69.71 9300 1.4.2 -  
585- 10.4.69.69 9300 1.4.2 m  
xgwV 10.4.69.72 9300 1.4.2 m  
o6Kf 10.4.93.107 9300 1.4.2 -  
9T1R 10.4.69.70 9300 1.4.2 -  
hS\_Y 10.4.69.68 9300 1.4.2 \*  
OR7W 10.4.94.214 9300 1.4.2 -

10.4.93.107 and 10.4.94.214 was setted as client node.

and the netstat code result as below:

BLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.4.69.69:28054 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.4.69.70:14904 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:52251 10.4.69.71:9300 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.32.93.212:54250 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.32.38.116:51654 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.32.32.105:59091 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:9300 10.32.32.105:59097 ESTABLISHED 32022/java  
tcp 0 0 10.4.94.214:42971 10.4.93.107:9300 ESTA

---

<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 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/client-node-settitng/40448/13 "2017-07-05T23:20:01Z")

</div>


