Loadbalancer infromt of client nodes

Hi am running a 7 node architecture with 3 master nodes, 2 co-ordinate only (earlier known as client) and 2 data nodes.

I ab API to interact with my elastic cluster to provide data.

My question is, do I need to put a load balancer between the two client nodes. Because I read somewhere that the client nodes act as "smart load balancers" in the cluster themselves.

How do i ensure that the queries would be equally distributed over both my clients.
While establishing the connection in the API, we have to pass in the node.name as well and I am setting it as the name of the first client node. And when i put the name of the domain instead, of the ip of the client node, then it gives me a node not found exception.

If I do have to use a loadbalancer, which load balancer should I be using HTTP or TCP?

What is the jdbc driver you are using?

@dadoonet I've updated the question I was wrong to put in the JDBC

What is the client you are using?

I am wondering the same question.
Setup:
12 Data nodes.
3 Master nodes.
3 Coordinating nodes.
ES version 5.6.2.

I am providing the client with a list of dns names of the coordinating nodes.
However it seems like there is no real balance between the nodes - if i put high load on one coordinating node - by doing a big agg. other requests (which should then use the other nodes) is getting errors.

I am considering to change the order of node names for each client connected.

@dadoonet The client means the "coordinate only nodes". They used to be called client nodes before. If you mean how am I trying to interact with the client nodes, then I have a java API application that uses spring tcp connection to establish a connection to my cluster.

So Client nodes are part of the cluster. They know exactly where the shards are located on the cluster.

do I need to put a load balancer between the two client nodes.

No.

Just give the list of the 2 client nodes to your client (the Java one you mentioned).

@dadoonet

I don't have a place for two client names below is the java code:

client = TransportClient.builder().settings(Settings.builder().put("cluster.name", "ates").put("node.name","ates-client-01")).build();

where I put in the client name and there is no way I can put in multiple node names.

When you say, list the 2 client nodes in java, where exactly do you mean?

That's a wrong usage of the transport client.

Look at the doc: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html

TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"), 9300))
        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host2"), 9300));

That's all what you need here.

May be add client.transport.ignore_cluster_name in the settings or the cluster name if you wish but that's all.

@dadoonet great I'll try it and get back. Thanks for the help. The getting back will take a while as it's midnight here. but I'll try it first thing in the morning

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.