Monday, February 29, 2016

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.

2 comments:

Fayad said...

ALL LOAN SERVICES AVAILABLE

Commercial Loans
Personal Loans
Business Loans
Investments Loans
Development Loans
Acquisition Loans
Construction loans
Business Loans And many More:

Contact Us At : royalworldfundings@gmail.com

LOAN APPLICATION FORM:

Full Name:................
Loan Amount Needed:.
Purpose of loan:.......
Loan Duration:..
Gender:.............
Marital status:....
Location:..........
Home Address:..
City:............
Country:......
Phone:..........
Mobile / Cell:....
Occupation:......
Monthly Income:....
Website You Heard About Us?......

Contact Us At : abdulasumanumar@gmail.com

Osman Ibrahim said...

Do you need a financial help? Are you in any financial crisis or do you need funds to start up your own business? Do you need funds to settle your debt or pay off your bills or start a good business? Do you have a low credit score and you are finding it hard to obtain capital services from local banks and other financial institutes? Here is your chance to obtain a financial services from our company. We offer the following finance to individuals-
*Commercial finance
*Personal finance
*Business finance
*Construction finance
*Business finance And many More:
and many more at 2% interest rate;
Contact Us Via Email:bullsindia187@gmail.com