Scaling Solr Without Downtime

Modifying the replication factor allows you to scale up Solr without downtime.

Context

Standard Solr configuration assumes that the replication factor is set to 1. Adding additional replicas to a shard affects only the shard and collection you are modifying.

Procedure

  1. Go to Collections in the Solr dashboard.
  2. From the list of available collections, select the collection to scale and expand the Shard section.
  3. Click Add replica and specify the node to create the replica on. Do not duplicate replicas on the same node.
  4. Click Create replica and reload the page.

    The new replica is visible on its designated shard and node in Start of the navigation pathCloud Next navigation step GraphEnd of the navigation path. In Start of the navigation pathCloud Next navigation step NodesEnd of the navigation path you can verify that the number of documents is the same on the source replica and its duplicate.

  5. To set the route cookie value:
    1. inspect the page
    2. set the route cookie value to the new replica
    3. refresh the page
  6. In the navigation menu on the left, select the modified collection and go to Start of the navigation pathQueryEnd of the navigation path. Run the default query for every new replica you created.
  7. To make the change permanent, update the SAP Commerce Cloud configuration:
    1. In properties, set the n value in solr.config.%s.replicationFactor = n to your desired number, where %s is the Solr config name and n is the number of replicas.
    2. In Backoffice, go to Start of the navigation pathAdministration Cockpit Next navigation step Search and Navigation Next navigation step Facet Search ConfigurationEnd of the navigation path. In the Cloud Mode Configuration section, set the Replication factor to the n value you specified before.

Results

The modified shard now has at least one replica. View the result in Start of the navigation pathCloud Next navigation step GraphEnd of the navigation path.