No description, website, or topics provided.
Clone or download
Latest commit 5e1eadd Jul 23, 2018
Permalink
Failed to load latest commit information.
src Release 1.3 Jun 26, 2017
.gitignore Implement transform tool (closes #10) May 29, 2017
readme.md Update readme for 8.2.7 Jul 10, 2018

readme.md

Sitecore Configuration Roles

This document describes how to configure a Sitecore instance to use one of the pre-defined server roles. After you install a Sitecore instance, the only changes you need to make are to install the module and update settings that define which server role it will have.

Available in Sitecore 9.0 out-of-box

This project has become deprecated since Sitecore 9.0.0 release, which offers same functionality with extra benefits such as:

  • refactored configuration files (stock App_Config/Include/** contents was moved to App_Config/Sitecore)
  • pre-configured roles (App_Config/Sitecore.config is annotated as well as /App_Config/Sitecore/**)
  • search engine support (Lucene, Solr, Azure)
  • custom prefixes (you can add as many something:define="option1" and something:require="option2" as you want)
  • layers of configuration via App_Config/Layers.config (added App_Config/Environment and App_Config/Modules)

Index

Prerequsites
How To
  1. Install NuGet Package
  2. Replace Include Configuration Files
  3. Deploy
  4. Update web.config files
  5. Verify if it works
Details
  1. Define Role Command
  2. Require Role Command
  3. Modified configuration files
Comments

Prerequsites

  • Sitecore CMS 8.1 rev. 160302 (Update-2)
  • Sitecore CMS 8.1 rev. 160302 (Update-3)
  • Sitecore CMS 8.2 - all releases

In this project Sitecore configuration engine was extended with two simple commands and modified configuration files that use them. It is distributed as a module which is based on the Sitecore CMS 8.1 rev. 160302 (Update-2) which now allows patching configuration engine.

How to

1. Install NuGet Package

Install the Sitecore.Configuration.Roles NuGet package:

PS> Install-Package Sitecore.Configuration.Roles

Alternatively, you can download it here and unpack to the bin folder.

2. Replace Include Configuration Files

Replace default Sitecore configuration files in App_Config/Include folder with annotated ones.

Delete entire contents of App_Config/Include folder (except DataFolder.config file and your custom files) and replace with files from one of the branches:

Go through your custom configuration files and annotate configuration nodes that must be presented only in certain kind of instances.

For example, the item saved event handlers in Customization.config file to be used only in the ContentManagement environment:

 <configuration xmlns:role="http://www.sitecore.net/xmlconfig/role/">
    <sitecore role:require="ContentManagement">
      <events>
        <event name="item:saved" role:require="ContentManagement">
          <handler type="Website.Class1, Website" method="OnItemSaved" />

3. Deploy

Deploy the files to both ContentManagement and ContentDelivery Sitecore instances:

App_Config/Include/**/*
bin/Sitecore.Configuration.Roles.dll

4. Update web.config files

Change web.config files of ContentManagement and ContentDelivery Sitecore instances so they are aware of their role.

ContentManagement

  ...
  <configSections>
    <section name="sitecore" type="Sitecore.Configuration.Roles.RoleConfigReader, Sitecore.Configuration.Roles" />
    ...
  </configSections>
  <appSettings>
    ...
    <add key="role:define" value="ContentManagement" />
  </appSettings>
  ...

ContentDelivery

  ...
  <configSections>
    <section name="sitecore" type="Sitecore.Configuration.Roles.RoleConfigReader, Sitecore.Configuration.Roles" />
    ...
  </configSections>
  <appSettings>
    ...
    <add key="role:define" value="ContentDelivery" />
  </appSettings>
  ...

5. Verify if it works

(Optional) Verify actual configuration:

  • navigate to the /sitecore/admin/showconfig.aspx page of the ContentDelivery instance
  • make sure that the definition of the sitecore_master_index index configuration element is not presented on the page

Details

1. Define Role Command

The role:define command defines pipe-separated list of configuration roles the given Sitecore instance has.

The role name can be any string that matches the [a-zA-Z0-9]+ pattern, however there are several commonly used conventional role names to use:

  • Standalone
  • ContentManagement
  • Reporting
  • Processing
  • ContentDelivery

These roles are described below.

Example

<configuration>
  ...
  <appSettings>
    ...
	   <add key="role:define" value="ContentManagement|Processing|CustomFeature1" />
  </appSettings>
  ...
</configuration>

2. Require Role Command

When role:require command is applied to a XML configuration node within Sitecore include config file the node will be ignored if the boolean expression is false. When the expression is evaluated, every configuration role that is defined by the role:define command is being transformed into "true" and all undefined role naes are transformed into "false" condition.

3. Modified configuration files

The module is shipped with modified stock configuration files to make Sitecore pre-configured to serve each of these configuration roles.

Standalone

Defines Standalone role that is the same as Sitecore pre-configured out of box. It allows only single-server set up.

ContentManagement

Defines Content Management (CM) role that allows editors to use editing applications like Content Editor, Page Editor etc.

Reporting

Defines xDB Reporting (Rep) role that fetches reporting data from various data sources to use in Sitecore reporting applications. It can be enabled on the same instance with other roles or on a dedicated Sitecore instance.

Processing

Defines xDB Processing (Proc) role. It can be enabled on the same instance with other roles or on a dedicated Sitecore instance.

ContentDelivery

Defines Content Delivery (CD) role that assumes current Sitecore instance is accessed only by end-users and Sitecore administrators. It cannot be enabled on the same instance with other roles.

Examples

EXAMPLE 1 Here is an example of Sitecore solution with single Sitecore instance.

  • SRV-01: Standalone

EXAMPLE 2 Here is an example of Sitecore solution with 2 Sitecore instances: one is multipurpose, another is delivery only - both serve front-end users.

  • SRV-01: ContentManagement|Processing|Reporting
  • SRV-02: ContentDelivery

EXAMPLE 3 Here is an example of Sitecore solution with 5 Sitecore instances, one content-management only, one processing and reporting and 3 delivery.

  • SRV-01: ContentManagement
  • SRV-02: Processing|Reporting
  • SRV-03: ContentDelivery
  • SRV-04: ContentDelivery
  • SRV-05: ContentDelivery