Index Replication distributes complete copies of a master index to one or more slave servers. The master server continues to manage updates to the index. All querying is handled by the slaves. This division of labor enables Solr to scale to provide adequate responsiveness to queries against large search volumes.
1. Prerequisite Software
· solr-4.5.1.zip (Download from https://archive.apache.org/dist/lucene/solr/4.5.1/)
2. Setup Solr Instance
A) Setup Solr instance for Master
· Follow below link to setup Solr as Master
https://www.sitecorebites.net/2019/12/setup-solr-as-window-service.html
https://www.sitecorebites.net/2019/12/setup-solr-as-window-service.html
Ex : D:\SolrPOC\Solr\Master\Solr-4.5.1\
B) Setup Solr instance for Slave
· Follow below link to setup Solr as Slave
https://www.sitecorebites.net/2019/12/setup-solr-as-window-service.html
Ex : D:\SolrPOC\Solr\Slave\Solr-4.5.1\
B) Setup Solr instance for Slave
· Follow below link to setup Solr as Slave
https://www.sitecorebites.net/2019/12/setup-solr-as-window-service.html
Ex : D:\SolrPOC\Solr\Slave\Solr-4.5.1\
3. Configuring the ReplicationHandler
Solr includes a Java implementation of index replication that works over HTTP:
Solr includes a Java implementation of index replication that works over HTTP:
- The configuration affecting replication is controlled by a single file, solrconfig.xml
- Supports the replication of configuration files as well as index files
- Works across platforms with same configuration
- No reliance on OS-dependent file system features (eg: hard links)
- Tightly integrated with Solr; an admin page offers fine-grained control of each aspect of replication
3.1 Master Solr Configuration : Configuring
the Replication RequestHandler on a Master Server
· For CMS
connection master solr configuration required.
· Open
the solrconfig.xml file from (solr-5.4.1\server\solr\ sitecore_core_index
\conf) for each core which wanted to sync the data with slave. Ex :
ap_web_index, na_web_index and eu_web_index.
· Add replication request
handler configuration to solrconfig.xml for above indexes
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">optimize</str>
<str name="backupAfter">commit</str>
<str name="confFiles">schema.xml</str>
<str name="commitReserveDuration">00:00:10</str>
</lst>
<int name="maxNumberOfBackups">2</int>
<lst name="invariants">
<str name="maxWriteMBPerSec">16</str>
</lst>
</requestHandler>
3.2 Slave Solr Configuration : Configuring
the Replication RequestHandler on a Slave Server
· For CD
connection slave configuration require
· Open the
solrconfig.xml file from (solr-5.4.1\server\solr\ sitecore_core_index \conf)
for each core, which is synced by Master Ex : ap_web_index, na_web_index and
eu_web_index.
· In solrconfig.xml,
add replication request handler configuration to
solrconfig.xml for above indexes.
Note: Master url
will be “Solr Master” url.
<requestHandler
name="/replication" class="solr.ReplicationHandler" >
<lst name="slave">
<str name="masterUrl">http://localhost:8983/solr/sitecore_core_index/replication</str>
<str name="pollInterval">00:00:20</str>
</lst>
</requestHandler>
3.3 Update
the core properties:
Set the following properties in the solrcore.properties file
enable.master=true
enable.slave=false
3.4 Troubleshooting
the replication:
A) Restart both master as well
slave solr service
B) Open both Solr UI & validate
whether master and slave configured properly or not as below image
C) Validate the replication
·
Select the core Ex : sitecore_core_index
·
Click on Replication and see the replication interval as below

Comments
Post a Comment