Client node settitng


(tianzongqi) #1

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.


(Mark Walkom) #2

What are you using to connect to the client nodes?


(tianzongqi) #3

TransportClient to connect the nodes


(Mark Walkom) #4

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


(tianzongqi) #5

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


(Mark Walkom) #6

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


(Xiaojun Yue) #7

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


(David Pilato) #8

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.


(Mark Walkom) #9

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


(tianzongqi) #10

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"


(David Pilato) #11

Any chance you can share details about your findings?

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

(tianzongqi) #12

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


(system) #13