12. Setting up replication of Solr cores - findsorguk/findsorguk GitHub Wiki

Edit solr config file and edit appropriately. You will need to do this for each core, setting as either master or slave. Ideally there are 4 servers - 1 master, 3 slaves. Load balancing is handled within the PHP code that handles solr requests.

The below is the request handler for a master. It sets replication after a commit or after start up. It also copies across any changes to schema and stopwords files:

<requestHandler name="/replication" class="solr.ReplicationHandler" > 
  <lst name="master">
     <str name="replicateAfter">commit</str>
     <str name="replicateAfter">startup</str>
     <str name="confFiles">schema.xml,stopwords.txt</str>
   </lst>
 </requestHandler>`

Below is the request handler for a slave. You will need to set the core name. It sets a polling interval of 5 seconds:

<requestHandler name="/replication" class="solr.ReplicationHandler" > 

 <lst name="slave">
    <str name="masterUrl"><masterFQDN>/solr/{coreName}</str>
    <str name="pollInterval">00:00:05</str>
 </lst>

</requestHandler>`
⚠️ **GitHub.com Fallback** ⚠️