Hi,

   We have 2 tomcat servers running behind load balancer and the SSL terminated 
at the LB. So far I have working set up of CAS with Ehcache and I could see the 
cache being populated/replicated between the 2 nodes. I followed the steps 
provided in following wiki page for Ehcache ticket registry : 
https://wiki.jasig.org/display/CASUM/EhcacheTicketRegistry

I would like to set up our environment for HA. I would like to know if the 
configuration specified in the wiki page enough for making CAS HA with Ehcache? 
Is there something else that I need to configure to make CAS HA? 

I have attached the ehcache-replicated.xml and the ticketRegistry.xml for our 
environment for reference. 

Thanks,
Rakesh


-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
<ehcache name="ehCacheTicketRegistryCache"
    updateCheck="false"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd";>

        <diskStore path="java.io.tmpdir/cas"/>

        <!-- Manual Peer Discovery -->
        <cacheManagerPeerProviderFactory
            class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
            properties="peerDiscovery=manual,rmiUrls=//CASServer2:41001/org.jasig.cas.ticket.ServiceTicket|//CASSever2:41001/org.jasig.cas.ticket.TicketGrantingTicket" propertySeparator=","/>

        <cacheManagerPeerListenerFactory
            class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
            properties="port=41001,remoteObjectPort=41002,socketTimeoutMillis=5000" />

</ehcache>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:p="http://www.springframework.org/schema/p";
  xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans.xsd";>
  <description>
    Configuration for the EhCache TicketRegistry which stores the tickets in a distributed EhCache and cleans
    them out as specified intervals.
  </description>

  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache-replicated.xml" />
    <property name="shared" value="true" />
    <property name="cacheManagerName" value="ticketRegistryCacheManager" />
  </bean>

  <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="true" />
  </bean>

  <bean id="managementService" class="net.sf.ehcache.management.ManagementService" init-method="init" destroy-method="dispose">
    <constructor-arg ref="cacheManager" />
    <constructor-arg ref="mbeanServer" />
    <constructor-arg value="true" />
    <constructor-arg value="true" />
    <constructor-arg value="true" />
    <constructor-arg value="true" />
  </bean>

  <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.EhCacheTicketRegistry"
    p:serviceTicketsCache-ref="serviceTicketsCache" 
    p:ticketGrantingTicketsCache-ref="ticketGrantingTicketsCache" />

  <bean id="abstractTicketCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"
    abstract="true">
    <property name="cacheManager" ref="cacheManager" />
    <property name="diskExpiryThreadIntervalSeconds" value="0" />
    <property name="diskPersistent" value="false" />
    <property name="eternal" value="false" />
    <property name="maxElementsInMemory" value="10000" />
    <property name="maxElementsOnDisk" value="20000" />
    <property name="memoryStoreEvictionPolicy" value="LRU" />
    <property name="overflowToDisk" value="true" />
    <property name="bootstrapCacheLoader">
      <ref local="ticketCacheBootstrapCacheLoader" />
    </property>
  </bean>

  <bean id="serviceTicketsCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"
    parent="abstractTicketCache">
    <property name="cacheName" value="org.jasig.cas.ticket.ServiceTicket" />
    <property name="cacheEventListeners">
      <ref local="ticketRMISynchronousCacheReplicator" />
    </property>
    <property name="timeToIdle" value="0" />
    <property name="timeToLive" value="300" />
  </bean>

  <bean id="ticketGrantingTicketsCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    <property name="cacheName" value="org.jasig.cas.ticket.TicketGrantingTicket" />
    <property name="cacheEventListeners">
      <ref local="ticketRMIAsynchronousCacheReplicator" />
    </property>
    <property name="timeToIdle" value="7201" />
    <property name="timeToLive" value="0" />
  </bean>

  <bean id="ticketRMISynchronousCacheReplicator" class="net.sf.ehcache.distribution.RMISynchronousCacheReplicator">
    <constructor-arg name="replicatePuts" value="true" />
    <constructor-arg name="replicatePutsViaCopy" value="true" />
    <constructor-arg name="replicateUpdates" value="true" />
    <constructor-arg name="replicateUpdatesViaCopy" value="true" />
    <constructor-arg name="replicateRemovals" value="true" />
  </bean>

  <bean id="ticketRMIAsynchronousCacheReplicator" class="net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator"
    parent="ticketRMISynchronousCacheReplicator">
    <constructor-arg name="replicationInterval" value="10000" />
    <constructor-arg name="maximumBatchSize" value="100" />
  </bean>

  <bean id="ticketCacheBootstrapCacheLoader" class="net.sf.ehcache.distribution.RMIBootstrapCacheLoader">
    <constructor-arg name="asynchronous" value="true" />
    <constructor-arg name="maximumChunkSize" value="5000000" />
  </bean>

</beans>

Reply via email to