windows nginx 负载均衡 公用 session

我们 通过 memcache 实现

下载memcache的windows稳定版,安装

比如 meemcache 安装 在 192.168.3.1 服务器上 ,

本机 的 tomcat 里的 conten.xml 文件 修改 如下

<?xml version="1.0" encoding="UTF-8"?>

    <WatchedResource>WEB-INF/web.xml</WatchedResource>
	<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" 
	memcachedNodes="n1:192.168.3.1:11211" 
	lockingMode="auto"
	sticky="false" 
	requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)|\f5.jsp$"
	sessionBackupAsync="false" 
	sessionBackupTimeout="100"
	transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory" 
	copyCollectionsForSerialization="true"/>
</Context>


与均衡所使用的 tomcat 搭配使用 所有 tomcat 的 content.xml 都 将 session 指向 到这个 memcache 下


猜你喜欢

转载自blog.csdn.net/zsm136767349700/article/details/53746568
今日推荐