Documentation

Find answers to your questions quickly and easily

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:

  1. On the master, allow /replication access for the slave server's IP.
    (Use ping SLAVE_SERVER_HOSTNAME to find it.)
  2. On the slave, allow /replication access 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.A at fr.opensolr.com
  • index.A_REPLICA at uk2.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:

Watch the video

Read Full Answer