Apache Solr Index Replication

                   Smart Techie

                  In the last Apache Solr related articles we have discussed “How to set up Apache Solr?“, “How to configure Apache Solr to index data from database?” , etc.. In this article we will see “how to set up Apache Solr replication?“. Before getting into the configuration details, we will discuss a use case to use replication. In most of the online sites, the data will get the update so frequently. To make this data available to search, the Apache Solr server requires to do delta indexing so frequently. So, the Solr server used for indexing will be always busy with the indexing. If we use the same indexing server for searching, then the search functionality has a performance hit. To isolate the search with the indexing and to achieve better search performance, we need to go with replication. To setup indexing replication we require at least two Solr instances. The below diagram will depict the replication setup.

Apache Solr Indexing Replication

                   From the above diagram, the master Solr instance will do indexing. The Salve Solr instances will serve the content to the web. The index from master to slave instances will get replicate based on the replication interval. Now we will see the configuration details.

Master configuration:

             To make Apache Solr instance as “Master”, we need to do the below configuration in solrconfig.xml.


 
    commit
    startup
 

You can find more details of master configuration here.

Slave configuration:

To make Apache Solr instance as “Slave”, we need to do the below configuration in solrconfig.xml.


 
    http://localhost:8180/solr/samplecatalog
    12:00:00
 

You can find more details of slave configuration here.

Now, we will see the admin consoles of master and slave instances.

Master Solr Admin Console

                     From the “Master” Solr instance admin console, we can disable the replication to all the “Slave” Solr instances by clicking on “Disable Replication” button.

Now, we will see the salve Solr instance admin console.

Slave Admin Console

                     From the “Slave” Solr instance admin console, we will come to know the replication polling time, the master instance, the master and slave index statuses, and the last iteration replication failures and success details. If we want to disable the polling from the slave, we can use the “Disable Polling” button. If we want to replicate the index from the master on-demand basis, we can use “Replicate Now” button.

                If you want more details about Solr replication, you can find here.

Advertisement

Siva Janapati is an Architect with experience in building Cloud Native Microservices architectures, Reactive Systems, Large scale distributed systems, and Serverless Systems. Siva has hands-on in architecture, design, and implementation of scalable systems using Cloud, Java, Go lang, Apache Kafka, Apache Solr, Spring, Spring Boot, Lightbend reactive tech stack, APIGEE edge & on-premise and other open-source, proprietary technologies. Expertise working with and building RESTful, GraphQL APIs. He has successfully delivered multiple applications in retail, telco, and financial services domains. He manages the GitHub(https://github.com/2013techsmarts) where he put the source code of his work related to his blog posts.

Tagged with: , , , , ,
Posted in Apache Solr, Solr Replication
One comment on “Apache Solr Index Replication
  1. Anonymous says:

    Nice information on Apache Solr

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Dzone.com
DZone

DZone MVB

Java Code Geeks
Java Code Geeks
OpenSourceForYou
%d bloggers like this: