[go: up one dir, main page]

CN106549875B - A session management method, device and load balancer - Google Patents

A session management method, device and load balancer Download PDF

Info

Publication number
CN106549875B
CN106549875B CN201510599682.7A CN201510599682A CN106549875B CN 106549875 B CN106549875 B CN 106549875B CN 201510599682 A CN201510599682 A CN 201510599682A CN 106549875 B CN106549875 B CN 106549875B
Authority
CN
China
Prior art keywords
website server
information
session
load balancing
routing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510599682.7A
Other languages
Chinese (zh)
Other versions
CN106549875A (en
Inventor
钟储建
于祥兵
郭岳
张式勤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Group Zhejiang Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Group Zhejiang Co Ltd
Priority to CN201510599682.7A priority Critical patent/CN106549875B/en
Publication of CN106549875A publication Critical patent/CN106549875A/en
Application granted granted Critical
Publication of CN106549875B publication Critical patent/CN106549875B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供了一种会话管理方法、装置及负载均衡器,会话管理方法,包括:接收用户请求信息;根据用户请求信息在会话路由表中检索对应的第一网站服务器地址;在未检索到第一网站服务器地址时,根据负载均衡策略获取一第二网站服务器地址,并根据第二网站服务器地址将用户请求信息路由至对应的第二网站服务器,将对应的第一路由信息记录到会话路由表中,将对应的第一路由信息发送至负载均衡集群中的其他负载均衡器进行同步更新。本发明提供的方案实现了用户的会话请求和会话保持功能;同时,保证了同一用户再次使用时,其请求能够准确无误的转发到具有其会话信息的网站服务器上,为用户提供了更好的交互使用体验。

The present invention provides a session management method, device, and load balancer. The session management method includes: receiving user request information; retrieving the corresponding first website server address in the session routing table according to the user request information; In the case of a website server address, obtain a second website server address according to the load balancing strategy, and route the user request information to the corresponding second website server according to the second website server address, and record the corresponding first routing information in the session routing table , the corresponding first routing information is sent to other load balancers in the load balancing cluster for synchronous update. The scheme provided by the present invention realizes the user's session request and session maintenance function; at the same time, it ensures that when the same user uses it again, its request can be accurately forwarded to the website server with its session information, providing users with better Interactive experience.

Description

一种会话管理方法、装置及负载均衡器A session management method, device and load balancer

技术领域technical field

本发明涉及移动通信技术领域,特别是指一种会话管理方法、装置及负载均衡器。The invention relates to the technical field of mobile communication, in particular to a session management method, device and load balancer.

背景技术Background technique

负载均衡器(LoadBalance)作为目前主流系统架构中不可缺少的一种集群网络负载均衡设备已经部署到公司各大信息系统之中,成为信息系统中重要的一环。当负载均衡器出现异常不可用时,系统将无法接收处理用户的请求,导致该系统无法正常访问。如何保证负载均衡器的高可用成为系统架构设计时所必须考虑的重要问题。Load Balancer (LoadBalance), as an indispensable cluster network load balancing device in the current mainstream system architecture, has been deployed in the company's major information systems and has become an important part of the information system. When the load balancer is abnormally unavailable, the system will not be able to receive and process user requests, resulting in the failure of normal access to the system. How to ensure the high availability of the load balancer has become an important issue that must be considered when designing the system architecture.

其中,负载均衡器也常被称为"四到七层交换机",分别对四层网络交换协议和七层网络交换协议支持,协议各层的功能如图1所示,下面对四层和七层负载均衡进行具体介绍:Among them, the load balancer is also often referred to as "four to seven layers of switches", which respectively support four layers of network switching protocols and seven layers of network switching protocols. The functions of each layer of the protocol are shown in Figure 1. The seven-layer load balancing is introduced in detail:

四层负载均衡:也就是主要通过报文中的目标地址和端口,再加上负载均衡设备设置的网站WEB服务器选择策略,决定最终选择的WEB服务器。Four-layer load balancing: that is, the final selected WEB server is determined mainly through the destination address and port in the message, plus the website WEB server selection strategy set by the load balancing device.

如图2所示,以常见的三次握手TCP为例,负载均衡设备在接收到第一个来自客户端的握手信号SYN请求时,即通过上述方式选择一个最佳的WEB服务器,并对报文中目标IP地址进行修改(改为后端WEB服务器IP),直接转发给该WEB服务器。TCP的连接建立,即三次握手是客户端和WEB服务器直接建立的,负载均衡设备只是起到一个类似路由器的转发动作。在某些部署情况下,为保证WEB服务器回包可以正确返回给负载均衡设备,在转发报文的同时可能还会对报文原来的源地址进行修改。As shown in Figure 2, taking the common three-way handshake TCP as an example, when the load balancing device receives the first handshake signal SYN request from the client, it selects an optimal web server through the above method, and The target IP address is modified (changed to the back-end WEB server IP) and forwarded directly to the WEB server. The establishment of a TCP connection, that is, the three-way handshake is directly established between the client and the WEB server, and the load balancing device only performs a forwarding action similar to a router. In some deployment situations, in order to ensure that the return packet from the web server can be correctly returned to the load balancing device, the original source address of the packet may be modified while forwarding the packet.

七层负载均衡:也称为“内容交换”,也就是主要通过报文中的真正有意义的应用层内容,再加上负载均衡设备设置的WEB服务器选择策略,决定最终选择的WEB服务器。Seven-layer load balancing: also known as "content switching", that is, mainly through the really meaningful application layer content in the message, plus the WEB server selection strategy set by the load balancing device, the final selected WEB server is determined.

如图3所示,以常见的TCP为例,负载均衡设备如果要根据真正的应用层内容再选择WEB服务器,只能先代理最终的WEB服务器和客户端建立连接(三次握手)后,才可能接受到客户端发送的真正应用层内容的报文,然后再根据该报文中的特定字段,再加上负载均衡设备设置的WEB服务器选择策略,决定最终选择的WEB服务器。负载均衡设备在这种情况下,更类似于一个代理服务器。负载均衡和前端的客户端以及后端的WEB服务器会分别建立TCP连接。As shown in Figure 3, taking the common TCP as an example, if the load balancing device wants to select a WEB server based on the real application layer content, it can only be possible after establishing a connection between the final WEB server and the client (three-way handshake). After receiving the message of the real application layer content sent by the client, and then according to the specific fields in the message and the WEB server selection policy set by the load balancing device, the final selected WEB server is determined. A load balancing device is more like a proxy server in this case. The load balancer and the front-end client and the back-end WEB server will establish TCP connections respectively.

为保证负载均衡器的高可用,现有技术中出现了一种采用主备(HA)方式部署的负载均衡架构。该架构采用支持七层网络交换协议的负载均衡设备,一台主负载均衡设备对外提供服务,另一台备负载均衡设备处于待机状态,不对外提供服务,如图4所示。这样,当主负载均衡设备出现故障时可通过手动或自动方式切换到备负载均衡设备上,继续对外提供服务。In order to ensure high availability of the load balancer, a load balancing architecture deployed in an active-standby (HA) mode appears in the prior art. This architecture adopts load balancing devices that support the seven-layer network switching protocol. One primary load balancing device provides external services, and the other standby load balancing device is in a standby state and does not provide external services, as shown in Figure 4. In this way, when the primary load balancing device fails, it can be manually or automatically switched to the standby load balancing device to continue to provide external services.

而随着公司信息系统集中化建设,大量用户请求并发访问信息系统,为扩大系统吞吐量,主流架构采用前端负载均衡设备,后端WEB服务器集群的模式,而作为核心负责请求分发的负载均衡设备大都采用主备方式部署,长期都是单点工作(只有一台负载均衡设备对外提供服务),没有集群模式的支持,并发访问压力较大,高可用能力很差,易影响信息系统的正常访问,出现运行速度慢和崩溃的情况;另外在主设备发生故障切换到备机上时,切换过程中会出现短暂信息系统无法访问,且会导致用户会话信息丢失,用户体验很差。With the centralized construction of the company's information system, a large number of users request concurrent access to the information system. In order to expand the system throughput, the mainstream architecture adopts the model of front-end load balancing equipment and back-end WEB server cluster, and as the core load balancing equipment responsible for request distribution Most of them are deployed in active/standby mode, and they work at a single point for a long time (only one load balancing device provides external services), without the support of cluster mode, the pressure of concurrent access is high, and the high availability capability is poor, which easily affects the normal access of information systems , running slowly and crashing; in addition, when the primary device fails over to the standby device, the information system will be temporarily inaccessible during the switchover process, and user session information will be lost, resulting in poor user experience.

另一方面,随着LVS(Linux Virtual Server,Linux虚拟服务器,是一个虚拟的服务器集群系统)技术的发展和成熟,随之出现了基于LVS技术构建的支持四层网络交换协议的负载均衡集群架构,该架构可根据其负载均衡策略将负载分配到集群内各负载均衡设备上,同时根据业务的需求,动态调整负载均衡集群的成员数量,具有良好的可扩展和高可用特性。On the other hand, with the development and maturity of LVS (Linux Virtual Server, a virtual server cluster system) technology, a load-balancing cluster architecture based on LVS technology and supporting four-layer network switching protocols has emerged. , the architecture can distribute the load to each load balancing device in the cluster according to its load balancing strategy, and dynamically adjust the number of members of the load balancing cluster according to the needs of the business, which has good scalability and high availability characteristics.

但是,LVS负载均衡集群架构因为仅支持四层网络协议,无法对用户请求数据进行分析处理,使得该负载均衡架构无法保证该用户的每次请求都转发到保存有该用户会话信息的WEB服务器实例上,造成用户会话信息丢失,无法保证请求的正常处理,所以在实际生产系统中没有大量使用。However, because the LVS load balancing cluster architecture only supports four-layer network protocols, it cannot analyze and process user request data, so that the load balancing architecture cannot guarantee that each request of the user is forwarded to the WEB server instance that stores the user session information In practice, the user session information is lost, and the normal processing of the request cannot be guaranteed, so it is not widely used in the actual production system.

发明内容Contents of the invention

本发明的目的在于提供一种会话管理方法、装置及负载均衡器,解决现有技术中负载均衡方式易造成用户会话信息丢失,影响用户体验的问题。The purpose of the present invention is to provide a session management method, device and load balancer, which solves the problem in the prior art that the load balancing method easily causes loss of user session information and affects user experience.

为了解决上述技术问题,本发明实施例提供一种会话管理方法,应用于负载均衡集群中的任一负载均衡器,包括:In order to solve the above technical problems, an embodiment of the present invention provides a session management method, which is applied to any load balancer in the load balancing cluster, including:

接收用户请求信息;Receive user request information;

根据用户请求信息在会话路由表中检索对应的第一网站服务器地址;Retrieving the corresponding first website server address in the session routing table according to the user request information;

在未检索到所述第一网站服务器地址时,根据负载均衡策略获取一第二网站服务器地址,并根据所述第二网站服务器地址将所述用户请求信息路由至对应的第二网站服务器,将对应的第一路由信息记录到所述会话路由表中,将所述对应的第一路由信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。When the first website server address is not retrieved, obtain a second website server address according to the load balancing strategy, and route the user request information to the corresponding second website server according to the second website server address, and The corresponding first routing information is recorded in the session routing table, and the corresponding first routing information is sent to other load balancers in the load balancing cluster for synchronous update.

可选地,所述会话管理方法还包括:Optionally, the session management method also includes:

在检测到所述第一网站服务器地址时,根据所述第一网站服务器地址将所述用户请求信息路由至对应的第一网站服务器。When the first website server address is detected, the user request information is routed to a corresponding first website server according to the first website server address.

可选地,所述接收用户请求信息的步骤具体为:Optionally, the step of receiving user request information specifically includes:

接收网管根据开放最短路径优先OSPF网络协议路由的用户请求信息。Receive user request information routed by the network management system according to the open shortest path first OSPF network protocol.

可选地,所述会话管理方法还包括:Optionally, the session management method also includes:

定时检查与所述负载均衡集群对应的网站服务器集群中的网站服务器是否可用;Regularly check whether the web server in the web server cluster corresponding to the load balancing cluster is available;

在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息,并将更换信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。When it is unavailable, replace the second routing information corresponding to the unavailable website server with the third routing information corresponding to the standby website server in the session routing table, and send the replacement information to the load The other load balancers in the balancing cluster are updated synchronously.

可选地,所述在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息的步骤包括:Optionally, when it is unavailable, the step of replacing the second routing information corresponding to the unavailable website server with the third routing information corresponding to the standby website server in the session routing table includes:

在不可用时,产生异常报告信息;When unavailable, generate exception report information;

根据所述异常报告信息在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息。The unavailable second routing information corresponding to the website server is replaced in the session routing table with third routing information corresponding to the backup website server according to the abnormality report information.

可选地,所述会话管理方法还包括:Optionally, the session management method also includes:

在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新。When receiving fourth routing information or update information sent by other load balancers in the load balancing cluster, the local session routing table is synchronously updated.

可选地,所述在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新的步骤包括:Optionally, when receiving fourth routing information or update information sent by other load balancers in the load balancing cluster, the step of synchronously updating the local session routing table includes:

在接收所述负载均衡集群中的其他负载均衡器发送的第四路由信息时,将所述第四路由信息新增至本地的所述会话路由表中;When receiving fourth routing information sent by other load balancers in the load balancing cluster, adding the fourth routing information to the local session routing table;

在接收所述负载均衡集群中的其他负载均衡器发送的更新信息时,根据所述更新信息查找本地的所述会话路由表中对应的不可用网站服务器的第五路由信息,并将所述第五路由信息修改为所述更新信息中与所述不可用网站服务器相对应的备用网站服务器的第六路由信息。When receiving the update information sent by other load balancers in the load balancing cluster, look up the fifth routing information of the corresponding unavailable website server in the local session routing table according to the update information, and transfer the fifth routing information of the corresponding unavailable website server. The fifth routing information is modified to the sixth routing information of the standby website server corresponding to the unavailable website server in the update information.

本发明还提供了一种会话管理装置,应用于负载均衡集群中的任一负载均衡器,包括:The present invention also provides a session management device, which is applied to any load balancer in the load balancing cluster, including:

接收模块,用于接收用户请求信息;A receiving module, configured to receive user request information;

检索模块,用于根据用户请求信息在会话路由表中检索对应的第一网站服务器地址;A retrieval module, configured to retrieve the corresponding first website server address in the session routing table according to the user request information;

第一处理模块,用于在未检索到所述第一网站服务器地址时,根据负载均衡策略获取一第二网站服务器地址,并根据所述第二网站服务器地址将所述用户请求信息路由至对应的第二网站服务器,将对应的第一路由信息记录到所述会话路由表中,将所述对应的第一路由信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。The first processing module is configured to obtain a second website server address according to a load balancing strategy when the first website server address is not retrieved, and route the user request information to a corresponding one according to the second website server address The second website server records the corresponding first routing information in the session routing table, and sends the corresponding first routing information to other load balancers in the load balancing cluster for synchronous update.

可选地,所述会话管理装置还包括:Optionally, the session management device further includes:

路由模块,用于在检测到所述第一网站服务器地址时,根据所述第一网站服务器地址将所述用户请求信息路由至对应的第一网站服务器。A routing module, configured to route the user request information to a corresponding first website server according to the first website server address when the address of the first website server is detected.

可选地,所述接收模块具体用于:Optionally, the receiving module is specifically used for:

接收网管根据开放最短路径优先OSPF网络协议路由的用户请求信息。Receive user request information routed by the network management system according to the open shortest path first OSPF network protocol.

可选地,所述会话管理装置还包括:Optionally, the session management device further includes:

定时检查模块,用于定时检查与所述负载均衡集群对应的网站服务器集群中的网站服务器是否可用;A timing checking module, configured to regularly check whether the web server in the web server cluster corresponding to the load balancing cluster is available;

第二处理模块,用于在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息,并将更换信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。The second processing module is configured to replace the second routing information corresponding to the unavailable website server in the session routing table with the third routing information corresponding to the backup website server when it is unavailable, and The replacement information is sent to other load balancers in the load balancing cluster for synchronous update.

可选地,所述第二处理模块包括:Optionally, the second processing module includes:

产生子模块,用于在不可用时,产生异常报告信息;Generate submodules for generating exception report information when unavailable;

更换子模块,用于根据所述异常报告信息在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息。The replacement submodule is configured to replace the unavailable second routing information corresponding to the website server with third routing information corresponding to the backup website server in the session routing table according to the abnormality report information.

可选地,所述会话管理装置还包括:Optionally, the session management device further includes:

同步更新模块,用于在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新。A synchronous update module, configured to synchronously update the local session routing table when receiving fourth routing information or update information sent by other load balancers in the load balancing cluster.

可选地,所述在同步更新模块包括:Optionally, the synchronous update module includes:

新增子模块,用于在接收所述负载均衡集群中的其他负载均衡器发送的第四路由信息时,将所述第四路由信息新增至本地的所述会话路由表中;Adding a submodule, configured to add the fourth routing information to the local session routing table when receiving the fourth routing information sent by other load balancers in the load balancing cluster;

第一处理子模块,用于在接收所述负载均衡集群中的其他负载均衡器发送的更新信息时,根据所述更新信息查找本地的所述会话路由表中对应的不可用网站服务器的第五路由信息,并将所述第五路由信息修改为所述更新信息中与所述不可用网站服务器相对应的备用网站服务器的第六路由信息。The first processing sub-module is configured to, when receiving update information sent by other load balancers in the load balancing cluster, search for the fifth corresponding unavailable website server in the local session routing table according to the update information. Routing information, and modifying the fifth routing information to the sixth routing information of the standby website server corresponding to the unavailable website server in the update information.

本发明还提供了一种负载均衡器,应用于负载均衡集群中,包括:上述的会话管理装置。The present invention also provides a load balancer, which is applied in a load balancing cluster, including: the above-mentioned session management device.

本发明的上述技术方案的有益效果如下:The beneficial effects of above-mentioned technical scheme of the present invention are as follows:

上述方案中,所述会话管理方法通过接收用户请求,检索对应的第一网站服务器地址,在未检索到时,根据负载均衡策略获取一第二网站服务器地址进行转发,并在本地的会话路由表中进行相关路由信息的记录,实现了用户的会话请求和会话保持功能;同时,将新记录的相关路由信息发送至同一负载均衡集群中的其他负载均衡器进行同步更新,保证了同一用户再次使用时,其请求能够准确无误的转发到具有其会话信息的网站服务器上,并且支持负载均衡集群的线性扩展,实现负载均衡设备高可用,保证系统的平滑扩展能力,为用户提供更好的交互使用体验。In the above solution, the session management method retrieves the corresponding first website server address by receiving the user request, and if it is not retrieved, obtains a second website server address according to the load balancing strategy for forwarding, and registers the address in the local session routing table The relevant routing information is recorded in , which realizes the user's session request and session maintenance function; at the same time, the newly recorded relevant routing information is sent to other load balancers in the same load balancing cluster for synchronous update, ensuring that the same user can use the , its request can be accurately forwarded to the website server with its session information, and it supports the linear expansion of the load balancing cluster to achieve high availability of the load balancing device, ensure the smooth expansion of the system, and provide users with better interactive use experience.

附图说明Description of drawings

图1为现有技术的各协议层功能示意图;FIG. 1 is a functional schematic diagram of each protocol layer in the prior art;

图2为现有技术的四层负载均衡流程示意图;FIG. 2 is a schematic diagram of a four-layer load balancing process in the prior art;

图3为现有技术的七层负载均衡流程示意图;FIG. 3 is a schematic diagram of a seven-layer load balancing process in the prior art;

图4为现有技术的主备形式负载均衡架构示意图;FIG. 4 is a schematic diagram of an active/standby load balancing architecture in the prior art;

图5为本发明实施例一的会话管理方法流程示意图;FIG. 5 is a schematic flowchart of a session management method according to Embodiment 1 of the present invention;

图6为本发明实施例二的负载均衡系统架构示意图;FIG. 6 is a schematic diagram of a load balancing system architecture according to Embodiment 2 of the present invention;

图7为本发明实施例二的会话管理装置结构示意图;FIG. 7 is a schematic structural diagram of a session management device according to Embodiment 2 of the present invention;

图8为本发明实施例二的负载均衡系统流程示意图;FIG. 8 is a schematic flow diagram of a load balancing system according to Embodiment 2 of the present invention;

图9为本发明实施例二的会话路由信息同步更新示意图;FIG. 9 is a schematic diagram of synchronous update of session routing information according to Embodiment 2 of the present invention;

图10为本发明实施例三的会话管理装置结构示意图。FIG. 10 is a schematic structural diagram of a session management device according to Embodiment 3 of the present invention.

具体实施方式Detailed ways

为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.

本发明针对现有的技术中负载均衡方式易造成用户会话信息丢失,影响用户体验的问题,提供了多种解决方案,具体如下:The present invention provides a variety of solutions for the problem that the load balancing method in the existing technology is likely to cause the loss of user session information and affect the user experience, specifically as follows:

实施例一Embodiment one

如图5所示,本发明实施例一提供的会话管理方法,可应用于负载均衡集群中的任一负载均衡器,所述会话管理方法包括:As shown in Figure 5, the session management method provided by Embodiment 1 of the present invention can be applied to any load balancer in the load balancing cluster, and the session management method includes:

步骤51:接收用户请求信息;Step 51: Receive user request information;

步骤52:根据用户请求信息在会话路由表中检索对应的第一网站服务器地址;Step 52: Retrieve the corresponding first website server address in the session routing table according to the user request information;

步骤53:在未检索到所述第一网站服务器地址时,根据负载均衡策略获取一第二网站服务器地址,并根据所述第二网站服务器地址将所述用户请求信息路由至对应的第二网站服务器,将对应的第一路由信息记录到所述会话路由表中,将所述对应的第一路由信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。Step 53: When the first website server address is not retrieved, obtain a second website server address according to the load balancing strategy, and route the user request information to the corresponding second website according to the second website server address The server records the corresponding first routing information into the session routing table, and sends the corresponding first routing information to other load balancers in the load balancing cluster for synchronous update.

其中,用户请求信息可为任意用户需要访问内容的请求,负载均衡策略可为轮询策略或最小连接策略等其他任意能够达到技术目的的策略,在此不做限定。Wherein, the user request information may be any user's request to access content, and the load balancing strategy may be any other strategy that can achieve technical goals, such as round robin strategy or minimum connection strategy, which is not limited here.

本发明实施例一提供的所述会话管理方法通过接收用户请求,检索对应的第一网站服务器地址,在未检索到时,根据负载均衡策略获取一第二网站服务器地址进行转发,并在本地的会话路由表中进行相关路由信息的记录,实现了用户的会话请求和会话保持功能;同时,将新记录的相关路由信息发送至同一负载均衡集群中的其他负载均衡器进行同步更新,保证了同一用户再次使用时,其请求能够准确无误的转发到具有其会话信息的网站服务器上,并且支持负载均衡集群的线性扩展,实现负载均衡设备高可用,保证系统的平滑扩展能力,为用户提供更好的交互使用体验。The session management method provided by Embodiment 1 of the present invention retrieves the corresponding first website server address by receiving a user request, and if it is not retrieved, obtains a second website server address according to the load balancing strategy for forwarding, and the local The relevant routing information is recorded in the session routing table, which realizes the user's session request and session maintenance function; at the same time, the newly recorded relevant routing information is sent to other load balancers in the same load balancing cluster for synchronous update, ensuring the same When the user uses it again, its request can be accurately forwarded to the website server with its session information, and supports the linear expansion of the load balancing cluster to achieve high availability of the load balancing device, ensure the smooth expansion of the system, and provide users with better interactive experience.

对应的,所述会话管理方法还包括:在检测到所述第一网站服务器地址时,根据所述第一网站服务器地址将所述用户请求信息路由至对应的第一网站服务器。Correspondingly, the session management method further includes: when detecting the address of the first website server, routing the user request information to the corresponding first website server according to the address of the first website server.

为了使得用户的使用感受更佳,在所述根据用户请求信息在会话路由表中检索对应的第一网站服务器地址之前,所述会话管理方法还包括:根据预设规则对所述用户请求信息进行预处理。In order to make the user experience better, before retrieving the corresponding first website server address in the session routing table according to the user request information, the session management method further includes: performing the user request information according to preset rules preprocessing.

具体的,所述根据预设规则对所述用户请求信息进行预处理的步骤包括:根据所述用户请求信息中客户端的源地址IP进行接收和屏蔽处理;或,根据所述用户请求信息中的请求内容进行接收和屏蔽处理;或,在所述用户请求信息中的请求类型为预定类型时,将所述用户请求信息直接转发至对应的预定网站服务器接口进行预定操作处理。Specifically, the step of preprocessing the user request information according to preset rules includes: receiving and shielding processing according to the source address IP of the client in the user request information; or, according to the IP address of the user request information The request content is received and shielded; or, when the request type in the user request information is a predetermined type, the user request information is directly forwarded to the corresponding predetermined website server interface for predetermined operation processing.

其中,所述接收用户请求信息的步骤具体为:接收网管根据开放最短路径优先OSPF网络协议路由的用户请求信息。Wherein, the step of receiving user request information specifically includes: receiving user request information routed by the network management system according to the Open Shortest Path First (OSPF) network protocol.

进一步的,所述会话管理方法还包括:定时检查与所述负载均衡集群对应的网站服务器集群中的网站服务器是否可用;在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息,并将更换信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。Further, the session management method further includes: periodically checking whether the website server in the website server cluster corresponding to the load balancing cluster is available; The second routing information corresponding to the server is replaced with the third routing information of the standby website server corresponding thereto, and the replacement information is sent to other load balancers in the load balancing cluster for synchronous update.

具体的,所述在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息的步骤包括:在不可用时,产生异常报告信息;根据所述异常报告信息在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息。Specifically, when it is unavailable, the step of replacing the second routing information corresponding to the unavailable website server with the third routing information corresponding to the standby website server in the session routing table includes: When unavailable, abnormal report information is generated; according to the abnormal report information, the second routing information corresponding to the unavailable website server is replaced with the third routing information corresponding to the standby website server in the session routing table.

对应于本负载均衡器也需同步更新的情况,所述会话管理方法还包括:在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新。Corresponding to the situation that this load balancer also needs to be updated synchronously, the session management method further includes: when receiving the fourth routing information or update information sent by other load balancers in the load balancing cluster, performing The above session routing table is updated synchronously.

具体的,所述在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新的步骤包括:在接收所述负载均衡集群中的其他负载均衡器发送的第四路由信息时,将所述第四路由信息新增至本地的所述会话路由表中;在接收所述负载均衡集群中的其他负载均衡器发送的更新信息时,根据所述更新信息查找本地的所述会话路由表中对应的不可用网站服务器的第五路由信息,并将所述第五路由信息修改为所述更新信息中与所述不可用网站服务器相对应的备用网站服务器的第六路由信息。Specifically, when receiving fourth routing information or update information sent by other load balancers in the load balancing cluster, the step of synchronously updating the local session routing table includes: receiving the load When balancing the fourth routing information sent by other load balancers in the cluster, adding the fourth routing information to the local session routing table; receiving the fourth routing information sent by other load balancers in the load balancing cluster When updating information, look up the fifth routing information of the corresponding unavailable website server in the local session routing table according to the updating information, and modify the fifth routing information to be the same as the unavailable website server in the updating information. The sixth routing information of the standby website server corresponding to the website server.

考虑到实际情况,本实施例中,所述根据负载均衡策略获取一第二网站服务器地址的步骤包括:根据轮询策略获取一第二网站服务器地址;或,根据最小连接策略获取一第二网站服务器地址。Considering the actual situation, in this embodiment, the step of obtaining a second website server address according to the load balancing strategy includes: obtaining a second website server address according to the polling strategy; or obtaining a second website server address according to the minimum connection strategy server address.

实施例二Embodiment two

下面结合图6至图9,对本发明实施例二提供的会话管理方案作详细阐述。The session management solution provided by Embodiment 2 of the present invention will be described in detail below with reference to FIG. 6 to FIG. 9 .

如图6所示,本发明实施例二的方案中整个系统的架构主要涉及基于OSPF(OpenShortest Path First,开放最短路径优先)高速网络的负载均衡集群和Session会话管理装置(SMD)。As shown in FIG. 6 , the architecture of the entire system in the solution of Embodiment 2 of the present invention mainly involves load balancing clusters and Session Management Devices (SMDs) based on OSPF (OpenShortest Path First) high-speed networks.

具体说明如下:The specific instructions are as follows:

负载均衡集群load balancing cluster

基于OSPF网络协议构建高速网络环境,实现用户请求等价路由到各负载均衡器上。Build a high-speed network environment based on the OSPF network protocol, and implement equal-cost routing of user requests to each load balancer.

OSPF协议通过将自治系统划分成不同的区域(Area)。区域是从逻辑上将路由器划分为不同的组,每个组用区域号(Area ID)来标识。区域内可以设置多个负载均衡器组成一个集群,请求在区域内实现等价路由,请求被平均分发到各个负载均衡器上,同时可以根据需要建立多个区域(集群)。The OSPF protocol divides the autonomous system into different areas (Area). Areas logically divide routers into different groups, and each group is identified by an area number (Area ID). Multiple load balancers can be set up in a region to form a cluster. Requests are routed at equal cost within the region, and requests are evenly distributed to each load balancer. At the same time, multiple regions (clusters) can be established as needed.

Session会话管理装置(SMD)Session session management device (SMD)

如图7所示,SMD共包含五个模块:请求接收接口模块、会话路由检索模块、会话路由同步模块、请求转发模块和WEB(网站)服务器检测模块,各模块之间互相协调工作,确保用户请求能够准确的转发到具有其会话信息的WEB服务器上,如图8所示:As shown in Figure 7, SMD contains five modules: request receiving interface module, session route retrieval module, session route synchronization module, request forwarding module and WEB (website) server detection module, and each module coordinates with each other to ensure that users The request can be accurately forwarded to the WEB server with its session information, as shown in Figure 8:

步骤81:用户发出请求,请求经核心路由器转发到负载均衡集群中的某个负载均衡器上;Step 81: The user sends a request, and the request is forwarded to a load balancer in the load balancing cluster through the core router;

步骤82:负载均衡器将接收到的请求转交给会话管理装置(SMD)的请求接收接口模块;Step 82: The load balancer transfers the received request to the request receiving interface module of the session management device (SMD);

步骤83:请求接收接口模块接收到请求后对请求的内容进行分析,并可根据设置的相应策略对请求进行分类处理,处理后转发给请求到会话路由检索模块。;Step 83: After the request receiving interface module receives the request, it analyzes the content of the request, and can classify and process the request according to the set corresponding strategy, and forwards the request to the session route retrieval module after processing. ;

步骤84:会话路由检索模块根据请求的会话信息检索会话路由表,并根据检索的结果进行相应处理,如果检索到相应会话信息进入步骤85,如果没有检索到进入步骤86;Step 84: The session routing retrieval module retrieves the session routing table according to the requested session information, and performs corresponding processing according to the retrieval result, if the corresponding session information is retrieved, enter step 85, if not retrieved, enter step 86;

步骤85:会话路由检索模块将请求以及检索到的路由信息发送给请求转发模块,进入步骤88;Step 85: The session routing retrieval module sends the request and the retrieved routing information to the request forwarding module, and enters step 88;

步骤86:会话路由检索模块将检索结果和请求转发给会话路由同步模块;Step 86: The session route retrieval module forwards the retrieval result and the request to the session route synchronization module;

步骤87:会话路由同步模块根据负载均衡策略为该请求分配WEB服务器,然后,步骤871:将该会话(分配的WEB服务器)的相关路由信息记录到本地的会话路由表中,并将其同步更新到负载均衡集群内其他节点的SMD上;步骤872:将分配的WEB服务器信息和请求发送给请求转发模块,进入步骤88;Step 87: The session routing synchronization module allocates a WEB server for the request according to the load balancing strategy, and then, step 871: records the relevant routing information of the session (the WEB server allocated) into the local session routing table, and updates it synchronously Go to the SMD of other nodes in the load balancing cluster; step 872: send the distributed WEB server information and request to the request forwarding module, and enter step 88;

步骤88:请求转发模块根据路由信息将请求路由到其对应的WEB服务器上;Step 88: The request forwarding module routes the request to its corresponding WEB server according to the routing information;

步骤89:WEB服务器处理接收到的请求并将处理结果返回给对应的负载均衡器;Step 89: the WEB server processes the received request and returns the processing result to the corresponding load balancer;

步骤810:负载均衡器将接收到的处理结果返回给客户端(用户);Step 810: the load balancer returns the received processing result to the client (user);

步骤811:WEB服务探测模块定时检查WEB服务器是否可用(检测服务状态);Step 811: the WEB service detection module regularly checks whether the WEB server is available (detection service status);

步骤812:如果发现WEB服务器不可用(服务异常)则将该信息交给会话路由同步模块;Step 812: if it is found that the WEB server is unavailable (abnormal service), then the information is given to the session routing synchronization module;

步骤813:会话路由同步模块会路由表中所有该WEB服务器(步骤812中服务异常的WEB服务器)的相关路由信息修改为该WEB服务器的备用WEB服务器的地址;备用WEB服务器会依靠WEB服务器的Session复制功能保存有故障WEB服务器的会话信息,这样后续请求就会将请求路由到备用WEB服务器上,保证用户请求能够正常处理。Step 813: the relevant routing information of all this WEB server (the WEB server of service abnormality in step 812) in the routing table can be revised into the address of the standby WEB server of this WEB server by the session routing synchronous module; The standby WEB server can rely on the Session of WEB server The replication function saves the session information of the failed WEB server, so that subsequent requests will be routed to the standby WEB server to ensure that user requests can be processed normally.

下面对会话管理装置(SMD)中的五个模块进行详细介绍:The five modules in the session management device (SMD) are described in detail below:

请求接收接口模块Request Receive Interface Module

负责接收来自负载均衡器的用户请求信息,并可根据设置的相应策略对请求进行分类处理:Responsible for receiving user request information from the load balancer, and classify the requests according to the corresponding policies set:

1.可根据客户端的源IP进行接收和屏蔽处理。1. Can receive and shield processing according to the source IP of the client.

2.可根据请求内容进行接收和屏蔽处理。2. Can receive and block processing according to the content of the request.

3.可将特定的请求直接转发到特定WEB服务器接口进行特定操作处理。3. Specific requests can be directly forwarded to a specific WEB server interface for specific operation processing.

会话路由检索模块Session Route Retrieval Module

根据请求的会话信息到会话路由表中进行检索,确定该请求是否是新请求,并根据检索结果转发到装置中的其他模块进行处理。Search the session routing table according to the requested session information, determine whether the request is a new request, and forward it to other modules in the device for processing according to the search result.

其中,路由表数据结构具体如下表所示:Among them, the data structure of the routing table is shown in the following table:

字段名称Field Name 字段描述field description Source_IPSource_IP 请求的客户端IP地址Requested client IP address SessionIDSessionID 请求的SessionID信息Requested SessionID information Dest_IPDest_IP WEB服务器的IP地址IP address of the web server Dest_PortDest_Port WEB服务器的端口信息Port information of the WEB server URL_PATHURL_PATH 应用访问的上下文根信息Context root information for application access

会话路由同步模块Session Routing Synchronization Module

根据会话路由检索模块和WEB服务器检测模块的请求信息维护本地路由表信息,并通过MultiCast(组播传输)或IP通信协议将该路由表信息发送给负载均衡集群内的其它负载均衡器(LB)成员,使其同步修改本地路由表信息,如图9所示。Maintain the local routing table information according to the request information of the session routing retrieval module and the WEB server detection module, and send the routing table information to other load balancers (LB) in the load balancing cluster through MultiCast (multicast transmission) or IP communication protocol members, so that they can modify the local routing table information synchronously, as shown in Figure 9.

请求转发模块request forwarding module

根据会话路由检索模块的检索结果,将请求转发到具有相应会话信息的WEB服务器上。According to the retrieval result of the session routing retrieval module, the request is forwarded to the WEB server with the corresponding session information.

1.如果会话路由检索模块检索到有该请求的会话记录,则根据路由表的记录信息转发到相应WEB服务器上。1. If the session route retrieval module retrieves the session record with the request, it forwards it to the corresponding WEB server according to the record information in the routing table.

2.如果会话路由检索模块没有检索到该请求的会话记录,则根据负载均衡器设置的负载均衡策略进行正常转发。2. If the session route retrieval module does not retrieve the session record of the request, normal forwarding is performed according to the load balancing policy set by the load balancer.

WEB服务检测模块WEB service detection module

该模块根据设定的检测周期定时去检测WEB服务器的可用情况,并根据反馈的结果维护本地路由表信息,同时调用会话路由同步模块进行负载均衡集群路由信息同步更新。The module regularly detects the availability of the WEB server according to the set detection period, maintains the local routing table information according to the feedback result, and calls the session routing synchronization module to update the load balancing cluster routing information synchronously.

基于WEB服务器集群的Session复制功能,如果本模块检测到某个WEB服务器出现故障,则将更新与该WEB服务器相关联的会话路由表数据,使其指向备节点服务器继续提供服务,保证不丢失用户会话信息。Based on the Session replication function of the WEB server cluster, if this module detects that a WEB server fails, it will update the session routing table data associated with the WEB server to point to the backup node server to continue providing services, ensuring that no users are lost session information.

由上可知,本发明实施例二提供的会话管理方案通过会话管理装置(SMD)实现了会话的路由信息在负载均衡集群内同步共享,保证用户请求能够准确无误的转发到具有其会话信息的WEB服务器上,并且支持负载均衡集群的线性扩展,实现了负载均衡设备高可用,保证了系统的平滑扩展能力。It can be seen from the above that the session management solution provided by the second embodiment of the present invention realizes the synchronous sharing of session routing information in the load balancing cluster through the session management device (SMD), ensuring that user requests can be accurately forwarded to the WEB with its session information. On the server, and supports the linear expansion of the load balancing cluster, realizes the high availability of the load balancing equipment, and ensures the smooth expansion capability of the system.

综上所述,本发明实施例二提供了一种在保证不丢失用户会话信息的情况下可支持分布式水平扩展的七层负载均衡集群架构,实现了负载均衡设备可根据生产需要进行线性扩展的目的;并且可有效管理Session会话,支持会话保持,保证会话信息不丢失;实现负载均衡设备高可用,保证信息系统稳定、高效的运行。To sum up, Embodiment 2 of the present invention provides a seven-layer load balancing cluster architecture that can support distributed horizontal expansion without losing user session information, and realizes that load balancing devices can be linearly expanded according to production needs The purpose; and it can effectively manage Session sessions, support session retention, and ensure that session information is not lost; realize high availability of load balancing equipment, and ensure stable and efficient operation of the information system.

实施例三Embodiment three

如图10所示,本发明实施例三提供的会话管理装置,可应用于负载均衡集群中的任一负载均衡器,所述会话管理装置包括:As shown in FIG. 10, the session management device provided by Embodiment 3 of the present invention can be applied to any load balancer in the load balancing cluster, and the session management device includes:

接收模块101,用于接收用户请求信息;A receiving module 101, configured to receive user request information;

检索模块102,用于根据用户请求信息在会话路由表中检索对应的第一网站服务器地址;A retrieval module 102, configured to retrieve the corresponding first website server address in the session routing table according to the user request information;

第一处理模块103,用于在未检索到所述第一网站服务器地址时,根据负载均衡策略获取一第二网站服务器地址,并根据所述第二网站服务器地址将所述用户请求信息路由至对应的第二网站服务器,将对应的第一路由信息记录到所述会话路由表中,将所述对应的第一路由信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。The first processing module 103 is configured to obtain a second website server address according to a load balancing strategy when the first website server address is not retrieved, and route the user request information to the second website server address according to the second website server address The corresponding second website server records the corresponding first routing information into the session routing table, and sends the corresponding first routing information to other load balancers in the load balancing cluster for synchronous update.

其中,用户请求信息可为任意用户需要访问内容的请求,负载均衡策略可为轮询策略或最小连接策略等其他任意能够达到技术目的的策略,在此不做限定。Wherein, the user request information may be any user's request to access content, and the load balancing strategy may be any other strategy that can achieve technical goals, such as round robin strategy or minimum connection strategy, which is not limited here.

本发明实施例三提供的所述会话管理装置通过接收用户请求,检索对应的第一网站服务器地址,在未检索到时,根据负载均衡策略获取一第二网站服务器地址进行转发,并在本地的会话路由表中进行相关路由信息的记录,实现了用户的会话请求和会话保持功能;同时,将新记录的相关路由信息发送至同一负载均衡集群中的其他负载均衡器进行同步更新,保证了同一用户再次使用时,其请求能够准确无误的转发到具有其会话信息的网站服务器上,并且支持负载均衡集群的线性扩展,实现负载均衡设备高可用,保证系统的平滑扩展能力,为用户提供更好的交互使用体验。The session management device provided in Embodiment 3 of the present invention retrieves the corresponding first website server address by receiving a user request, and if not retrieved, obtains a second website server address according to the load balancing strategy and forwards it to the local The relevant routing information is recorded in the session routing table, which realizes the user's session request and session maintenance function; at the same time, the newly recorded relevant routing information is sent to other load balancers in the same load balancing cluster for synchronous update, ensuring the same When the user uses it again, its request can be accurately forwarded to the website server with its session information, and supports the linear expansion of the load balancing cluster to achieve high availability of the load balancing device, ensure the smooth expansion of the system, and provide users with better interactive experience.

对应的,所述会话管理装置还包括:路由模块,用于在检测到所述第一网站服务器地址时,根据所述第一网站服务器地址将所述用户请求信息路由至对应的第一网站服务器。Correspondingly, the session management device further includes: a routing module, configured to route the user request information to the corresponding first website server according to the first website server address when the address of the first website server is detected .

为了使得用户的使用感受更佳,所述会话管理方法还包括:预处理模块,用于所述第一处理模块执行操作之前,根据预设规则对所述用户请求信息进行预处理。In order to improve user experience, the session management method further includes: a preprocessing module, configured to preprocess the user request information according to preset rules before the first processing module performs operations.

具体的,所述预处理模块包括:第二处理子模块,用于根据所述用户请求信息中客户端的源地址IP进行接收和屏蔽处理;或,第三处理子模块,用于根据所述用户请求信息中的请求内容进行接收和屏蔽处理;或,第四处理子模块,用于在所述用户请求信息中的请求类型为预定类型时,将所述用户请求信息直接转发至对应的预定网站服务器接口进行预定操作处理。Specifically, the preprocessing module includes: a second processing submodule for receiving and shielding processing according to the source address IP of the client in the user request information; or, a third processing submodule for processing according to the user request The request content in the request information is received and shielded; or, the fourth processing submodule is used to directly forward the user request information to the corresponding predetermined website when the request type in the user request information is a predetermined type The server interface performs predetermined operation processing.

其中,所述接收模块具体用于:接收网管根据开放最短路径优先OSPF网络协议路由的用户请求信息。Wherein, the receiving module is specifically configured to: receive user request information routed by the network management system according to the open shortest path first OSPF network protocol.

进一步的,所述会话管理装置还包括:定时检查模块,用于定时检查与所述负载均衡集群对应的网站服务器集群中的网站服务器是否可用;第二处理模块,用于在不可用时,则在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息,并将更换信息发送至所述负载均衡集群中的其他负载均衡器进行同步更新。Further, the session management device further includes: a timing checking module, configured to periodically check whether a web server in the web server cluster corresponding to the load balancing cluster is available; a second processing module, configured to: In the session routing table, the second routing information corresponding to the unavailable website server is replaced with the third routing information of the standby website server corresponding thereto, and the replacement information is sent to other loads in the load balancing cluster The equalizer is updated synchronously.

具体的,所述第二处理模块包括:产生子模块,用于在不可用时,产生异常报告信息;更换子模块,用于根据所述异常报告信息在所述会话路由表中将不可用的所述网站服务器对应的第二路由信息更换为与之对应的备用网站服务器的第三路由信息。Specifically, the second processing module includes: a generating submodule, configured to generate abnormal report information when unavailable; a replacement submodule, configured to generate all abnormal report information that will be unavailable in the session routing table according to the abnormal report information The second routing information corresponding to the website server is replaced with the third routing information corresponding to the standby website server.

对应于本负载均衡器也需同步更新的情况,所述会话管理装置还包括:同步更新模块,用于在接收到所述负载均衡集群中的其他负载均衡器发送的第四路由信息或更新信息时,对本地的所述会话路由表进行同步更新。Corresponding to the situation that the load balancer also needs to be updated synchronously, the session management device further includes: a synchronous update module, configured to receive fourth routing information or update information sent by other load balancers in the load balancing cluster , the local session routing table is synchronously updated.

具体的,所述在同步更新模块包括:新增子模块,用于在接收所述负载均衡集群中的其他负载均衡器发送的第四路由信息时,将所述第四路由信息新增至本地的所述会话路由表中;第一处理子模块,用于在接收所述负载均衡集群中的其他负载均衡器发送的更新信息时,根据所述更新信息查找本地的所述会话路由表中对应的不可用网站服务器的第五路由信息,并将所述第五路由信息修改为所述更新信息中与所述不可用网站服务器相对应的备用网站服务器的第六路由信息。Specifically, the synchronous update module includes: an adding submodule, configured to add the fourth routing information to the local when receiving the fourth routing information sent by other load balancers in the load balancing cluster In the session routing table; the first processing submodule is configured to, when receiving update information sent by other load balancers in the load balancing cluster, search the local session routing table for corresponding The fifth routing information of the unavailable website server, and modifying the fifth routing information to the sixth routing information of the standby website server corresponding to the unavailable website server in the update information.

考虑到实际情况,本实施例中,所述第一处理模块包括:第一获取子模块,用于根据轮询策略获取一第二网站服务器地址;或,第二获取子模块,用于根据最小连接策略获取一第二网站服务器地址。Considering the actual situation, in this embodiment, the first processing module includes: a first obtaining submodule, configured to obtain a second website server address according to a polling strategy; or, a second obtaining submodule, configured to obtain a second website server address according to a minimum The connection strategy acquires a second website server address.

需要说明的是,上述会话管理方法的所述实现实施例均适用于该会话管理装置的实施例中,也能达到相同的技术效果。It should be noted that, all the implementation embodiments of the above session management method are applicable to the embodiments of the session management device, and can also achieve the same technical effect.

本发明实施例三提供的会话管理装置,可用于对现有的负载均衡集群中的负载均衡器进行改进,以实现该会话管理装置在本发明实施例三中的功能。The session management device provided in the third embodiment of the present invention can be used to improve the load balancer in the existing load balancing cluster, so as to realize the function of the session management device in the third embodiment of the present invention.

以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述原理前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。What has been described above is a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, some improvements and modifications can also be made without departing from the principle of the present invention. These improvements and modifications should also be considered as Be the protection scope of the present invention.

Claims (11)

1. a kind of conversation managing method, applied to any load balancer in load balancing cluster characterized by comprising
Receive user request information;
Corresponding first Website server address is retrieved in session routing table according to user request information;
When not retrieving the first Website server address, with obtaining one second Website server according to load balancing Location, and the user request information is routed to by corresponding second Website server according to second Website server address, Corresponding first routing iinformation is recorded in the session routing table, corresponding first routing iinformation is sent to described Other load balancers in load balancing cluster synchronize update;
Whether the Website server in regular check Website server cluster corresponding with the load balancing cluster can be used;
When unavailable, then by the corresponding secondary route information of the not available Website server in the session routing table It is changed to the third routing iinformation of corresponding spare Website server, and replacement information is sent to the load balancing collection Other load balancers in group synchronize update;
It is described when unavailable, then by the corresponding secondary route of the not available Website server in the session routing table Change dump be corresponding spare Website server third routing iinformation the step of include:
When unavailable, exception reporting information is generated;
According to the exception reporting information by the not available Website server corresponding second in the session routing table Routing iinformation is changed to the third routing iinformation of corresponding spare Website server.
2. conversation managing method as described in claim 1, which is characterized in that the conversation managing method further include:
When detecting the first Website server address, the user is requested according to first Website server address Information router is to corresponding first Website server.
3. conversation managing method as described in claim 1, which is characterized in that the step of reception user request information is specific Are as follows:
Receive the user request information that network management is routed according to Open Shortest Path First ospf network agreement.
4. conversation managing method as described in claim 1, which is characterized in that the conversation managing method further include:
When receiving the 4th routing iinformation or more new information that other load balancers in the load balancing cluster are sent, Update is synchronized to the local session routing table.
5. conversation managing method as claimed in claim 4, which is characterized in that described in receiving the load balancing cluster Other load balancers send the 4th routing iinformation or more new information when, the local session routing table is synchronized The step of update includes:
When receiving four routing iinformation that other load balancers in the load balancing cluster are sent, by the 4th tunnel It is increased newly by information into the local session routing table;
When receiving the more new information that other load balancers in the load balancing cluster are sent, according to the more new information Search the 5th routing iinformation of corresponding unavailable Website server in the local session routing table, and by the 5th tunnel The 6th of spare Website server corresponding with the unavailable Website server in the more new information the is revised as by information Routing iinformation.
6. a kind of session management device, applied to any load balancer in load balancing cluster characterized by comprising
Receiving module, for receiving user request information;
Retrieval module, for retrieving corresponding first Website server address in session routing table according to user request information;
First processing module, for being obtained according to load balancing when not retrieving the first Website server address One second Website server address, and the user request information is routed to by correspondence according to second Website server address The second Website server, corresponding first routing iinformation is recorded in the session routing table, by described corresponding first Other load balancers that routing iinformation is sent in the load balancing cluster synchronize update;
Regular check module, for the website clothes in regular check Website server cluster corresponding with the load balancing cluster Whether business device can be used;
Second processing module is used for when unavailable, then by the not available Website server in the session routing table Corresponding secondary route change dump is the third routing iinformation of corresponding spare Website server, and will replacement information hair Other load balancers into the load balancing cluster are sent to synchronize update;
The Second processing module includes:
Submodule is generated, for generating exception reporting information when unavailable;
Submodule is replaced, for taking the not available website in the session routing table according to the exception reporting information The corresponding secondary route change dump of business device is the third routing iinformation of corresponding spare Website server.
7. session management device as claimed in claim 6, which is characterized in that the session management device further include:
Routing module, for when detecting the first Website server address, according to first Website server address The user request information is routed into corresponding first Website server.
8. session management device as claimed in claim 6, which is characterized in that the receiving module is specifically used for:
Receive the user request information that network management is routed according to Open Shortest Path First ospf network agreement.
9. session management device as claimed in claim 6, which is characterized in that the session management device further include:
Synchronized update module, in the 4th routing for receiving other load balancers transmission in the load balancing cluster When information or more new information, update is synchronized to the local session routing table.
10. session management device as claimed in claim 9, which is characterized in that the synchronized update module includes:
Newly-increased submodule, in the 4th routing iinformation for receiving other load balancers transmission in the load balancing cluster When, the 4th routing iinformation is increased newly into the local session routing table;
First processing submodule, in the more new information for receiving other load balancers transmission in the load balancing cluster When, according to the 5th routing of corresponding unavailable Website server in the session routing table for updating information searching local Information, and the 5th routing iinformation is revised as corresponding standby with the unavailable Website server in the more new information With the 6th routing iinformation of Website server.
11. a kind of load balancer is applied in load balancing cluster characterized by comprising such as claim 6 to 10 times Session management device described in one.
CN201510599682.7A 2015-09-18 2015-09-18 A session management method, device and load balancer Active CN106549875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510599682.7A CN106549875B (en) 2015-09-18 2015-09-18 A session management method, device and load balancer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510599682.7A CN106549875B (en) 2015-09-18 2015-09-18 A session management method, device and load balancer

Publications (2)

Publication Number Publication Date
CN106549875A CN106549875A (en) 2017-03-29
CN106549875B true CN106549875B (en) 2019-09-13

Family

ID=58362027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510599682.7A Active CN106549875B (en) 2015-09-18 2015-09-18 A session management method, device and load balancer

Country Status (1)

Country Link
CN (1) CN106549875B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222544B (en) * 2017-06-14 2020-09-18 千寻位置网络有限公司 High availability method and system based on multi-layer service architecture
CN107948087A (en) * 2017-12-07 2018-04-20 锐捷网络股份有限公司 A kind of method and apparatus of load balancing
CN111756780B (en) * 2019-03-27 2022-04-22 厦门网宿有限公司 Method for synchronizing connection information and load balancing system
CN110098999A (en) * 2019-05-09 2019-08-06 携程计算机技术(上海)有限公司 The method and system that IM is managed in the event system of the website OTA
CN112217843B (en) * 2019-07-09 2023-08-22 阿里巴巴集团控股有限公司 Service unit switching method, system and equipment
CN111193941B (en) * 2020-01-07 2021-09-17 北京东土科技股份有限公司 Method, device and equipment for transmitting media data and storage medium
CN111416852A (en) * 2020-03-16 2020-07-14 优刻得科技股份有限公司 Method for session synchronization among multiple load balancers and load balancer
CN111416851A (en) * 2020-03-16 2020-07-14 优刻得科技股份有限公司 Method for session synchronization among multiple load balancers and load balancer
CN113934532A (en) * 2020-07-13 2022-01-14 北京忆芯科技有限公司 Command distribution method based on routing mapping table and control component
CN112653620B (en) * 2020-12-21 2023-03-24 杭州迪普科技股份有限公司 Route processing method, device, equipment and computer readable storage medium
CN112671928B (en) * 2020-12-31 2023-02-07 北京天融信网络安全技术有限公司 Equipment centralized management architecture, load balancing method, electronic equipment and storage medium
CN113014503A (en) * 2021-03-08 2021-06-22 中国工商银行股份有限公司 Access data routing method, device and system
CN113489775B (en) * 2021-06-30 2023-07-21 深圳市风云实业有限公司 Seven-layer load balancing server and load balancing method based on VPP
CN114598704B (en) * 2022-03-16 2024-05-17 浪潮云信息技术股份公司 TCP connection fault tolerance method based on four-layer load balancing cluster
CN115665048B (en) * 2022-10-09 2024-09-27 浪潮云信息技术股份公司 Synchronous conntrack method, system and device based on four-layer load balancing cluster
CN118394850B (en) * 2024-06-26 2024-09-17 杭州悦数科技有限公司 Load balancing and retry method and device for distributed graph database service
CN119520585A (en) * 2024-12-04 2025-02-25 天翼云科技有限公司 Session maintenance method, device, equipment, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364930A (en) * 2008-09-24 2009-02-11 深圳市金蝶中间件有限公司 Session control method, apparatus and system
CN103607356A (en) * 2013-11-14 2014-02-26 北京奇虎科技有限公司 Load balancing method, load balancer and system thereof
CN104023082A (en) * 2014-06-23 2014-09-03 浪潮电子信息产业股份有限公司 Method for achieving cluster load balance
CN104735098A (en) * 2013-12-18 2015-06-24 青岛海尔空调器有限总公司 Session information control method and system
CN104836839A (en) * 2015-03-30 2015-08-12 南京大学 Universal user self-defining session system and session management method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364930A (en) * 2008-09-24 2009-02-11 深圳市金蝶中间件有限公司 Session control method, apparatus and system
CN103607356A (en) * 2013-11-14 2014-02-26 北京奇虎科技有限公司 Load balancing method, load balancer and system thereof
CN104735098A (en) * 2013-12-18 2015-06-24 青岛海尔空调器有限总公司 Session information control method and system
CN104023082A (en) * 2014-06-23 2014-09-03 浪潮电子信息产业股份有限公司 Method for achieving cluster load balance
CN104836839A (en) * 2015-03-30 2015-08-12 南京大学 Universal user self-defining session system and session management method thereof

Also Published As

Publication number Publication date
CN106549875A (en) 2017-03-29

Similar Documents

Publication Publication Date Title
CN106549875B (en) A session management method, device and load balancer
US9659075B2 (en) Providing high availability in an active/active appliance cluster
TWI724106B (en) Business flow control method, device and system between data centers
US8825867B2 (en) Two level packet distribution with stateless first level packet distribution to a group of servers and stateful second level packet distribution to a server within the group
CN106375231B (en) A kind of flow switching method, equipment and system
US9621642B2 (en) Methods of forwarding data packets using transient tables and related load balancers
US12200047B2 (en) Service unit switching method, system, and device for disaster tolerance switching and capacity dispatching
WO2018077238A1 (en) Switch-based load balancing system and method
CN102821044B (en) Method and device for configuring server cluster
US20140369204A1 (en) Methods of load balancing using primary and stand-by addresses and related load balancers and servers
US20140372616A1 (en) Methods of forwarding/receiving data packets using unicast and/or multicast communications and related load balancers and servers
WO2021217872A1 (en) Method and apparatus for configuring gateway node on the basis of virtual private cloud, and medium
CN107465721A (en) Whole load equalizing method and system and dispatch server based on dual-active framework
CN112929285A (en) Communication optimization system of block chain network
CN104301417B (en) A kind of load-balancing method and device
WO2016173403A1 (en) Routing device, load balancing device, and message distribution method and system
WO2022253087A1 (en) Data transmission method, node, network manager, and system
CN115086330B (en) Cross-cluster load balancing system
US20200204481A1 (en) Fast redirect of traffic when pods fail
Chan et al. Fast controller failover for multi-domain software-defined networks
CN114500340B (en) A method and system for intelligent scheduling distributed path calculation
JP2013090072A (en) Service provision system
CN117278567A (en) Cluster load balancing method and device
CN104243304B (en) The data processing method of non-full-mesh topological structure, equipment and system
US9197545B2 (en) Highly scalable modular system with high reliability and low latency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant