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.
This project has become deprecated since Sitecore 9.0.0 release, which offers same functionality with extra benefits such as:
App_Config/Include/**
contents was moved to App_Config/Sitecore
)App_Config/Sitecore.config
is annotated as well as /App_Config/Sitecore/**
)Lucene
, Solr
, Azure
)something:define="option1"
and something:require="option2"
as you want)App_Config/Layers.config
(added App_Config/Environment
and App_Config/Modules
)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.
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.
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" />
Deploy the files to both ContentManagement
and ContentDelivery
Sitecore instances:
App_Config/Include/**/*
bin/Sitecore.Configuration.Roles.dll
Change web.config
files of ContentManagement
and 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>
...
(Optional) Verify actual configuration:
/sitecore/admin/showconfig.aspx
page of the ContentDelivery
instancesitecore_master_index
index configuration element is not presented on the pageThe 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>
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 names are transformed into "false" condition.
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.
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.
EXAMPLE 3 Here is an example of Sitecore solution with 5 Sitecore instances, one content-management only, one processing and reporting and 3 delivery.