I've configured Solr with Tomcat on a master server. Then, I configured snapshooter, snappuller, and snapinstaller (as well as snapcleaner) to replicate the index files to a slave server, which is now automated and working. The final step I'm trying to figure out is how to share the search queries between both hosts -- is this a configurable option, or do I need to write some code? I've started reviewing Balancer.php, but it's not yet clear to me the best way to integrate this. Pointers on the right way to do this (without installing an actual load balancer) would be greatly appreciated.

Comments

pwolanin’s picture

You should be using Solr 1.4-dev, which has built-in replication support, rather than those replication scripts.

I have not tried Balancer.php - we use a load balancer in front of the master/slave(s). You can use a software load balancer like nginx.

jeremy’s picture

Yes, I am using 1.4-dev, and I see the documentation here. In the HTTP API section I saw reference to snapshooter, etc, so I assumed the scripts were still being used at some level. In any case, how the data is replicated is not currently the most important thing to me -- how to share the data once it is replicated is what matters to me.

If there is no obvious client for this, it would not be difficult to define Solr servers as an array, and then to randomly select a server from this array to effectively load balance. I was simply trying to not re-invent any wheels.

pwolanin’s picture

Well, useful in general to direct searches to slaves in prefernce to the master if possible, since the master may pause while committing changes.

anarchivist’s picture

Version: 6.x-1.0-beta7 » 6.x-1.x-dev

Is there any other interest in implementing SolrPHPClient's balancer implementation within apachesolr? In our case, we don't have direct control over the load balancer setup, so having apachesolr manage the handoffs would be preferable in some ways to hacking the Solr WARs to do the appropriate handoff to the update servlet on the master.

anarchivist’s picture

Does this qualify as a duplicate of #267831: Load balancing implementation?

anarchivist’s picture

Status: Active » Closed (duplicate)

This has sat for a long time, so I'm going to go ahead and mark this as a duplicate of #267831: Load balancing implementation. Please reopen this issue if you see a difference; if not, let's keep the discussion going there.