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.
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.
To make Apache Solr instance as “Master”, we need to do the below configuration in solrconfig.xml.
You can find more details of master configuration here.
To make Apache Solr instance as “Slave”, we need to do the below configuration in solrconfig.xml.
You can find more details of slave configuration here.
Now, we will see the admin consoles of master and slave instances.
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.
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.