...
The default uPortal 3 Cache Configuration files are:
- Spring Configuration:
cacheContext.xml
- ehcache Configuration:
ehcache.xml
Configuring Distributed Caching
...
- Configure a
cacheManagerPeerProviderFactory
inehcache.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 title rmiUrls Property Value It is (unfortunately) necessary to populate the
For app1: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. 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...)
${CACHE_PROVIDER_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/Where ${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. - Configure a
cacheManagerPeerListenerFactory
inehcache.xml
Code Block xml xml <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="//hostname=${CACHE_LISTENER_HOSTNAME},port=${CACHE_LISTENER_PORT}, socketTimeoutMillis=120000"/>
Info title Where ${CACHE_LISTENER_HOSTNAME
}=<app server you are configuring>
${CACHE_LISTENER_PORT
}=40001 - Configure each specific cache that you would like distribute via
cacheEventListenerFactory
inehcache.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 title Important! 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 implementjava.io.Serializable
and therefore may not be replicated across instances. Furthermore, using an invalidation strategy should reduce network traffic.Info title Configured 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 Cachesorg.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
Configure aInfo title rmiUrls 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/
eduorg.
jhujasig.
servicesportal.
persondirsecurity.
supportprovider.
httpAuthorizationImpl.AUTH_PRINCIPAL_CACHE|//
app3app2.foo.edu:40001/org.jasig.portal.groups.
security.IPermissionSet For app2:
${CACHE_PROVIDER_RMIURLS}=//app1CompositeEntityIdentifier.NAME_PARSE_CACHE|//app2.foo.edu:40001/org.jasig.
portalservices.
security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHEpersondir.USER_INFO|//
app1app2.foo.edu:40001/org.jasig.portal.
groupschannels.
CompositeEntityIdentifier.NAMECONTENT_
PARSE_CACHE|//
app1app2.foo.edu:40001/org.jasig.portal.
serviceslayout.
persondirdlm.
USERLAYOUT_
INFOCACHE|//
app1app2.foo.edu:40001/org.jasig.portal.
channels.CONTENT_CACHEChannelDefinition|//
app1app2.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|//app1groups.IEntityGroup|//app2.foo.edu:40001/org.jasig.portal.groups.IEntity|//
app1app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//
app1app2.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//
app1app2.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//
app1app2.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 app3app2:
${CACHE_PROVIDER_RMIURLS}=/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|//
app2app3.foo.edu:40001/org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE|//
app2app3.foo.edu:40001/org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE|//
app2app3.foo.edu:40001/org.jasig.services.persondir.USER_INFO|//
app2app3.foo.edu:40001/org.jasig.portal.channels.CONTENT_CACHE|//
app2app3.foo.edu:40001/org.jasig.portal.layout.dlm.LAYOUT_CACHE|//
app2app3.foo.edu:40001/org.jasig.portal.ChannelDefinition|//
app2app3.foo.edu:40001/org.jasig.portal.groups.IEntityGroup|//
app2app3.foo.edu:40001/org.jasig.portal.groups.IEntity|//
app2app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE|//
app2app3.foo.edu:40001/org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE|//
app2app3.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//
app2app3.foo.edu:40001/org.jasig.portal.security.IPermissionSet
cacheManagerPeerListenerFactory
inehcache.xml
Code Block xml xml <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="//hostname=${CACHE_LISTENER_HOSTNAME},port=${CACHE_LISTENER_PORT}, socketTimeoutMillis=120000"/>
Configure each specific cache that you would like distribute viaInfo title Where ${CACHE_LISTENER_HOSTNAME}=<app server you are configuring>
${CACHE_LISTENER_PORT}=40001cacheEventListenerFactory
inehcache.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 title Important! 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 implementjava.io.Serializable
and therefore may not be replicated across instances. Furthermore, using an invalidation strategy should reduce network traffic.
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
...
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
...
uPortal IBasicEntity Caches
...
|//app2.foo.edu:40001/edu.jhu.services.persondir.support.http.CACHE|//app2.foo.edu:40001/org.jasig.portal.security.IPermissionSet
...
Monitoring ehcache using JMX and JConsole
...