memcached session共享Timeout异常

异常信息:
net.spy.memcached.internal.CheckedOperationTimeoutException: Timed out waiting for operation - failing node: /127.0.0.1:11211

在tomcat content.xml中的配置:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:127.0.0.1:11210" sticky="false" sessionBackupAsync="false" lockingMode="uriPattern:/path1|/path2" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />

异常信息:

Jan 13, 2016 3:37:17 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
WARNING: An error occurred during onAfterBackupSession.
net.spy.memcached.internal.CheckedOperationTimeoutException: Timed out waiting for operation - failing node: /127.0.0.1:11211

    at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:73)
    at de.javakaffee.web.msm.LockingStrategy.onAfterBackupSession(LockingStrategy.java:286)
    at de.javakaffee.web.msm.MemcachedSessionService.backupSession(MemcachedSessionService.java:843)
    at de.javakaffee.web.msm.SessionTrackerValve.backupSession(SessionTrackerValve.java:217)
    at de.javakaffee.web.msm.SessionTrackerValve.invoke(SessionTrackerValve.java:128)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:724)
Could not store session 10B440C58BBB394C25E09529E3DCE907-n1 in memcached due to unavailable node n1.
Note that this session was relocated to this node because the original node was not available.

解决办法:

  <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:182.92.214.173:11211" sticky="false" sessionBackupAsync="false" lockingMode="auto" sessionBackupTimeout="1800000" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />

加上属性:sessionBackupTimeout=”1800000” 后,没有再出现这个问题。

你可能感兴趣的:(tomcat,session,异常,memcached)