Skip to main content

Tips for configuring the SDL Tridion Cache Channel Service


When installing and configuring cache, you may have one of these two scenarios below:

Scenario 1: The deployer, CCS and websites all reside in the same server

When the deployer, CCS and websites are running on the same server, open the cd_storage_conf.xml of one of these components and make the following changes:
·         Enable caching by setting the following flag to true:
            <ObjectCache Enabled=“true">
·         Leave the RMI section commented out:

<!-- RMI CacheChannel Connector example                              
 <RemoteSynchronization Queuesize="128" ServiceMonitorInterval="10000" FlushCacheDuringDisconnectInterval="20000">
     <Connector Class="com.tridion.cache.RMICacheChannelConnector" Host="127.0.0.1" Port="1099" />
</RemoteSynchronization>  -->
·         Enable the item types that you would like to cache, by explicitly adding the cached element and setting it to true:

<Item typeMapping="Metadata" cached="true"(..)/>
<Item typeMapping="ComponentVisit" cached="true" (..)/>
<Item typeMapping="DynamicLinkInfo" cached="true"(..)/>
After saving these changes, ensure to copy this new version of the cd_storage_conf.xml to the other two components, as the deployer, CCS and websites need to have a matching cd_storage_conf.xml.

Scenario 2: The deployer, CCS and/or the websites reside in different servers

  1. Open the cd_storage_conf.xml of the deployer and make the following changes:
·         Enable caching by setting the following flag to true:
<ObjectCache Enabled=“true">

·         Enable the RMI section:
 <RemoteSynchronization Queuesize="128" ServiceMonitorInterval="10000" FlushCacheDuringDisconnectInterval="20000">
<Connector Class="com.tridion.cache.RMICacheChannelConnector" Host="127.0.0.1" Port="1099" />
</RemoteSynchronization>
·         Change the IP address and port of the ConnectorClass to match the IP address of the CCS, for example:

<Connector Class="com.tridion.cache.RMICacheChannelConnector" Host="172.16.123.12" Port="1099" />

·         Enable the item types that you would like to cache, by explicitly adding the cached element and setting it to true:

<Item typeMapping="Metadata" cached="true"(..)/>
<Item typeMapping="ComponentVisit" cached="true" (..)/>
<Item typeMapping="DynamicLinkInfo" cached="true"(..)/>

Save the changes and restart the deployer application. 



2. Navigate to the cd_storage_conf.xml of the CCS that is running on a different server than the deployer. Make the following changes to the cd_storage_conf.xml:
 
·         Enable caching by setting the following flag to true:
            <ObjectCache Enabled=“true">
·         Leave the RMI section commented out:

<!-- RMI CacheChannel Connector example                              
 <RemoteSynchronization Queuesize="128" ServiceMonitorInterval="10000" FlushCacheDuringDisconnectInterval="20000">
     <Connector Class="com.tridion.cache.RMICacheChannelConnector" Host="127.0.0.1" Port="1099" />
</RemoteSynchronization>  -->
·         Copy the item types configured to be cached of the deployer’s cd_storage_conf.xml, following the example above:

<Item typeMapping="Metadata" cached="true"(..)/>
<Item typeMapping="ComponentVisit" cached="true" (..)/>
<Item typeMapping="DynamicLinkInfo" cached="true"(..)/>

      Save these changes and restart the Tridion Cache Channel Service.
      
      3. Navigate now to the website’s cd_storage_conf.xml and if it is running on the same server as the deployer, make the same changes as in step 1. Otherwise, if the website is running on the same server as the CCS, then make the same changes as proposed in step 2.

Note: Points to keep in mind when you are configuring scenario 2:

When there are multiple network cards, the following error might be logged on the cd_core.log when trying to connect to the CCS:

Could not connect to Cache Channel Service on startup, will attempt again in 10000ms
com.tridion.cache.CacheException (…)
Caused by: java.rmi.ConnectException: Connection refused to host: 10.95.100.46; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)

This error occurs because RMI picks up randomly one of the available IP addresses, causing these connectivity issues. The solution is to force the RMI to pick up a specific IP address. This needs to be configured in the server that has the deployer and/or website that wants to communicate to the CCS running on another server.
To achieve this, open the Windows Registry and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Tridion\Content Delivery\General  and adding this new String jvmarg1 with value: -Djava.rmi.server.hostname=correctIP.

If you don't see the Tridion key present in the Windows Registry, go ahead and create that entry and the other ones too.


This is how the new String should look like:


I add these screenshots because I had some difficulties finding an example that showed how I should add this entry. This will require a restart of the CCS for changes to be refreshed.


When enabling RMI, keep in mind that:
Java assigns a random port for the CCS (besides the one where the CCS is running) and the deployer needs full access to that server to be able to subscribe and send messages to the Cache;
This requires completely disabling the firewalls active on all servers involved for the communication to pass through. If, for security reasons you cannot disable these firewalls, you can opt for installing the deployer and CCS in the same server instead.

Comments

Popular posts from this blog

SDL Tridion: Tips to troubleshoot and resolve the 'Throttling' status

The throttling status should be a temporary state, so although you might see some items in the Publishing Queue with that state, it should resolve itself once the deployer has available threads to pick up more packages. In case the items stay 'stuck' in this status, there are a few things you can check that I enumerate below:
·As mentioned in the documentation, ensure that the window size is equal to or larger than the total number of Transport Service threads configured on the Content Manager side. This settings can be found in the cd_transport_conf.xml, as follows:
<Workers NormalPriorityPoolSize="5" HighPriorityPoolSize="5" TransportPriorityPoolSize="5"/>
By default, this section is commented out and these are the default values. If the deployer’s window size is lower than 5 then you need to change it to ensure that it is set to 5 or higher.
·Check if the database maintenance tasks for the broker database are in place and the frequency tha…

SDL Tridion: How to enable Profiling and Personalization in 2013 using Tracking Keys

When attempting to setup Profiling and Personalization in Tridion, I have faced some challenges and once I was able to get it to work, I have made a small list of steps that were essential to finish this setup.

Here you can find the steps I have followed to be able to enable P&P in my SDL Tridion 2013 environment using Tracking Keys:

Add the cd_wai.jar to your deployer and website's lib folder;

Add the cd_wai_conf.xml to your deployer and website's config folder;

Update the cd_wai_conf.xml to include a reference to the host name, in other words, the location of your website. In my case, I have changed it to the following:

<Host Domain="localhost" Port="83" Protocol="http" Path="/"/>

In the same configuration file, ensure to enable Personalization, as follows:

<Personalization Enabled="true" Persistence="cookies">

Now in your CME, create your target groups, by selecting your publication folder where yo…