SolrCloud load balancing

I am working on a .NET application that uses Solr as a search engine. I configured the SolrCloud installation with two servers (one for Replica), and I did not split the index into fragments (number of fragments = 1). I read that SolrCloud (via Zookeeper) can do some load balancing, but I did not understand how to do this. If you call the specific address where the solr instance is deployed, the request appears only in the logs of that particular server.

In the SolrCloud documentation, I found that:


Explicitly indicate the addresses of the fragments that you want to request by providing alternatives (limited |) used to balance the load and failure:

http: //www.ipaddress.com: 8983 / solr / collection1 / select? shards = www.ipaddress.com: 8983 / solr | www.ipaddress.com: 8900 / solr, www.ipaddress.com: 7574 / solr | www.ipaddress.com:7500/solr


I am wondering if I can use this notation to force load balancing if I have the whole index (only one shard), in which case load balancing works.

UPDATE: I tested this solution and it works. Adding different fragments addresses to the "fragments" field, separated by "|" forces Solr to call the internal load balancer (LBHttpSolrServer), which performs simple balancing in a circle.

Thank you for your help.

Regards, Jacopo

+6
source share
2 answers

I tested this solution and it works. Adding different fragments addresses to the "fragments" field, separated by "|" forces Solr to call the internal load balancer (LBHttpSolrServer), which performs simple balancing in a circle.

+4
source

Since you have only one shard, the server receiving the request will respond to the result, it will not execute another request from another replica when it is locally localized. The Java CloudSolrServer client connects to ZooKeeper and knows which servers are up or down and will perform load balancing accordingly on all active servers. I do not believe that .NET ports are available for this particular client.

+1
source

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


All Articles