3

In our production environment, we have Master-Slave SOLR server configuration. We have 2 SOLR slave servers and configured SOLR load balancing URLs in prod CM and CD servers. Right now we are facing intermittent issues with our custom indexes and our search is not working properly. So every time we face this intermittent issue we need to rebuild the custom indexes to get the search results.

After investigation, we found that custom indexes in one of the SOLR slave servers are getting out of sync sometimes with the master SOLR server.

Our custom indexes have primary and secondary cores which also point differently in master and slave servers as we are using SwitchOnRebuildSolrSearchIndex.

Production Environment: For production, we have one Sitecore content management server and two content delivery servers.

Solr version: 7.2.1

Sitecore version: 9.1.0

Master Server SolrConfig.xml: enter image description here

Slave Server SolrConfig.xml:

enter image description here

Core.properties :

Master server:

enable.master = true

enable.slave = false

Slave server:

enable. master = false

enable. slave = true

SwitchOnRebuildSolrSearchIndex config:

enter image description here

enter image description here

3
  • Please can you specify which server roles are connected to the master Solr node and which to load balanced slave nodes? Please also include your configs of indexes where SwitchOnRebuildSolrSearchIndex is set up. Commented Mar 1, 2023 at 17:23
  • We have single load balancing URL which includes all three solr server (master and slave) which we have configured in sitecore CM and CD server. Commented Mar 2, 2023 at 10:59
  • Hi Gevel, I have included the configs of indexes in the post where SwitchOnRebuildSolrSearchIndex is set up Commented Mar 2, 2023 at 11:12

1 Answer 1

0

It doesn't directly answer your question. However, it answers, how everything could be organized.

You may do not to use SwitchOnRebuildSolrSearchIndex for Master-Slave Solr architecture.

Your CD servers should point to Slave Solr servers under load balancer. Your CM(indexing) server should point to Master Solr server. Your infrastructure should look something like this: enter image description here

SwitchOnRebuildSolrSearchIndex adds unnecessary complexity to Slave-Master architecture. SwitchOnRebuildSolrSearchIndex is required to avoid a "not-full" index during full index rebuild in one Solr server architecture.

How to disable replication during indexes rebuild:

  • No code, just configuration. You can configure <replicateAfter>commit</replicateAfter> on your Solr instances. providerUpdateContext.Commit() is called after the indexes rebuild.
  • Few code lines, but more control. You can enable or disable replication by calling endpoints http://master_host:port/solr/replication?command=disablereplication and http://master_host:port/solr/replication?command=enablereplication. You need to call them on indexing:start and indexing:end events. These endpoints are implemented in SolrNet, but they are not implemented in ContentSearch.
2
  • Thank you so much @Anton, appreciate your help. Please let me know should I remove my Master solr server from load balancing and only include the slave servers to point it to CD. Commented Mar 6, 2023 at 14:20
  • If you go with approach that I suggest and don't use SwitchOnRebuildSolrSearchIndex then yes, remove it.
    – Anton
    Commented Mar 7, 2023 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.