Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configuring Distributed

...

Caching

Configuration

  1. Configure a cacheManagerPeerProviderFactory in ehcache.xml
    Code Block
    xml
    xml
    <!--
     | The rmiUrls is a list of the cache peers of the server being configured.
     | Do not include the server being configured in the list.
     +-->
    <cacheManagerPeerProviderFactory
    		class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
    		properties="peerDiscovery=manual,
    		rmiUrls=${CACHE_PROVIDER_RMIURLS}"/>
    
  2. Configure a cacheManagerPeerListenerFactory in ehcache.xml
    Code Block
    xml
    xml
    <cacheManagerPeerListenerFactory
    		class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
    		properties="//hostname=${CACHE_LISTENER_HOSTNAME},port=${CACHE_LISTENER_PORT},
    		socketTimeoutMillis=120000"/>
    
    
  3. Configure each specific cache that you would like distribute via cacheEventListenerFactory in ehcache.xml
    Code Block
    xml
    xml
    <cache name="org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE"
        eternal="false" maxElementsInMemory="150" overflowToDisk="false" diskPersistent="false" 
        timeToIdleSeconds="0" timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU">
        <cacheEventListenerFactory
                class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
                properties="replicateAsynchronously=true, replicatePuts=false,
                replicateUpdates=false, replicateUpdatesViaCopy=false,
                replicateRemovals=true "/>
    </cache>
    
    Note
    titleImportant!

    It is important to note that we have configured each cache to use a "invalidation only" strategy by configuring only replicateRemovals=true (i.e. - no puts or updates). As I understand it, not everything that is currently being cached in uPortal 3 is guaranteed to implement java.io.Serializable and therefore may not be replicated across instances. Furthermore, using an invalidation strategy should reduce network traffic.

...