In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the session management of application server cluster? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
1. What is session
A. The context object used by these multiple requests for modification in web applications is called session (session).
B. The Session object stores the information needed for a specific user session. In this way, when the user jumps between the Web pages of the application, the variables stored in the Session object will not be lost, but will persist throughout the user session.
C. When a user requests a Web page from an application, the Web server automatically creates a Session object if the user does not already have a session. When a session expires or is abandoned, the server terminates the session
2. Application scenarios of session
In a highly available architecture, the business is always stateful, for example, in e-commerce trading platforms, shopping carts are needed to record users' purchase information; in social networking sites, it is necessary to record the user's current login status, latest news and friend status, which need to be updated every time the user refreshes the page.
3. Several means of session management
A) session replication
The application server enables the session replication function of the web container to synchronize session objects among several servers in the cluster, so that all users' session information is stored on each server.
In large-scale cases (session replication will appear insufficient)
B) session binding
Ession binding can be implemented using the load balancer's source address Hash algorithm. Load balancer servers always distribute requests from the same IP to the same server in the future. Obviously, session binding does not meet our requirements for high availability of the system, because once the server goes down, the session on the machine no longer exists.
Advantages: simple implementation, easy configuration, no additional network overhead
Disadvantages: when there is a machine Down in the network, the user Session will be lost, which is easy to cause a single point of failure.
C) recording session using cookie
Note: websites do not have clients and can record session using cookie supported by browsers (in fact, many websites use cookie to record session more or less)
Deficiency:
Limited by the size of cookie, the information that can be recorded is limited
Cookie is transmitted every time a response request is made, which affects performance.
If the user closes cookie, the access will not be normal
D) session server
Unified management of session using independently deployed servers (clusters)
The state of application server is separated into stateless application server and stateful session server.
For stateful session servers: distributed cache + database, etc.
When the business scenario is demanding, use session services to integrate functions such as SSO and user services, or develop a special session service management platform.
The answer to the question about the session management of the application server cluster is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 282
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.