Solutions for Session Consistency Problem in Web Cluster
How to keep a session consistent across Web cluster?
Sol 1: ip_hash based load balance
The load balancing strategy of nginx can be configured to ip_hash.
The basic idea is Hash(client_ip)%nodes.
Sol 1 is easy to configure and can be adopted in middle-scale distributed environment,
no changing the code.
Sol 2: session synchronization among all web servers
Tomcat server supports cluster through modifying the two configuration files below:
a. server.xml, just opening the <Cluster> node.
b. web.xml, adding <distributable> node.
Sol 2 is applied in small-scale distributed environment, no changing the code.
Sol 3: concentrated cache for sessions
Redis is used as the concentrated cache to store the sessions from all web servers.
Sol 3 is the first choice in large-scale distributed application because it is scalable and robust,
but changing the code.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/32498/viewspace-2641474/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- statement, session , transaction ,consistency 等概念Session
- Advance Web Solutions---Office MessengerWebMessenger
- cookie、session、web storageCookieSessionWeb
- Web--Session共享問題WebSession
- Problem_2 Majority Problem
- web開發3--cookie&sessionWebCookieSession
- 關於Cookie、session和Web StorageCookieSessionWeb
- Java Web之Cookie和Session的理解JavaWebCookieSession
- WEB開發中的cookie與sessionWebCookieSession
- Mathematical Problem
- SQL入門之12 Read ConsistencySQL
- java web 中分散式 session 的實現JavaWeb分散式Session
- FZU Problem 1692 Key problem(迴圈矩陣)矩陣
- ACM A problem is easyACM
- Database Transaction ProblemDatabase
- Yet Another Problem
- 多臺web伺服器之間共享sessionWeb伺服器Session
- Read Consistency with Real Application Clusters (314)APP
- Oracle Database High Availability Solutions for Unplanned DowntimeOracleDatabaseAI
- Fixed "There was a problem with the editor 'vi'"
- STL iterator delete problemdelete
- E. Not a Nim Problem
- 如何在多臺 Web 伺服器上共享 sessionWeb伺服器Session
- web.config中的session配置詳解WebSession
- transaction-level or statement-level consistency; check constraintsAI
- redis.cluster/memcached.cluster/wmware esxiRedis
- Web技術:Token與Session究竟是什麼呢WebSession
- 探討Web開發中的Session儲存與管理WebSession
- Java Web(三) 會話機制,Cookie和Session詳解JavaWeb會話CookieSession
- Tomcat通過自帶的Cluster方式實現Session會話共享環境操作記錄TomcatSession會話
- MySQL ClusterMySql
- Cluster for MySQLMySql
- HDU 1792 A New Change Problem
- Joe Harris is a real problem with this team
- The Door Problem 並查集並查集
- 3339: Rmq ProblemMQ
- ORB problem determinationORB
- Nanami and the Constructive ProblemNaNStruct