resin session共享实现技术
来源:互联网 发布:淘宝商品自动被下架了 编辑:程序博客网 时间:2024/05/17 23:36
一、基于数据库的session共享
1)、在mysql中创建session存储表
CREATE TABLE `persistent_session` (
`id` varchar(64) NOT NULL default '',
`data` mediumblob,
`access_time` int(11) default NULL,
`expire_interval` int(11) default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM
2)、在resin.conf中添加session配置
<resin xmlns="http://caucho.com/ns/resin">
<server>
<http id='a' port='8080'/>
<http id='b' port='8080'/>
<cluster>
<srun id='a' host='host-a' port='6802'/>
<srun id='b' host='host-b' port='6802'/>
</cluster>
<database>
<jndi-name>jdbc/session</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://localhost:3306/session</url>
<user>xxxxx</user>
<password>xxxxx</password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
<persistent-store type="jdbc"> <init>
<data-source>jdbc/session<data-source>
</init>
</persistent-store>
...
<web-app-default>
<session-config>
<use-persistent-store>true</use-persistent-store>
<always-save-session>true</always-save-session>
</session-config>
</web-app-default>
二、基于集群的session共享(优点不依赖数据库)
在resin.conf中添加配置如下
<resin xmlns="http://caucho.com/ns/resin">
<server>
<http id='a' port='8080'/>
<http id='b' port='8080'/>
<cluster>
<srun id='a' host='host-a' port='6802'/>
<srun id='b' host='host-b' port='6802'/>
</cluster>
<persistent-store type="cluster">
<init path="cluster"/>
</persistent-store>
<host id=''>
<web-app id=''>
<session-config>
<use-persistent-store="true"/>
</session-config>
</web-app>
</host>
</server>
</resin>
- resin session共享实现技术
- spring-session实现session共享
- [Session共享]Tomcat集群实现Session共享
- [Session共享]Spring-Redis实现Session共享
- Session共享实现方案
- cas实现共享session
- redis实现session共享
- Tomcat实现Session共享
- redis实现session共享
- memcache实现session共享
- 如何实现session共享
- Tomcat实现session共享
- 如何实现Session共享
- Redis实现Session共享
- 如何实现session共享
- shiro实现session共享
- redis实现session共享
- 如何实现session共享
- 领域逻辑与业务逻辑的关系
- BNUOJ 4138 Dizzy Cows
- 怎样区分T1加权像和T2加权像
- 项目log4j日志管理详解
- 程序员的囧途二三事
- resin session共享实现技术
- 电子商务平台的搭建技巧与成功案例资料集
- Apache 指定的网络名不再可用 winnt_accept: Asynchronous AcceptEx faile
- NSTimer与Run loop Modes
- poj2017
- MongoDB 基本操作尝试
- Myeclipse 8.6注册码(更新时间:2013年7月12日)
- Linux 内核-定时测量
- Android 水果机游戏实例解析