Distribute Solr using replication without using SolrCloud

I want to use Solr replication without using SolrCloud. I have three Solr servers, one is a master, and the others are slaves.

How to send a search query to a Solr server that is not busy?

What tools and how to lead?

+5
source share
3 answers

You can use any load balancer - Solr says HTTP, making existing load balancing technology available. HAProxy, varnish, nginx, etc. They will work as you expect, and you can use all the advanced features offered by the various packages. It will also be independent of the client, which means that you are not limited to SolrJ's LBHttpSolrServer class or your specific client. Some LB solutions also offer high-performance caching (varnish) or dynamic real-time switching between nodes in real time.

Another option that we also used was to replicate the kernel to each node website, which allows us to always query the local host for the search.

+3
source

You configured solr in master-slave mode. I think you can use LBHttpSolrServer from solrj api to request solr. You need to send master node update requests explicitly . LBHttpSolrServer will provide you with load balancing between all specified nodes. In master-slave mode, subordinates are responsible for keeping them in the main file.

Do NOT use this class for indexing in master / slave scripts, since documents must be sent to the correct master; routing through node is not performed. In SolrCloud scripts (leader / replica), this class can be used for updates, because updates will be redirected to the corresponding leader.

Hope this helps.

+1
source

apache camel can be used for general load balancer. eg:

public class LoadBalancer { public static void main(String args[]) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("jetty://http://localhost:8080") .loadBalance().roundRobin().to("http://172.28.39.138:8080","http://172.168.20.118:8080"); } }); context.start(); Thread.sleep(100000); context.stop(); } } 

Perhaps there are other materials:

Basic failover example of LoaderBalancer Apache

http://camel.apache.org/load-balancer.html

But there seems to be no direct way to solr-camel integration, because camel can be used to balance requests for java Beans components

http://camel.apache.org/loadbalancing-mina-example.html

There is another useful example:

https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/CustomLoadBalanceTest.java

And you can use camel as a proxy between client and server

http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html

There are several presentations for beginners with the apache camel, its approach and architecture: http://www.slideshare.net/ieugen222/eip-cu-apache-camel

+1
source

All Articles