Manual Opensolr Index Replication
๐ All Manual Solr Replication with OpenSolr
Looking to set up Solr replication the old-school wayโwith style, security, and a splash of manual elbow grease? You've come to the right place. Let's do it properly, like grandpa used to replicate XML configsโby hand. ๐งค
๐ Secure Solr Replication via HTTPS
To configure secure replication between two OpenSolr indexes, paste the following configurations into your respective solrconfig.xml files for master and slave.
๐งโ๐ซ Master Configuration
<requestHandler name="/replication" class="solr.ReplicationHandler" > <lst name="master"> <str name="replicateAfter">startup</str> <str name="replicateAfter">commit</str> <!--If configuration files need to be replicated give the names here, separated by comma --> <str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str> <str name="maxNumberOfBackups">0</str> </lst> </requestHandler>
๐งโ๐ผ Slave Configuration
<requestHandler name="/replication" class="solr.ReplicationHandler" > <lst name="slave"> <str name="masterUrl">https://SRV.OPENSOLR.COM/SOLR/YOUR_MASTER_INDEX_NAME</str> <str name="pollInterval">00:00:5</str> <str name="httpBasicAuthUser">a</str> <str name="httpBasicAuthPassword">a</str> </lst> </requestHandler>
๐ง Donโt Forget Network Access
Make sure your master and slave indexes can communicate. That means granting access by IP:
- On the master, allow
/replicationaccess for the slave server's IP.
(Useping SLAVE_SERVER_HOSTNAMEto find it.) - On the slave, allow
/replicationaccess for the master server's IP.
(You guessed itโping MASTER_SERVER_HOSTNAME.)
๐ Example Scenario
Letโs say youโre replicating between two indexes:
index.Aatfr.opensolr.comindex.A_REPLICAatuk2.opensolr.com
โ
Add the above XML snippets to each solrconfig.xml accordingly.
โ
Run ping fr.opensolr.com and ping uk2.opensolr.com to get their IPs.
โ
Grant those IPs access in each otherโs firewall or OpenSolr control panel.
โ
Ensure identical schema.xml files on both ends. No cheating.
๐ Questions?
Reach out to us at OpenSolr Contact Page โ we don't bite, and we definitely know replication.
โถ๏ธ Video Tutorial
Hereโs the quick visual walkthrough for all this, for those who prefer the popcorn ๐ฟ approach:


