Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

The default uPortal 3 Cache Configuration files are:

Configuring Distributed Caching

...

  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}"/>
    
    Info
    titleWhere

    ${CACHE_PROVIDER_RMIURLS}=<a pipe-delimited list of the cache peers of the server being configured>


    (Do not include the server being configured in the list...)


    See the NOTE below for further information regarding the value of this property.

  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"/>
    
    
    Info
    titleWhere

    ${CACHE_LISTENER_HOSTNAME}=<app server you are configuring>
    ${CACHE_LISTENER_PORT}=40001

  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.

    Info
    titleConfigured Caches

    Note that we chose to enable the distribution of the uPortal Framework and IBasicEntity Caches, but NOT the Hibernate Caches or Portal Stats Hibernate Caches:


    uPortal Framework Caches

    • org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE
    • org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE
    • org.jasig.services.persondir.USER_INFO
    • org.jasig.portal.channels.CONTENT_CACHE
    • org.jasig.portal.layout.dlm.LAYOUT_CACHE
    • org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE
    • org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE

    uPortal IBasicEntity Caches

    • org.jasig.portal.ChannelDefinition
    • org.jasig.portal.groups.IEntityGroup
    • org.jasig.portal.groups.IEntity
    • org.jasig.portal.security.IPermissionSet
    Anchor
    rmiUrls
    rmiUrls
    Info
    titlermiUrls Property Value

    It is (unfortunately) necessary to populate the rmiUrls property value differently for each cache peer included in the distribution matrix. Furthermore, each configured cache must be included on this list for each peer, so as you can imagine this value can become exceedingly long and difficult to read and manage. So, for example, I have listed the specific configuration values for what a 3 server configuration might look like below. (To "simplify" the management of these values, it might be advantageous to incorporate these property values into your specific deployment process via tokenization...)


    For app1:
    rmiUrls=//app2.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app2.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app2.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app2.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app2.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app2.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app2.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app2.foo.edu:40001/org.jasig.portal.groups.IEntity|//app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app2.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app2.foo.edu:40001/org.jasig.portal.security.IPermissionSet|//app3.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app3.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app3.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app3.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app3.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app3.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app3.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app3.foo.edu:40001/org.jasig.portal.groups.IEntity|//app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app3.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app3.foo.edu:40001/org.jasig.portal.security.IPermissionSet


    For app2:
    rmiUrls=//app1.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app1.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app1.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app1.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app1.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app1.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app1.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app1.foo.edu:40001/org.jasig.portal.groups.IEntity|//app1.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app1.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app1.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app1.foo.edu:40001/org.jasig.portal.security.IPermissionSet|//app3.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app3.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app3.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app3.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app3.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app3.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app3.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app3.foo.edu:40001/org.jasig.portal.groups.IEntity|//app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app3.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app3.foo.edu:40001/org.jasig.portal.security.IPermissionSet


    For app3:
    rmiUrls=//app1.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app1.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app1.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app1.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app1.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app1.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app1.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app1.foo.edu:40001/org.jasig.portal.groups.IEntity|//app1.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app1.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app1.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app1.foo.edu:40001/org.jasig.portal.security.IPermissionSet|//app2.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//app2.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//app2.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//app2.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//app2.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//app2.foo.edu:40001/org.jasig.portal.ChannelDefinition|//app2.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//app2.foo.edu:40001/org.jasig.portal.groups.IEntity|//app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//app2.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app2.foo.edu:40001/org.jasig.portal.security.IPermissionSet

...