转载地址: http://blog.touchhappy.com/technology/sticky-session/
Sticky sessions work with the load balancer to improve efficiency of
Persistent Sessions in a clustered configuration.
In a clustered configuration, the
load balancer sends requests to multiple backend Resin servers. Each session has an owning Resin server and a backup Resin server. The load balancer will send a session’s request to the owning server or to the backup if the owning server is not available.
The association of a session with a backend server is called “sticky sessions”.
Because the load balancing occurs before any interpretation of the
Virtual Host or
Web Application, it’s a <server> configuration variable, with the <session-cookie> directive.
Sticky Session encoding
Sticky sessions encodes the session cookie with the owning server. The encoding using a simple prefix value. ‘a’ refers to the first server in the cluster, ‘b’ refers to the second server, …, ‘z’ refers to the 26th server.
So the session cookie JSESSIONID=cnn8x02mPph_4sOKlbn would go to the third server, 192.168.0.12 in the following configuration
<cluster>
<srun id="a" host="192.168.0.10" port="6802"/>
<srun id="b" host="192.168.0.11" port="6803"/>
<srun id="c" host="192.168.0.12" port="6803"/>
</cluster>
Note that this encoding works with;jsessionid= as well, so a request to /test.jsp;jsesssionid=cnn8x02mPph_4sOKlbn would go to the third server.
分享到:
相关推荐
NestJS会话 NestJS的惯用会话模块。 建立在之上 :smiling_face_with_sunglasses: ...import { NestSessionOptions , SessionModule } from 'nestjs-session' ; import { ViewsController } from './views.cont
当服务端水平扩展的时候,就不用处理session复制(session replication)/ session黏连(sticky session)或是引入外部session存储了。 适用于多客户端(特别是移动端)的前后端解决方案 移动端使用的往往不是...
tomcat-redis-session-manager-tomcat-7 Redis-backed non-sticky session store for Apache Tomcat
项目说明 一个分布式Java Web Session。基于filter机制。 优点 支持多种序列化方式,默认使用Java...推荐淘宝的tengine 的session sticky模块: 或者这个项目: 因为后端的Session共享存储并不能锁住sessionId对应的ke
包括nginx-1.10.3.tar.gz、nginx-sticky-module-1.1.tar.gz、zlib-1.2.8.tar.gz、openssl-1.0.1c.tar.gz、pcre-8.21.tar.gz以及按照过程可能的错误解决发法
最新的[可选]集群Express,带有Socket.IO和[可选] MongoDB Sticky-Session 这是什么? 如果您仅能够生成一个进程,并且希望拥有一个具有static content serving的express应用程序,并且同时生成X个使用node并可以...
boot 会话集群示例对于 DynamoDB限制粘性会话前提最多每 60 秒写入一次 DynamoDB,而不是实时使用apache的mod_proxy_balancer时,由于无法指定jvmRoute,所以需要使用mod_headers的sticky session方法。启动方式启动...
本文档主要是记录了自己在进行负载均衡及SESSION同步的测试。利用nginx的反向代理做负载均衡,利用sql server数据库做session共享。达到网站集群在负载均衡时,session可以同步。
Non-Sticky模式:tomcat session 为 中转session, memcached1 为主 sessionmemcached 2 为备session。Request请求到来时,从memcached 2加载备 session 到 tomcat,(当 容器 中还是没有session 则从memcached1...
名称 nginx_mod_cluster_module-基于原始mod_cluster,将功能mod_cluster实现为nginx。 可用于在nginx上动态配置路由/路径。 髋关节置换剂。...- Sticky session based on URL param 工作功能: -
nginx+iis+redis搭建的站点来解决session一致性的解决方案.docx
有關Cisco Session Sticky的設定
1、请求精确定位:session sticky,例如基于访问ip的hash策略,即当前用户的请求都集中定位到一台服务器中,这样单台服务器保存了用户的session登录信息,如果宕机,则等同于单点部署,会丢失,会话不复制。
tomcat用redis共享session需要的jar
分布式web server集群部署后需要实现session共享,针对 tomcat 服务器的实现方案多种多样,比如 tomcat cluster session 广播、nginx IP hash策略、nginx sticky module等方案,本文主要介绍了使用 redis 服务器进行...
sticky="false" lockingMode="auto" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" sessionBackupTimeout="1000" transcoderFactoryClass="de.javakaffee.web.msm....
NULL 博文链接:https://acooly.iteye.com/blog/1377732
memcached session manager 1.9.6 适用于 tomcat 8 各版本 memcached session manager原作者是采用maven管理和编译项目,编译起来很麻烦 不同jar版本很容易造成出错,我因为项目需要,所以把他们编译好 . 顺便分享给...
Memchached+Tomcat6|7session共享 kryo序列化所需要包 (已经更新至1.8.2版本) 1.将所有的包拷贝至tomcat目录下的lib下面; 2.修改conf/context.xml加下面的代码: memcachedNodes="n1:127.0.0.1:11211" ...
(1) session sticky(贴) 基于hash 和cookie 来实现会话保持,简单的负载均衡算法 基于source_ip(源地址hash) nginx: ip_hash 、 haproxy: source 、 lvs: sh (2) session cluster:delta session manager ...