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
- pre-configured roles (
App_Config/Sitecore.configis annotated as well as
- search engine support (
- custom prefixes (you can add as many
something:require="option2"as you want)
- layers of configuration via
- Install NuGet Package
- Replace Include Configuration Files
- Update web.config files
- Verify if it works
- 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
1. Install NuGet Package
Sitecore.Configuration.Roles NuGet package:
PS> Install-Package Sitecore.Configuration.Roles
Alternatively, you can download it here and unpack to the
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:
- Sitecore 8.1 Update-3 - configuration/8.1.3
- Sitecore 8.2 Initial Release - configuration/8.2.0
- Sitecore 8.2 Update-1 - configuration/8.2.1
- Sitecore 8.2 Update-2 - configuration/8.2.2
- Sitecore 8.2 Update-3 - configuration/8.2.3
- Sitecore 8.2 Update-4 - configuration/8.2.4
- Sitecore 8.2 Update-5 - configuration/8.2.5
- Sitecore 8.2 Update-6 - configuration/8.2.6
- Sitecore 8.2 Update-7 - configuration/8.2.7
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
<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" />
Deploy the files to both
ContentDelivery Sitecore instances:
4. Update web.config files
web.config files of
ContentDelivery Sitecore instances so they are aware of their role.
... <configSections> <section name="sitecore" type="Sitecore.Configuration.Roles.RoleConfigReader, Sitecore.Configuration.Roles" /> ... </configSections> <appSettings> ... <add key="role:define" value="ContentManagement" /> </appSettings> ...
... <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.aspxpage of the
- make sure that the definition of the
sitecore_master_indexindex configuration element is not presented on the page
1. Define Role Command
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:
These roles are described below.
<configuration> ... <appSettings> ... <add key="role:define" value="ContentManagement|Processing|CustomFeature1" /> </appSettings> ... </configuration>
2. Require Role Command
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.
Defines Standalone role that is the same as Sitecore pre-configured out of box. It allows only single-server set up.
Defines Content Management (CM) role that allows editors to use editing applications like Content Editor, Page Editor etc.
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.
Defines xDB Processing (Proc) role. It can be enabled on the same instance with other roles or on a dedicated Sitecore instance.
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.
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