Customizing the clustered cache configuration files

The default versions of the clustered cache configuration files should work in most cases. However, you can if needed create and deploy customized versions.

The most likely customization that might be needed would be to the IP address and port number configured near the top of each file:

<cacheManagerPeerProviderFactory
		class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
		properties="peerDiscovery=automatic,multicastGroupAddress=230.0.0.1,multicastGroupPort=4446,timeToLive=1"
		propertySeparator=","
	/>

If you make any changes to these configuration files, make sure to make the same changes for all of the instances in the cluster.

To customize the clustered cache configuration files:

  1. Extract the default files from the ehcache directory in portal-impl.jar.
    The file is in the WEB-INF\lib directory, which is located:
    • For Tomcat, in webapps\ROOT
    • For WebSphere, in endeca-portal-versionNumber.war
    • For WebLogic, in endeca-portal-versionNumber.war, which is in endeca-portal-weblogic-versionNumber.ear
  2. Make the necessary updates to the files.
    To ensure that Studio uses the correct files, you may want to rename the customized files to something like:
    • hibernate-clustered-custom.xml
    • liferay-multi-vm-clustered-custom.xml
  3. For Tomcat, copy the customized files into webapps\ROOT\WEB-INF\classes\ehcache.
  4. To deploy the customized files in Weblogic:
    1. Undeploy endeca-portal-weblogic-versionNumber.ear.

      Use the appropriate method to undeploy the file based on whether you auto-deployed the .ear file or installed it.

    2. Update endeca-portal-weblogic-versionNumber.ear to add a subdirectory APP-INF/classes/ehcache/ that contains the customized XML files.
    3. Redeploy the updated .ear file.
  5. To deploy the customized files in Websphere:
    1. Log in to the Websphere Integrated Solutions Console.
    2. In the menu, expand the Applications section.
    3. Under Application Types, select WebSphere enterprise applications.
    4. Check the checkbox next to endeca-portal-versionNumber.war, then click Update.
    5. Select Replace or add a single file.
    6. In the Specify the path of the file to be replaced or added field, enter:

      endeca-portal-versionNumber.war/WEB-INF/classes/ehcache/hibernate-clustered-custom.xml

      Where versionNumber is the actual version string of the endeca-portal WAR file.

    7. Specify the path to hibernate-clustered-custom.xml either locally or remotely.
    8. Click Next, then click OK.
    9. After the file is deployed, save changes.
    10. Repeat steps d through I for the liferay-multi-vm-clustered-custom.xml file.
    11. Restart WAS.
  6. If needed, update portal-ext.properties to reflect the customized file names:
    net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered-custom.xml
    ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered-custom.xml