Configuring SolrCloud for XConnect

Sitecore had a documentation page on their old doc site which detailed out how to setup Solr cloud for xConnect. That page has since been taken down and doesn’t appear to have been migrated to the new doc site. Luckily, I was able to find it cached. This blog post contains information taken from that cached page, mixed in with some of my own experiences.

Getting Started

You should already have Solr Cloud and Zookeeper setup and running with SSL. There are plenty of handy resources out there. If you don’t already have these setup, start follow these two guides before continuing on:

  1. Getting Started with SolrCloud
  2. SSL with SolrCloud

Uploading the Configurations

First thing you need to do is upload the configurations to Zookeeper. You should just use the “basic_configs” that come with Solr.

Navigate to your Solr bin folder (where Solr.cmd lives) and run the following in a command prompt:

solr zk upconfig -d basic_configs -n xdb -z <ZOOKEEPER_URL>

Important note: Zookeeper MUST have a different set of configurations for Sitecore and xDB. You can use basic_configs as a starting point for both, but you must make sure they’re separate. Running SIF for the xConnect Collection Search instance will make schema changes. If your Sitecore and xDB indexes share a configuration, it will cause the installation to fail (among other issues).

Creating Collections and Aliases

Once the configurations are uploaded, you need to setup the collections. xDB has 2 collections: xdb and xdb_rebuild. Per my note above, it is very important that you set these indexes to use the xdb configuration and not the Sitecore one.

The original guide indicated that you should actually append _internal to both of these indexes, and then setup aliases to give them the proper name. I’m not sure why (or if) this is needed, but everything worked after setting it up.

You should end up with the following indexes:

xdb_internal (with an alias of “xdb” pointed to it) xdb_rebuild_internal (with an alias of “xdb_rebuild” pointed to it) The connection strings of your xConnect sites should point to the alias name, not the index name.

Apply Schema Changes

If you haven’t run SIF yet to setup the xConnect Collection Search service or the xConnect Search Indexer, you should be safe to do so at this time.

Your connection string to Solr should be https://<loadbalancer>:<solrport>/solr/xdb;solrCloud=true

If you have already setup your xConnect Collection Search service or xConnect Search Indexer, you’ll have to use the Solr API to apply the Solr schema changes. The schema modifications are located in <xconnectCollectionSearchRoot>\solrcommands\schema.json.

Source

The original source of this information is currently cached from Google here. If Sitecore ever restores the page, I’ll update this link.