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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- cookie、session、web storageCookieSessionWeb
- 關於Cookie、session和Web StorageCookieSessionWeb
- Replication (Part 2): Transactions, Consistency and Consensus
- Oracle 19c Concepts(09):Data Concurrency and ConsistencyOracle
- Sum Problem
- Mathematical Problem
- 如何在多臺 Web 伺服器上共享 sessionWeb伺服器Session
- Tomcat通過自帶的Cluster方式實現Session會話共享環境操作記錄TomcatSession會話
- Prime Ring Problem
- 2019 MCM Problem A
- Yet Another Problem
- Nanami and the Constructive ProblemNaNStruct
- 探討Web開發中的Session儲存與管理WebSession
- Web技術:Token與Session究竟是什麼呢WebSession
- Java Web中requset,session,application 的作用域及區別JavaWebSessionAPP
- UVA 11020 Efficient Solutions+multiset的應用
- Erlang Solutions:2022年金融科技報告
- ASP.NET Core Web Api之JWT VS Session VS Cookie(二)ASP.NETWebAPIJWTSessionCookie
- redis.cluster/memcached.cluster/wmware esxiRedis
- Viavi Solutions:5G部署狀況報告
- Fixed "There was a problem with the editor 'vi'"
- Prime Ring Problem (dfs)
- HDU - 6182 A Math Problem
- Problem A. Ascending Rating
- E. Not a Nim Problem
- Nanami and the House Protecting ProblemNaN
- cluster meet
- MySQL ClusterMySql
- ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECTError
- Web 開發必須掌握的三個技術:Token、Cookie、SessionWebCookieSession
- AWS Certified DevOps Engineer Professional vs AWS Certified Solutions Architect Professionaldev
- P1865 A % B Problem
- A + B Problem II hd 1002
- Follow/Unfollow problem in system design
- Euclid Problem - PC110703
- HDU 1002 A + B Problem II
- HDU 1792 A New Change Problem
- Joe Harris is a real problem with this team