Index Replication and Load Balancing

jcvi edited this page Sep 14, 2010 · 18 revisions

For questions/feedback please write an email to

METAREP works fine with a single Solr server. However, if you expect to have a lot of traffic (many concurrent users) you may want configure METAREP to use two load-balanced Solr servers to improve query response time. In such a setup, two Solr servers replicate each others index files and user traffic is balanced between the two using a load balancer. This is achieved by defining one Solr server as a master server and another Solr server as a slave server (in theory more than two slave servers can be defined but METAREP currently supports only one slave server). New Index files that are submitted to the master server will automatically be replicated by the Solr slave server using Solr’s inbuilt replication functionality. To configure METAREP for index replication and load balancing,

  • repeat Step 4 (except server start up ) of the Installation Guide to create two separate Solr server installations (master & slave) .
  • uncomment the replication requestHandler (lines 505-520) of the master solrconfig.xml. The file can be found in /<master-installation-dir>/apache-solr-1.4.0/metarep-solr/conf/
  • adjust the masterUrl (line 496) in the master solrconfig_slave.xml .The file can be found in /<master-installation-dir>/apache-solr-1.4.0/metarep-solr/conf/
  • copy your edited solrconfig_slave.xml file on the master server to the SLAVE server. Rename the copy on the slave to solrconfig.xml (override existing solrconfig.xml). /cp <master-installation-dir>/apache-solr-1.4.0/metarep-solr/conf/solrconfig_slave.xml <slave-installation-dir>/apache-solr-1.4.0/metarep-solr/conf/solrconfig.xml
  • start the master server java -Djetty.port=1234 -Dsolr.solr.home=/<master-installation-dir>/apache-solr-1.4.0/metarep-solr -jar -Xms156m -Xmx14000m start.jar
  • start the server java -Djetty.port=1234 -Dsolr.solr.home=/<slave-installation-dir>/apache-solr-1.4.0/metarep-solr -jar -Xms156m -Xmx14000m start.jar
  • update the Solr Slave (SOLR_SLAVE_HOST) and Solr Master host (SOLR_MASTER_HOST), ports (SOLR_PORT) and load balancer IP (SOLR_BIG_IP_HOST) in the METAREP configuration file.