November Happy Hour will be moved to Thursday December 5th.

Loading...
Area: Optimizely CMS
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

Introduction

This document describes how to install and configure the aggregation service manually in EPiServer CMO. The aggregation service is a Windows service application which aggregates EPiServer CMO statistics data in defined time intervals for defined CMO instances.

Installing the Aggregation Service Manually

Default installation folder is [Path to your EPiServer installation]\ Shared\ Services\ CMO Aggregation Service\.
Example: C:\Program Files\ EPiServer\ Shared\ Services\ CMO Aggregation Service\

The following files need to be deployed to the Aggregation Service folder:

  • EPiServer.Cmo.AggregationService.exe
  • EPiServer.Cmo.AggregationService.exe.config
  • EPiServer.Cmo.AggregationContract.dll
  • log4net.dll

Aggregation service can be installed and uninstalled using standard framework utility:

InstallUtil.exe EPiServer.Cmo.AggregationService.exe

By default Aggregation service is installed with Automatic startup type and logs on as local service.

Configuring the Aggregation Service

Registering CMO instances for aggregation

It is possible to have different version of CMO module installed on one computer. It means that Aggregation Service should be able to work with all installed CMO versions. In the same time we need to avoid version dependencies, service should not depend on specific CMO version and code.

Aggregation Service uses reflection to discover and load implementations of IAggregationManager interface dynamically at runtime.

Aggregation Service configuration file contains configuration section cmoAggregationService to define available CMO versions and instances. Example of a service configuration:

XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="cmoAggregationService" 
            type="EPiServer.Cmo.AggregationService.Configuration.AggregationServiceSection, 
            EPiServer.Cmo.AggregationService" />
  </configSections>
  <cmoAggregationService>
    <cmoInstances>
      <add assemblyPath="CMO 1.0">
        <connectionStrings>
          <add name="CmoEntities10" 
            connectionString="..." providerName="System.Data.EntityClient" />
        </connectionStrings>
      </add>
      <add assemblyPath="CMO 1.1">
        <connectionStrings>
          <add name="CmoEntities11" 
            connectionString="..." providerName="System.Data.EntityClient" />
        </connectionStrings>
      </add>
    </cmoInstances>
  </cmoAggregationService>
</configuration>

cmoAggregationService contains the list of available CMO instances grouped by version.

The user can add a new CMO version and by using assemblyPath attribute define the path to assemblies that contain IAggregationManager implementation for this CMO version. Each CMO version section contains the number of connection strings to CMO databases inconnectionStrings subsection.

So each connection string corresponds to concrete CMO instance of concrete CMO version deployed on website.

By this example configuration service will work with 2 CMO versions: CMO 1.0 and CMO 1.1.

Folder [Aggregation Service path]\CMO 1.0 contains implementation of IAggregation Service interface for CMO 1.0 data model and service will use assemblies from [Aggregation Service path]\CMO 1.0 folder to aggragate data for all CMO 1.0 instances. In this configuration we have one CMO 1.0 instance with connection string CmoEntities10.

Folder [Aggregation Service path]\CMO 1.1 contains implementation of IAggregation Service interface for CMO 1.1 data model and service will use assemblies from [Aggregation Service path]\CMO 1.1 folder to aggragate data for all CMO 1.1 instances. In this configuration also we have one CMO 1.1 instance with connection string CmoEntities11.

Logging Settings

Application logging can be configured in the application configuration file. See more details about log4net configuration here: http://logging.apache.org/log4net/. By default logging is configured to write logs to debug output:

XML
<configuration>
  <configSections>
        <section name="log4net" 
            type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, 
            Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
              </configSections>   
  <log4net>   
  <appender name="OutputDebugStringAppender" 
            type="log4net.Appender.OutputDebugStringAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level - 
            %message%newline" />
    </layout>
  </appender>   

  <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="AggregationService.log.txt" />
    <appendToFile value="true" />
    <rollingStyle value="Date" />
    <datePattern value="yyyyMMdd " />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level - 
            %message%newline" />
    </layout>
  </appender>   
  <root>
    <level value="DEBUG" />
    <appender-ref ref="OutputDebugStringAppender" />
    <!--<appender-ref ref="RollingLogFileAppender" />-->
  </root>

  </log4net>
</configuration>
Note Service can output log data to files. To enable logging to file you need to uncommentRollingLogFileAppender option of <root> node in service configuration file, grant Modify permission on aggregation service folder (by default C:\Program Files\ EPiServer\ Shared\ Services\ CMO Aggregation Service\) to user used to run aggregation service (by default local service).

Removing the Aggregation Service

Aggregation service can be installed and uninstalled using standard framework utility as follows:

InstallUtil.exe /u EPiServer.Cmo.AggregationService.exe
Do you find this information helpful? Please log in to provide feedback.

Last updated: Mar 25, 2013

Recommended reading