Switching between nodes in ElasticSearch using the JEST client

I have 3 nodes in my ElasticSearch cluster. eg. 10.10.0.1, 10.10.0.2, 10.10.0.3

Now I'm trying to connect to the cluster using the Jest Client API and provide the IP (10.10.0.1) of one of the nodes above. Now, if the Node parameter (10.10.0.1) does not work, does this mean that I could not access the cluster?

How to deal with such a problem when we have several nodes and we try to connect to the cluster from the code using the same IP address?

or

Should I go and create another connection giving a different IP address? I think this is a very rude way to do this, because if we have 100 nodes, in this case we will try to connect to 100 nodes one by one.

+4
source share
1 answer

I would look at creating a node on the so-called client. The node client is node.datafalse, so while it is a full member of the cluster, it does not save data locally. This is both query processing using load and nodes processing indexing documents, and provides the beginning of a load balancing approach.

node , , Elasticsearch JVM, , , , , .

node elasticsearch , . node , . , , node, , .

:

https://blog.liip.ch/archive/2013/07/19/on-elasticsearch-performance.html

:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-node.html

Java Elasticearch api, REST - Java- node , node. node, node:

http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#node-client

http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client

+2

Source: https://habr.com/ru/post/1545190/


All Articles