Shrio+Ehcache集群时无法登录

夕拾贰 发布于 2015/09/09 22:40
阅读 1K+
收藏 1

服务器是一台机器,前面有个Nginx做分发,后面放了四个Tomcat,ehcache集群的方式用的是jGroups。

ehcache配置用的是官方的示例,具体如下:

<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="springDefaultCache">

	<diskStore path="java.io.tmpdir/readplatform/ehcache/spring" />

	<cacheManagerPeerProviderFactory
			class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
			properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
			    mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
			    PING(timeout=2000;num_initial_members=6):
			    MERGE2(min_interval=5000;max_interval=10000):
			    FD_SOCK:VERIFY_SUSPECT(timeout=1500):
			    pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
			    UNICAST(timeout=5000):
			    pbcast.STABLE(desired_avg_gossip=20000):
			    FRAG:
			    pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)"
			propertySeparator="::"
	/>

	<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="14400" timeToLiveSeconds="14400" overflowToDisk="false" >

	</defaultCache>


	<cache name="shiro-activeSessionCache"
	       maxElementsInMemory="1000"
	       eternal="false"
	       timeToIdleSeconds="1000"
	       timeToLiveSeconds="1000"
	       overflowToDisk="true"
		>
		<cacheEventListenerFactory
				class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
				properties="replicateAsynchronously=true,
							replicatePuts=true,
							replicateUpdates=true,
							replicateUpdatesViaCopy=false,
							replicateRemovals=true" />
	</cache>

