...
- 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
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...)
For app1:
${CACHE_PROVIDER_RMIURLS}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:
${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|//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:
${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|//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
- 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.
...