Monday, April 6, 2015

Sitecore xDB Cloud Edition: What you need to know

Standard
I have been very fortunate to be involved in almost all of the cutting edge Sitecore implementations at Arke, and have had the privilege to work with several awesome members of the Sitecore team.

In one of my recent support projects, I got some great exposure to Sitecore's xDB Cloud offering. I wanted to share what I learnt with the community in hopes of providing a better understanding of what it takes to perform a successful implementation, some pitfalls, and how things change once you are in the cloud.

Getting Started

The "out of the box" components need to be updated in order to use xDB Cloud Edition. The following steps are from the client setup guide. I added some additional information and made some adjustments to make it easier to read.

Updating Cloud xDB Components

Before updating the Cloud xDB components, you need to perform following actions:

If you are using Sitecore 7.5:
  1. Open Website\App_Config\Include\ folder
  2. Remove or disable Sitecore.Cloud.Xdb.config file
If you are using Sitecore 8.0:
  1. Open Website\App_Config\Include\XdbCloud folder
  2. Remove or disable the following files:
    • Sitecore.Cloud.Xdb.config
    • Sitecore.ContentSearch.Cloud.Index.Analytics.config
    • Sitecore.ContentSearch.Cloud.DefaultIndexConfiguration.config
    • Sitecore.ContentSearch.Cloud.config
The following 2 packages, supplied by Sitecore's Cloud Team, need to be installed in your Sitecore instance:
  1. Sitecore.Cloud.ContentSearch
  2. Sitecore.Cloud.Xdb

Configuring the Sitecore Cloud xDB client

  1. Open the folder of your Sitecore installation, and navigate to Website\App_Config\Include\XdbCloud
  2. Open the Sitecore.Cloud.Xdb.config.disabled file and change the setting Sitecore.Cloud.Xdb.DeploymentId to the value that should identify your deployment. An example would be "Corp-V8X-Prod".
    • You must specify a value for this setting before you run Sitecore for the first time after you configure Sitecore to use a cloud xDB.
  3. Make sure that the your Sitecore.Cloud.Xdb.DeploymentType setting reflects the environment that you are configuring. Options are "Prod" and "NonProd".
  4. It is important to note:
    • Sitecore will not boot if this setting doesn't match what is retrieved from the xdb service.
    • Running a production solution on a non-prod SLA will degrade your overall SLA.
    • Running a non-production solution on a production data set will pollute the production data set.
  5. Enable the following config files (enable means remove .disabled extension from the name): 
    • Sitecore.Cloud.Xdb.config.disabled
    • Sitecore.ContentSearch.Cloud.Index.Analytics.config.disabled
    • Sitecore.ContentSearch.Cloud.DefaultIndexConfiguration.config.disabled

Upgrading from xDB Cloud Edition 7.5 to 8.0

  1. If you have been running Sitecore Cloud xDB 7.5, there is an upgrade process that needs to take place to make your dataset work with Sitecore 8.0.
  2. The reason for this is because there is an additional collection that is now present in 8.0
  3. At the time of writing this post, Sitecore was still working on finalizing the script to upgrade the 7.5 dataset to work with 8.0.

Provisioning a new xDB Cloud Dataset

  1. If you need to provision a new xDB set, you can do so by simply by changing the value present in Sitecore.Cloud.Xdb.DeploymentId that you will find in the Sitecore.Cloud.Xdb.config file.
  2. You have a quota limit tied to your licensing, so if you see a "Quota limit has been reached" error in your logs, you will need to contact your Sitecore sales rep.
  3. A common scenerio would involve setting up 2 datasets; one for staging and one for production.

Licensing

xDB Cloud Edition is tied to the your license ID. If you have recently made a change to your licensing, or if you are a new Sitecore customer, you will need to wait until you have received your permanent license in order to provision your cloud dataset.

Connection Strings

  1. The various Mongo connection strings that you find in your ConnectionStrings.config file are not needed after you have successfully connected to your xDB Cloud Dataset.
  2. When using the cloud, the connection strings are still actually there even though they don't appear in the configuration file. They are created dynamically InProc by the cloud discovery service. 
  3. The same applies to the reporting and reporting.secondary connection strings. However you need to have those in place in order to avoid the various errors that occur when trying to rebuild the reporting database. To be clear, this doesn’t really matter anyway because there currently isn't a way to make this work when using xDB Cloud Edition.

Losing the xDB Cloud connection

  1. If you lose the connection you don’t lose data
  2. The data is stored on the file system and then pushed to the cloud once the connection is re-established
  3. The data is stored in the $(dataFolder)/Submit Queue folder

xDB Cloud Dataset Access

One of the nice things about using xDB Cloud Edition, is that once your licensing is in place, getting up and running is very easy. All that you need to do is load 2 packages in your Sitecore instance, change 2 values in a configuration file, and enable the configuration. You also don't have to worry about some of the complex sharding and backup issues that will arise when dealing with an enterprise Mongo configuration.

The downside is that you don't have direct access to the various collections. So, you can't connect using a tool like Robomongo or MongoVUE. You also don’t have the ability to stand up new collections, if say you wanted to write some log entries or put some interesting CRM data in a new collection.

xDB Cloud Edition Reporting Databases

  1. It's important to note that the reporting SQL databases are hosted in the cloud. This includes both the primary and secondary.
  2. There is currently no way to successfully rebuild the reporting databases from the /sitecore/admin/rebuildreportingdb.aspx page.

Common Errors

Error

The connection string used by aggregation/historyTaskManager/ReportingStorage is missing when you attempt to rebuild reporting database from /sitecore/admin/rebuildreportingdb.aspx page

Resolution

The reporting.secondary connection string is not present. Although this secondary reporting database 
is not used by cloud xDB, it is necessary in order to get passed this error. 

Error

Analytics SPEAK pages show a series of errors

Resolution

All errors that I have seen in the various analytics pages are related to a xDB connection issue.
So if you are seeing some of the red error messages like this, make sure you check your logs for xDB connection errors.

Error

xDB Cloud Initialization failed

Sample:
 ERROR xDB Cloud - xDB Cloud initialization failed. Please contact cloud@sitecore.net and include this in the email:  
 **********************************************************************************  
   License Id: xxxxxxxxxxxxxxxxxxxx  
   Deployment Id: XXX-ProdV8-xDB  
   Issue id: 8bab88fa6e9c497b8d717eb62c39252c  
   Discovery Service Status Code: 403 Forbidden  
   Exception Details: Sitecore.Cloud.Xdb.Exceptions.RequestForbiddenException: Quota limit has been reached, or subscription wasn't found  
    at Sitecore.Cloud.Xdb.DiscoveryServiceClient.AssertStatusCodes(IRestResponse restResponse, String licenseId, String deploymentId)  
    at Sitecore.Cloud.Xdb.DiscoveryServiceClient.GetXdbSet(String licenseId, String deploymentId, String sitecoreVersion, DeploymentType deploymentType)  
    at Sitecore.Cloud.Xdb.DiscoveryServiceClient.GetXdbSet()  
    at Sitecore.Cloud.Xdb.UpdateXdbConnectionStrings.Process(PipelineArgs args)  
 **********************************************************************************  

Resolution

  1. As the message indicates, you will need to contact Sitecore's cloud team at cloud@sitecore.net to get these connection errors resolved. You must submit a ticket through support. Cloud issues now go through the regular support channel,  rather than a separate (as it was in the past). 
  2. The Issue id is key for them in identifying the cause of the error.
  3. The team is extremely helpful and their turnaround to get your issues resolved is pretty quick.

4 comments:

  1. Just a Heads-up.
    cloud@sitecore.net e-mail in case of problems has been deprecated.

    You have to create a support ticket at support.sitecore.net

    ReplyDelete
  2. Rik,

    Thanks for the comment. I updated the post to reflect this.

    Martin

    ReplyDelete
  3. Thanks Martin for this post! It was the only one I could find about the error we were having. Based on the timing of other comment, I'm guessing we're not the only ones hitting that request forbidden exception :)

    ReplyDelete
  4. Thanks for the comment Jason. Glad it was a help to you too. Yeah, it does seem that way :)

    Make sure you check out this KB article about having fake connection strings: https://kb.sitecore.net/articles/650142. It will save you a lot of pain if the discovery service has issues.

    I'm a fan of YOUR blog. Keep up the good work!

    Cheers.

    ReplyDelete