</ehcache>
安全框架shrio的配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"
	default-lazy-init="true">

	<description>Shiro安全配置</description>

	<!-- Shiro Filter -->
	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
		<property name="securityManager" ref="securityManager" />
		<property name="loginUrl" value="/login.shtml" />
		<!--
		<property name="successUrl" value="/index.shtml" />
		-->
		<property name="unauthorizedUrl" value="/unauthorized.shtml" />
		<property name="filterChainDefinitions">
			<value>
				/login.shtml = anon
				/logout.shtml = logout
				/admin/** = authc
			</value>
		</property>
	</bean>

	<!-- Shiro's main business-tier object for web-enabled applications -->
	<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
		<property name="realm" ref="shiroDbRealm" />
		<property name="cacheManager" ref="shiroEhcacheManager" />
		<property name="sessionManager" ref="sessionManager" />
	</bean>

	<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
		<property name="sessionDAO" ref="sessionDao" />
		<property name="deleteInvalidSessions" value="true"/>
	</bean>

	<!-- shiro session由这个缓存来处理 -->
	<bean id="sessionDao" class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
		<property name="activeSessionsCacheName" value="shiro-activeSessionCache" />
	</bean>

	<!-- 项目自定义的Realm -->
	<bean id="shiroDbRealm" class="com.demo.reader.bussiness.security.shiro.ShiroDbRealm" init-method="initCredentialsMatcher">
		<property name="accountService" ref="accountService"/>
		<property name="authenticationCacheName" value="shiro.authorizationCache" />
	</bean>

	<!-- 用户授权信息Cache, 采用EhCache -->
	<bean id="shiroEhcacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
		<property name="cacheManager" ref="springCacheManagerFactory" />
	</bean>
	
	<!-- 起效权限注解,保证实现了Shiro内部lifecycle函数的bean执行 -->
	<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
	
	<!-- AOP式方法级权限检查  -->
	<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
		<property name="proxyTargetClass" value="true" />
	</bean>
	<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    	<property name="securityManager" ref="securityManager"/>
	</bean>
</beans>
当启动一个tomcat时登录成功,当启动两个以上的tomcat时候一直无法登录,我看ehcache的日志显示,当打印出一个received put 后会接着打印一个received remove,而cookie中的SessionID在每次登录失败后都会生成成一个新的ID,我也尝试打印了ehcache中的key,两个tomcat中存的key都是SessionID,而两个tomcat中的key也都不一样。 我觉得ehcache的集群没有配好,可是却不知道哪里错了。

有人知道这是什么原因么?

版本:

shiro:1.2.3
ehcache:2.6.11
ehcache-web:2.0.4
jgroups:2.12.3.Final
ehcache-jgroupsreplication:1.6

启动时候已经通过

-Djava.net.preferIPv4Stack=true



屏幕IPV6

加载中
0
夕拾贰
夕拾贰
@全体会员,拜托各位啦。 。 已经折腾了两天了,还没好,都快哭了。。。 
0
夕拾贰
夕拾贰

再发一个debug信息

01:31:19.546 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.547 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.547 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.547 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.548 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.548 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.549 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.549 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.549 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.550 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.551 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.552 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.553 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.553 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.553 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.553 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed, deleted 0 from heap
01:31:19.554 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed deleted 0 from disk
01:31:19.555 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.556 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.567 [springDefaultCache Async Replication Thread] DEBUG n.s.e.d.jgroups.JGroupsCachePeer - Sending 4 JGroupEventMessages from the asynchronous queue.
01:31:19.573 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.575 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.575 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.575 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.575 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.594 [Incoming-1,springDefaultCache,localhost-40802] DEBUG n.s.e.d.jgroups.JGroupsCacheReceiver - received put:             cache=shiro-activeSessionCache, key=efe34e96-293d-43fb-9368-c797dda4cb8b
01:31:19.594 [Incoming-1,springDefaultCache,localhost-40802] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.595 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.596 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.596 [Incoming-1,springDefaultCache,localhost-40802] DEBUG n.s.e.d.jgroups.JGroupsCacheReceiver - received remove:          cache=shiro-activeSessionCache, key=efe34e96-293d-43fb-9368-c797dda4cb8b
01:31:19.596 [Incoming-1,springDefaultCache,localhost-40802] DEBUG net.sf.ehcache.store.disk.Segment - remove deleted 0 from heap
01:31:19.596 [Incoming-1,springDefaultCache,localhost-40802] DEBUG net.sf.ehcache.store.disk.Segment - remove deleted 0 from disk
01:31:19.598 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.600 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.600 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.600 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.601 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.619 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.621 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.621 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.621 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.622 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.640 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.642 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.642 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.643 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.643 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.659 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.661 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.661 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.662 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.662 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.678 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.678 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.679 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.679 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.679 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.695 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.696 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.697 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.697 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.698 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.714 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.715 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.715 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.716 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.716 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.735 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.737 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.737 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.738 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.738 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.751 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.753 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.753 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.754 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.754 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.825 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.827 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.828 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.829 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.830 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.845 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.846 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.847 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.848 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.849 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.873 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.874 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.875 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.875 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.876 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.909 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.910 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.910 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.912 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.913 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.933 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.934 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.934 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.935 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.935 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.961 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.963 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.963 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.964 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.964 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:19.981 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:19.982 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:19.982 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:19.982 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:19.982 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:20.007 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:20.008 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:20.008 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:20.010 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:20.010 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:20.031 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:20.033 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:20.035 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:20.036 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:20.037 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:20.058 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:20.060 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:20.061 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:20.063 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:20.063 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:20.569 [springDefaultCache Async Replication Thread] DEBUG n.s.e.d.jgroups.JGroupsCachePeer - Sending 20 JGroupEventMessages from the asynchronous queue.
01:31:25.090 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.092 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.092 [http-18081-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.093 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.094 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.102 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.102 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.102 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.102 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed, deleted 0 from heap
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed deleted 0 from disk
01:31:25.103 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.103 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed, deleted 0 from heap
01:31:25.103 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault installation failed deleted 0 from disk
01:31:25.104 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.104 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.159 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.161 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.162 [http-18082-4] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.163 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.163 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.166 [http-18082-5] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.167 [http-18082-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.167 [http-18082-5] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.168 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.169 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.171 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.174 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.174 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.176 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.177 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.180 [http-18082-1] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.181 [http-18082-1] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.182 [http-18082-1] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.192 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.193 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.227 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.228 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on heap
01:31:25.228 [http-18082-3] DEBUG net.sf.ehcache.store.disk.Segment - put updated, deleted 0 on disk
01:31:25.229 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
01:31:25.229 [shiro-activeSessionCache.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
01:31:25.571 [springDefaultCache Async Replication Thread] DEBUG n.s.e.d.jgroups.JGroupsCachePeer - Sending 1 JGroupEventMessages from the asynchronous queue.
01:31:25.691 [springDefaultCache Async Replication Thread] DEBUG n.s.e.d.jgroups.JGroupsCachePeer - Sending 8 JGroupEventMessages from the asynchronous queue.
01:31:25.715 [Incoming-2,springDefaultCache,localhost-42485] DEBUG n.s.e.d.jgroups.JGroupsCacheReceiver - received put:             cache=shiro-activeSessionCache, key=8be5b5c3-9acd-4b98-9f28-b044790db936
01:31:25.716 [Incoming-2,springDefaultCache,localhost-42485] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
01:31:25.716 [Incoming-2,springDefaultCache,localhost-42485] DEBUG n.s.e.d.jgroups.JGroupsCacheReceiver - received remove:          cache=shiro-activeSessionCache, key=8be5b5c3-9acd-4b98-9f28-b044790db936
01:31:25.716 [Incoming-2,springDefaultCache,localhost-42485] DEBUG net.sf.ehcache.store.disk.Segment - remove deleted 0 from heap




0
公孙二狗
公孙二狗

自己实现 SessionDAO 了吗,默认的 Session 是存储在 Server 自己的 JVM 里的,集群需要所有Server访问同一个Session才行。

0
夕拾贰
夕拾贰

引用来自“jorneyr”的评论

自己实现 SessionDAO 了吗,默认的 Session 是存储在 Server 自己的 JVM 里的,集群需要所有Server访问同一个Session才行。

org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO



这个不是已经实现了cache了么 ?


0
木子丰
木子丰

replicateUpdatesViaCopy=false的原因吧,应该设置为true

false时,一台服务器上的缓存变化后,会通知其它服务器上把相应的缓存移除

返回顶部
顶部