Commit 442f492b authored by Misagh Moayyed's avatar Misagh Moayyed
Browse files

memcached config

parent 0516e2bc
......@@ -72,51 +72,15 @@ framework. This component is recommended over the default Java serialization mec
compact data, which benefits both storage requirements and throughput.
## Component Configuration
The following configuration is a template for `ticketRegistry.xml` Spring configuration:
{% highlight xml %}
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="ticketRegistry"
class="org.jasig.cas.ticket.registry.MemCacheTicketRegistry"
c:client-ref="memcachedClient"
c:ticketGrantingTicketTimeOut="${tgt.maxTimeToLiveInSeconds}"
c:serviceTicketTimeOut="${st.timeToKillInSeconds}" />
<bean id="memcachedClient" class="net.spy.memcached.spring.MemcachedClientFactoryBean"
p:servers="${memcached.servers}"
p:protocol="${memcached.protocol}"
p:locatorType="${memcached.locatorType}"
p:failureMode="${memcached.failureMode}"
p:transcoder-ref="kryoTranscoder">
<property name="hashAlg">
<util:constant static-field="net.spy.memcached.DefaultHashAlgorithm.${memcached.hashAlgorithm}" />
</property>
</bean>
<bean id="kryoTranscoder"
class="org.jasig.cas.ticket.registry.support.kryo.KryoTranscoder"
init-method="initialize"
c:initialBufferSize="8192" />
</beans>
{% endhighlight %}
`MemCacheTicketRegistry` properties reference:
## Configuration
{% highlight properties %}
# It is common to run memcached on every CAS node
memcached.servers=cas-1.example.org:11211,cas-2.example.org:11211,cas-3.example.org:11211
memcached.hashAlgorithm=FNV1_64_HASH
memcached.protocol=BINARY
memcached.locatorType=ARRAY_MOD
memcached.failureMode=Redistribute
# memcached.servers=cas-1.example.org:11211,cas-2.example.org:11211,cas-3.example.org:11211
# memcached.hashAlgorithm=FNV1_64_HASH
# memcached.protocol=BINARY
# memcached.locatorType=ARRAY_MOD
# memcached.failureMode=Redistribute
# memcached.buffersize=8192
{% endhighlight %}
## High Availability Considerations
......
<!--
Licensed to Apereo under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Apereo licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="ticketRegistry"
class="org.jasig.cas.ticket.registry.MemCacheTicketRegistry"
c:client-ref="memcachedClient"
c:ticketGrantingTicketTimeOut="${tgt.maxTimeToLiveInSeconds:7200}"
c:serviceTicketTimeOut="${st.timeToKillInSeconds:10}" />
<bean id="memcachedClient" class="net.spy.memcached.spring.MemcachedClientFactoryBean"
p:servers="${memcached.servers:cas-1.example.org:11211}"
p:protocol="${memcached.protocol:BINARY}"
p:locatorType="${memcached.locatorType:ARRAY_MOD}"
p:failureMode="${memcached.failureMode:Redistribute}"
p:transcoder-ref="kryoTranscoder">
<property name="hashAlg">
<util:constant static-field="net.spy.memcached.DefaultHashAlgorithm.${memcached.hashAlgorithm:FNV1_64_HASH}" />
</property>
</bean>
<bean id="kryoTranscoder"
class="org.jasig.cas.ticket.registry.support.kryo.KryoTranscoder"
init-method="initialize"
c:initialBufferSize="${memcached.buffersize:8192}" />
</beans>
</beans>
......@@ -346,6 +346,17 @@ tgc.signing.key=szxK-5_eJjs-aUj-64MpUZ-GPPzGLhYPLGl0wrYjYNVAGva2P0lLe6UGKGM7k8dW
# ehcache.repl.sync.updatesCopy=true
# ehcache.repl.sync.removals=true
##
# Memcached Ticket Registry
#
# memcached.servers=cas-1.example.org:11211,cas-2.example.org:11211,cas-3.example.org:11211
# memcached.hashAlgorithm=FNV1_64_HASH
# memcached.protocol=BINARY
# memcached.locatorType=ARRAY_MOD
# memcached.failureMode=Redistribute
# memcached.buffersize=8192
##
# OpenID Support
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment