Configuring Ehcache using Terracotta Server Array

From AgileApps Support Wiki


If AgileApps platform is on a distributed setup, metadata resides in the caches and the caches are backed by Terracotta Server Array. If the caches do not synchronize, then a particular node of AgileApps platform is working on stale data. Terracotta Server Array provides distributed caching functionality to the case collision use case or an advanced use case, as case collision use case requires cache shared with the application servers. The session management for failovers depends on distributed cache. Terracotta Server Array provides support to the caching mechanism.

Configuring Ehcache
  1. Construct a Terracotta Server Array (TSA)
  2. Update the ehcache.xml configuration file available at {install_dir}/profiles/LJP/configuration/tomcat/conf/RN/ehcache.xml
    • Uncomment :
       <!--terracottaConfig rejoin="true" url="localhost:9510"/-->
      
    • Provide in the URL attribute, the host and port of the machine where TSA is installed.
    • Uncomment :
       <!--terracotta/-->
      
  3. Update the networking.properties configuration file available at {install_dir}/profiles/LJP/configuration/tomcat/conf/RN/networking.properties
    • Set CacheType=2
    • Set CacheName=distributed

Notepad.png

Note: The CacheName value must be similar to the cache configuration present in ehcache.xml. However, ehcache.xml can be configured based on requirement but the value of cache name must be the same in both ehcache.xml and networking.properties.

Frequently asked questions
  1. How should the URL be written if there are multiple TSA nodes?
  • For multiple node TSA, the URL must be comma separated [host1]:[port1], [host2]:[port2], [host3]:[port3]
Example: url=”host1:9510,host2:9510,host3:9510”
2. Can I leave “<terracotta/>” uncommented if I have not installed TSA? As it takes effect only when the CacheName specified in the networking.properties points to “<terracotta/>”.
  • No, the ehcache CacheManager loads the configured file and on identifying this tag, the ehcache CacheManager tries to locate a valid TSA instance, which if not present can cause issues.