tomcat-redis-session-manager实现tomcat session共享
来源:互联网 发布:比电驴好的软件 编辑:程序博客网 时间:2024/05/10 18:07
需要jar文件 放在tomcat lib目录下
1.jedis-2.1.0.jar
2.commons-pool-1.6.jar
3.commons-pool2-2.2.jar
4.tomcat-redis-session-manager-1.2-tomcat-6-1.2.jar
context.xml 文件添加
<Valve className="com.radiadesign.catalina.session.RedisSessionHandlerValve"/><Manager className="com.radiadesign.catalina.session.RedisSessionManager" host="localhost"<!--redis服务器地址--> port="6379" <!--redis端口--> database="0" maxInactiveInterval="60"/><!--过期时间-->
nginx反向代理配置nginx.conf
upstream xy.com { server localhost:8080; server localhost:8081; } log_format www.xy.com '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer"' '"$http_user_agent" "$http_x_forwarded_for"'; server { listen 8090; server_name www.xy.com; location / { proxy_connect_timeout 3; proxy_send_timeout 30; proxy_read_timeout 30; proxy_pass http://xy.com; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log logs/localhost.log www.xy.com; }
实体类放在session中需要实现序列号接口 Serializable
req.getSession().setAttribute("username", "zyc"); System.out.println("username:"+"zyc"); User u = new User("张三",10); System.out.println(u); req.getSession().setAttribute("u", u);
中间遇到的报错
1)jedis 版本不合适
Caused by: java.lang.VerifyError: Bad type on operand stack in method
2)缺少commons-pool-1.6.jar文件
java.lang.ClassNotFoundException: org.apache.commons.pool.impl.GenericObjectPool$Config
0 0
- tomcat-redis-session-manager实现tomcat session共享
- 使用tomcat-redis-session-manager实现session共享
- 基于nginx tomcat-redis-session-manager实现session共享
- memcached-session-manager 实现 tomcat session共享
- tomcat+redis实现session共享
- tomcat + redis 实现session共享
- Tomcat-Session共享实现-Redis
- 使用Tomcat-redis-session-manager来实现Tomcat集群部署中的Session共享
- tomcat redis session 共享
- tomcat-redis-session共享
- tomcat-redis-session-manager 介绍
- VIRGO TOMCAT SERVER +REDIS SESSION 共享 实现
- nginx+tomcat+redis实现session共享
- 利用redis实现tomcat session共享
- Redis+Nginx+Tomcat实现Session共享
- 利用tomcat redis 实现session共享
- tomcat redis nginx 实现session共享
- Nginx+Tomcat+Redis实现session共享
- 96.求方阵对角线上元素之和
- 【LeetCode】017.Letter Combinations of a Phone Number
- role="presentation"啥意思
- block多层嵌套使用时,造成控制器对象不能释放
- leetcode#229 Majority Element II
- tomcat-redis-session-manager实现tomcat session共享
- RCNN的安装与简单使用
- setuid,setgid,sticky
- 南邮算法分析与设计实验4 密码算法
- WPF 的选择框样式
- openfire-spark 二次开发-(三)源码系统总览-2
- 数据结构习题之树
- 给图标设置标号
- 凯勒茨基:不起眼的希腊真以为自己能毁掉整个金融世界?