Walkthrough: Setting up SolrCloud on Sitecore XC
Commerce Search supports SolrCloud (the Solr scaled environment). This walkthrough describes how to configure Sitecore XC environments and use SolrCloud as a search provider. It does not describe how to install SolrCloud itself.
As with Sitecore XP SolrCloud configuration, Sitecore XC SolrCloud configuration requires a load balancer.
SolrCloud affects the following Commerce environments:
- Authoring
- Minions
- DevOps
This walkthrough describes how to:
- Create a SolrCloud farm
- Implement a health check
- Upload the configuration to Zookeeper
- Create collections
- Configure Commerce Engine to use SolrCloud
- Enable support for SSL
Create a SolrCloud farm
Follow the instructions on the Solr website to install Solr and create a scaled environment, using two or more Solr nodes with one or more external Zookeeper services.
Alternatively, if you have already created a scaled Solr environment for your Sitecore XP deployment (described here), you can use the same SolrCloud instance for the Commerce Engine.
This walkthrough assumes a simple cluster with two Solr nodes and one Zookeeper service.
Implement a health check
It is recommended that you configure your load balancer to check whether each Solr node is available and returning status code OK. Refer to the Solr ping documentation for more information.
If you have two Solr nodes behind a load balancer, you need to check every Commerce Search Index for each node. By default, each Solr node should have three indexes: one index each for CatalogItems, Orders, and Customers.
Upload the configuration to Zookeeper
Follow these steps to upload the Solr configuration to Zookeeper:
-
In one of the Solr nodes you have set up, create three new folders under the folder
<node1_root>\solr\serverfolder\configsetsfolder:- CECatalogItemIndex
- CEOrderIndex
- CECustomerIndex
-
In the
configsetsfolder, locate and copy thedefaultfolder into each new sub-folder you created above. -
Copy the Sitecore XC Solr schema files for each Sitecore XC index to the appropriate sub-folder.
Sitecore XC Solr schemas are available in the
SolrSchemasfolder of theSolrSchemas.Sitecore.Commerce.x.x.xzip file, included in the Sitecore XC release package.- Copy the
SolrSchemas\CatalogItems\*.*files to theconfigsets\CECatalogItemIndex\conffolder. - Copy the
SolrSchemas\Customers\*.*files to theconfigsets\CECustomerIndex\conffolder. - Copy the
SolrSchemas\Orders\*.*files to theconfigsets\CEOrderIndex\conffolder.
- Copy the
-
In the
<solr_root>folder, run the following commands:
Create collections
When you have uploaded the Solr configurations to Zookeeper, you can create each Sitecore XC collection.
Follow these steps to create your Sitecore XC collections:
-
Navigate to the Collections page in the Solr admin UI, using one of the nodes you created.
-
Click Add Collection.
-
Specify values for the following fields and click Add Collection to create the CatalogItemScope collection:
- name: CatalogItemsScope
- config set: CECatalogItemIndexConfig
- numShards:
- replicationFactor:
-
Repeat for the OrdersScope index (where config set is
CEOrderindexConfig) and the CustomersScope index (where config set isCECustomerIndexConfig).NoteThe
CatalogItemsScope,OrdersScope, andCustomersScopenames are all default values. You can customize these names, but they must match the names specified in the Search Plugin policy.
Configure Commerce Engine to use SolrCloud
Both Commerce Engine and Sitecore require a connection to a load balancer. The load balancer must handle the failover for the Solr nodes.
Follow these steps for each environment to configure Commerce Engine to use SolrCloud as a search provider:
- Open the
PlugIn.Search.Solr.PolicySet-1.0.0.jsonfile. - Set the following parameters:
"IsSolrCloud" : "true""SolrUrl" : "<loadbalancerUrl>/solr"
- Bootstrap the Commerce Engine, as described in the Bootstrap the Commerce Engine topic.
Enable support for SSL
If you have enabled SSL for Solr, you must:
- Ensure that the
solr.searchconnection string in theConnectionStrings.configfile is an https URL.