Key caveats while configuring SolrCloud With Sitecore

Image

Recently I was presented with an opportunity to implement SolrCloud with an XP1 distributed setup with Sitecore 9 Update 2.  SolrCloud brings in fault tolerance and high availability for applications deployed in a scaled-up environment.As exciting as it sounds, it didn’t take me long to realize that SolrCloud is a fragile beast when it comes to the configuration with Sitecore. As a newbie to the SolrCloud world I started with the following: -

  1. Official Sitecore documentation on integrating SolrCloud for content search and XConnect search.
  2. Our community member Ben Lipson did an excellent work covering the missing gaps through his blog post.

The SolrCloud configuration has a lot of moving parts. It took me few hours of research, troubleshooting and discussions with the community members to finally get it working.This blog post is all about sharing the learnings and highlighting key caveats essential for the successful SolrCloud setup with Sitecore.

Caveat 1

Associate individual Sitecore collections with their respective config set!

Problem

Tried creating 11 sitecore collections (default ones) using a shared configuration set and uploaded to zookeeper. While populating the schema from the Sitecore admin interface “Populate Managed Schema”, it attempts to populate the same schema repeatedly ultimately corrupting it. As a result, the SolrCloud logs will be filled up with the schema corruption messages as below:

 

Solution

To avoid this, each Sitecore collection requires to be associated with its own respective configuration set. i.e. for 11 Sitecore collections, 11 separate config sets should be uploaded to the zookeeper.Note that this doesn’t imply creating 11 copies for “basic_configs” configuration schema folder. Rather use the below command to upload and associate the same “basic_configs” config set to each Sitecore collection respectively.

solr zk upconfig -d basic_configs -n sitecore_master -z <ZOOKEEPER_URL>solr zk upconfig -d basic_configs -n sitecore_web -z <ZOOKEEPER_URL>solr zk upconfig -d basic_configs -n sitecore_core -z <ZOOKEEPER_URL>

Important: Would like to call out here that the above tip only applies to the Sitecore collections and not to the XConnect collections. The XConnect configuration set can be shared between XDB and XDB_Rebuild collections.

Caveat 2

Managed-Schema.xml should ONLY be modified for the Sitecore collections!

Even though the official guidelines state keeping separate configuration sets for Sitecore and XDB collections, there is a small caveat to it.

Problem

Solr comes with the “basic_configs” configuration set example out of the box. As per the official guidelines, the managed-schema.xml file should be modified to include "_uniqueid" as the unique key field configuration replacing the previous value of "id". This works great for the configuration sets uploaded for the Sitecore collections. The schema also gets successfully populated from the Sitecore control panel.

However, its observed that for the XConnect collections, running XConnect Collection Search instance SIF causes the installation to fail while trying to populate the XDB & XDB rebuild collection schemas. This again will reflect in the SolrCloud error log: -

Solution

  • Create the Sitecore collections based on the configuration set that contains the modified managed-schema.xml file.
  • Create the XDB collections based on the out of the box “basic_config” configuration set that comes with Solr, without any custom or modified files. Once this config set is uploaded to zookeeper, the SIF passes through and the XDB schemas get populated successfully.

 Hopefully, this post saves someone’s valuable time spent in investigation and troubleshooting.Happy Sitecoring and thanks for the read!