A server cluster load balancing method, device, equipment and storage medium

By introducing a reverse proxy server to the server cluster to determine the target object storage gateway server and process, and dynamically adjusting the RGW process weight, the user request back-route and single point problems are solved, and the processing efficiency and availability of the server cluster are improved.

CN114911602BActive Publication Date: 2024-11-15CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110176716.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-07
Publication Date
2024-11-15
Estimated Expiration
2041-02-07

AI Technical Summary

Technical Problem

In the prior art, when a server cluster processes a large number of user requests, user requests are prone to loop back, resulting in the inability to issue a request, which in turn makes the server cluster unable to handle the request correctly.

Method used

The load balancing server forwards user access requests to the reverse proxy server. The reverse proxy server determines the target object storage gateway server and processing process, and sends the requests to the target process to ensure that the requests are processed balancedly in the server cluster, and at the same time, dynamic modifications are made apisix routing configuration controls RGW process weights to avoid request loopback.

Benefits of technology

It solves the problem of user request back-circulation, ensures balanced request processing and high availability of the server cluster, improves data processing efficiency, avoids single point of failure, and does not need to restart the apisix service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911602B_ABST
    Figure CN114911602B_ABST
Patent Text Reader

Abstract

The present application discloses a load balancing method, device, electronic device and computer storage medium of a server cluster. The method comprises: when a load balancing server in a server cluster receives a user access request sent by different clients, the user access request is forwarded to a reverse proxy server through the load balancing server; a target object storage gateway server corresponding to the user access request is determined through the reverse proxy server; a target process for processing the user access request on the target object storage gateway server is determined through the reverse proxy server; the user access request is sent to the target object storage gateway server through the reverse proxy server; and the target object storage gateway server calls the target process to respond to the user access request. In this way, not only the loop problem of the user access request is solved, but also the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud computing, and in particular to a load balancing method for a server cluster, a load balancing device for a server cluster, an electronic device, and a storage medium. Background Art

[0002] In recent years, with the widespread application and in-depth development of big data, cloud computing and massive data storage in information systems, the number of application requests from users to access server clusters' World Wide Web (web) services through the network has increased. As the scale of server clusters gradually increases and a large number of requests fall into the server cluster web services, how to ensure that the server clusters receive and process requests evenly has become an urgent problem to be solved.

[0003] At present, Keepalived+Linux Virtual Server (LVS) / Nginx components are used in related technologies to solve the above problems. Specifically, Keepalived receives user access requests and forwards them to LVS / Nginx, which distributes the user requests to RadosGateway (RGW) nodes for processing. However, this method has the problem that user requests will loop back, resulting in the inability to issue user requests, and thus the server cluster cannot correctly process user requests. Summary of the invention

[0004] The present application provides a load balancing method for a server cluster, a load balancing device for a server cluster, an electronic device and a storage medium, which solve the problem in the related art that user requests may loop, resulting in the inability to issue user requests, and further making it impossible for the server cluster to correctly process user requests.

[0005] The technical solution of this application is implemented as follows:

[0006] The present application provides a load balancing method for a server cluster, the method comprising:

[0007] When a load balancing server in a server cluster receives a user access request sent by different clients, the load balancing server forwards the user access request to a reverse proxy server;

[0008] Determine, by means of the reverse proxy server, a target object storage gateway server corresponding to the user access request;

[0009] Determine, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request;

[0010] Sending the user access request to the target object storage gateway server through the reverse proxy server;

[0011] The target process is called by the target object storage gateway server to respond to the user access request.

[0012] In the above solution, determining the target process for processing the user access request on the target object storage gateway server through the reverse proxy server includes:

[0013] Determine, by the reverse proxy server, the request identifier carried in the user access request;

[0014] The target process corresponding to the request identifier is searched from the target object storage gateway server through the reverse proxy server.

[0015] In the above solution, searching the target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server includes:

[0016] Searching, through the reverse proxy server, from the target object storage gateway server for a first process corresponding to the request identifier;

[0017] Determining, by the reverse proxy server, that the first process is in a disconnected state;

[0018] Searching, through the reverse proxy server, from the target object storage gateway server for a second process corresponding to the request identifier; wherein the second process is different from the first process;

[0019] When the second process is in an idle state, the second process is determined to be the target process.

[0020] In the above solution, the weight of the second process is smaller than the weight of the first process.

[0021] In the above solution, after determining that the first process is in a disconnected state through the reverse proxy server, the method further includes:

[0022] The weight of the first process is set as a first parameter through the reverse proxy server; wherein the first parameter is used to indicate that the first process is in the disconnected state.

[0023] In the above solution, after setting the weight of the first process as the first parameter through the reverse proxy server, the method further includes:

[0024] Determining, by the reverse proxy server, that the first process changes from the disconnected state to the idle state;

[0025] The weight of the first process is modified from the first parameter to the second parameter through the reverse proxy server; wherein the second parameter is used to indicate that the first process is in the idle state.

[0026] In the above solution, determining the target object storage gateway server corresponding to the user access request through the reverse proxy server includes:

[0027] Determine the resource utilization rate of each object storage gateway server among all object storage gateway servers through the reverse proxy server;

[0028] An object storage gateway server whose resource utilization is less than a resource utilization threshold among all the object storage gateway servers is determined as the target object storage gateway server.

[0029] The present application provides a load balancing device for a server cluster, the device comprising:

[0030] A first sending unit, configured to forward the user access request to the reverse proxy server through the load balancing server when the load balancing server in the server cluster receives the user access request sent by different clients;

[0031] A first processing unit, configured to determine a target object storage gateway server corresponding to the user access request through the reverse proxy server;

[0032] A second processing unit, configured to determine, through the reverse proxy server, a target process on the target object storage gateway server for processing the user access request;

[0033] A second sending unit, configured to send the user access request to the target object storage gateway server through the reverse proxy server;

[0034] The third processing unit is configured to call the target process through the target object storage gateway server to respond to the user access request.

[0035] The present application provides an electronic device, which includes: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the load balancing method of the server cluster described above.

[0036] The present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the load balancing method of the server cluster described above.

[0037] The present application provides a load balancing method for a server cluster, a load balancing device for a server cluster, an electronic device and a storage medium. When a load balancing server in a server cluster receives a user access request sent by different clients, the load balancing server forwards the user access request to a reverse proxy server; the reverse proxy server determines the target object storage gateway server corresponding to the user access request; the reverse proxy server determines the target process for processing the user access request on the target object storage gateway server; the reverse proxy server sends the user access request to the target object storage gateway server; the target object storage gateway server calls the target process to respond to the user access request; thus, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Thus, not only the loop problem of user access request is solved, but also the server cluster is guaranteed to receive and process the user access request in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved; in addition, the weight of the RGW process is controlled by dynamically modifying the routing configuration of apisix through HTTP requests, without restarting the apisix service, which improves the efficiency of data processing in the server cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A structural diagram of a load balancing method for a server cluster provided for related technologies;

[0039] Figure 2 A flow chart of an optional server cluster load balancing method provided in an embodiment of the present application;

[0040] Figure 3 A structural block diagram of a load balancing method for a server cluster provided in an embodiment of the present application;

[0041] Figure 4 A flow chart of an optional server cluster load balancing method provided in an embodiment of the present application;

[0042] Figure 5 A flow chart of an optional server cluster load balancing method provided in an embodiment of the present application;

[0043] Figure 6 A flow chart of an optional server cluster load balancing method provided in an embodiment of the present application;

[0044] Figure 7 A schematic diagram of the structure of a load balancing device for a server cluster provided in an embodiment of the present application;

[0045] Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Here, the "another" or "yet another" mentioned in the description of the drawings does not refer to a specific embodiment, and the various embodiments of the present application can be combined with each other without conflict.

[0047] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0048] To facilitate understanding, relevant terms in the embodiments of the present application are first introduced.

[0049] 1) Ceph is a distributed storage system that features high performance, high availability, high scalability, and rich features. Ceph provides three forms of storage: block storage, file storage, and object storage. The Rados Gateway (RGW) is the entry point for object storage, and is essentially a HyperText Transfer Protocol (HTTP) server. Through this entry point, users can access Ceph's object storage in a RESTful manner through the HTTP protocol.

[0050] 2) Linux Virtual Server (LVS) is a virtual server cluster system. LVS is mainly used for load balancing of server clusters. It works at the network layer and can achieve high-performance and high-availability server cluster technology. It is cheap and can combine many low-performance servers to form a super server. It is easy to use and has very simple configuration, and has multiple load balancing methods. It is stable and reliable, and even if a server in the cluster fails to work properly, it will not affect the overall effect. At the same time, it is also very scalable.

[0051] 3) Load Balance (LB) uses a centralized or distributed strategy to allocate network user access requests and determines specific configuration parameters according to the cluster system application. Its configuration parameters are related to the user's firewall, router, and network environment.

[0052] 4) Keepalived is a load balancing server that ensures high availability of the cluster in cluster management. It prevents single point failure by detecting the status of the server.

[0053] 5) Nginx is a high-performance, lightweight HTTP and reverse proxy web server. It also provides email IMAP / POP3 / SMTP services. It is characterized by small memory usage and strong concurrency capabilities.

[0054] 6)Apsix is ​​a cloud-native, high-performance, scalable microservice API gateway and reverse proxy server. Apsix is ​​based on OpenResty and etcd. Compared with traditional API gateways, Apsix has dynamic routing and plug-in hot loading, service hot start, speed limit and current limit functions.

[0055] In order to better understand the load balancing method of the server cluster provided by the present application, the load balancing method of the server cluster in the related art is first described:

[0056] The current distributed storage system is implemented based on Ceph. Object storage is one of the three major storages supported by Ceph. The object storage system provides object storage interfaces through RGW based on the Ceph rados layer. RGW supports standard s3 interfaces and swift interfaces. Users operate their data through the RGW client to operate the underlying data, mainly including upload, download and delete operations. RGW is the client for the total inflow and outflow of data in the object storage. Generally, there will be multiple RGW nodes in a cluster. Each RGW node will have multiple RGW processes that provide services to the outside, that is, RGW instances. These instances can provide object storage presentation layer state transfer (Resource Representational State Transfer, REST) ​​application programming interface (Application Programming Interface, API) services to the outside. As the cluster scale increases, the number of RGW node instances may even reach hundreds. How to ensure the load balancing and high availability of the server cluster, that is, when a large number of requests fall into the server cluster, how to ensure that the RGW instances receive and process requests evenly and solve the problem of providing services to the outside at a single point.

[0057] In the related technology, high availability and load balancing in distributed storage systems are solved by the following two solutions: Figure 1 As shown in the figure, Solution 1 combines Keepalived and LVS components. Solution 2 combines Keepalived and Nginx components. The specific implementation process of these two solutions is to receive user access requests through Keepalived and forward the user access requests to LVS / Nginx, and LVS / Nginx distributes the user requests to the RGW node for processing. The two above solutions have the problem that user requests will loop back, resulting in the inability to send user requests, and then the server cluster cannot correctly process user requests.

[0058] This application provides a load balancing method for a server cluster, such as Figure 2 As shown, the method comprises the following steps:

[0059] Step 201: When a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server.

[0060] Among them, the load balancing server is a service software that ensures high availability of the server cluster in server cluster management. It is used to prevent the occurrence of single point failure of the server. It has the function of configuring and managing the reverse proxy server to achieve high availability of web front-end services.

[0061] Among them, the reverse proxy server is a load balancing scheduler in the server cluster management, which is used for load balancing of the server cluster. Here, the reverse proxy server is an apisix server.

[0062] In the present application embodiment, Figure 3As shown, the server cluster includes at least N load balancer servers Keepalived, where N≥2 and N is a positive integer, and at least M reverse proxy servers apisix, where M≥2 and M is a positive integer. Here, N<M. Only one of the N load balancer servers Keepalived is the primary load balancer server Keepalived, and the rest are standby load balancer servers Keepalived. The primary load balancer server Keepalived communicates with the standby load balancer servers Keepalived through the Virtual Router Redundancy Protocol (VRRP). Among them, the primary load balancer server Keepalived provides the virtual Internet Protocol (VIP) address of the virtual router externally. Users send user access requests through the VIP address provided by the primary load balancer server Keepalived in the server cluster. After the primary load balancer server Keepalived receives user access requests sent by different clients, it sends the user requests to the corresponding reverse proxy server apisix through the primary load balancer server Keepalived.

[0063] Step 202: Determine the target object storage gateway server corresponding to the user access request through the reverse proxy server.

[0064] Among them, the object storage gateway server is an object storage interface built on top of librados, which is an interface for processing the total inflow and outflow of data in the server cluster. It supports the standard Amazon S3 RESTful interface and the Swift interface of OpenStack. It should be noted that users' operations on the data in the server cluster are performed on the underlying data through RGW, and the operations include uploading, downloading, and deleting, etc.

[0065] Among them, the target object storage gateway server is the object storage gateway server corresponding to the user access request information.

[0066] Here, as Figure 3 shown, the server cluster includes at least P object storage gateway servers RGW, where P≥2 and P is a positive integer, and the reverse proxy server apisix contains the correspondence between the user access request and each object storage gateway server RGW.

[0067] In the embodiment of the present application, after the reverse proxy server apisix in the server cluster receives the user access request forwarded by the load balancing server Keepalived, the reverse proxy server apisix determines the target object storage gateway server RGW that has a corresponding relationship with the user access request.

[0068] Step 203: Determine a target process on the target object storage gateway server for processing user access requests through the reverse proxy server.

[0069] The process is used to provide the REST API service in the server cluster to the outside world and to process user access requests. Here, the process is the RGW process, which is also called the RGW instance.

[0070] Here, if Figure 3 As shown, the server cluster includes at least P object storage gateway servers RGW, P≥2, and P is a positive integer, each object storage gateway server RGW includes at least Q RGW processes that provide services to the outside, Q≥2, and Q is a positive integer, and the reverse proxy server apisix in the server cluster manages multiple RGW processes in groups.

[0071] In an embodiment of the present application, after the reverse proxy server apisix in the server cluster determines the target object storage gateway server RGW that has a corresponding relationship with the user access request, based on the group management of multiple RGW processes by the reverse proxy server apisix, determines the target RGW process on the target object storage gateway server RGW for processing the user access request.

[0072] Step 204: Send the user access request to the target object storage gateway server through the reverse proxy server.

[0073] In the embodiment of the present application, the user access request is sent to the target object storage gateway server RGW through the reverse proxy server apisix in the server cluster.

[0074] Step 205: The target object storage gateway server RGW calls the target RGW process to respond to the user access request.

[0075] In the embodiment of the present application, the target object storage gateway server RGW in the server cluster calls the target RGW process to respond to the user access request.

[0076] The present application provides a load balancing method for a server cluster, when the load balancing server in the server cluster receives user access requests sent by different clients, the load balancing server forwards the user access request to the reverse proxy server; the reverse proxy server determines the target object storage gateway server corresponding to the user access request; the reverse proxy server determines the target process for processing the user access request on the target object storage gateway server; the reverse proxy server sends the user access request to the target object storage gateway server; the target object storage gateway server calls the target process to respond to the user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. In this way, not only the problem of user access request loop is solved, but also the server cluster is guaranteed to receive and process user access requests in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved; in addition, the weight of the RGW process is controlled by dynamically modifying the routing configuration of apisix through HTTP requests, without restarting the apisix service, which improves the efficiency of data processing in the server cluster.

[0077] This application provides a load balancing method for a server cluster, such as Figure 4 As shown, the method comprises the following steps:

[0078] Step 301: When a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server.

[0079] Step 302: Determine the target object storage gateway server corresponding to the user access request through the reverse proxy server.

[0080] Step 303: Determine the request identifier carried in the user access request through the reverse proxy server.

[0081] The request identifier may be a request address included in the user access request, or may be a uniform resource identifier included in the user access request.

[0082] In an embodiment of the present application, a request identifier carried in a user access request is determined by a reverse proxy server in a server cluster.

[0083] Step 304: Search the target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.

[0084] Here, since multiple routes are set in the reverse proxy server, the user access request entered by the user in the client can be assigned to the corresponding route set by the reverse proxy server based on the request identifier. It should be noted that different routes correspond to different RGW processes in the target object storage gateway server RGW.

[0085] In a scenario of load balancing of an achievable server cluster, when the request identifier is the request address contained in the user access request, such as the request address includes the host address and the client address, the reverse proxy server in the server cluster searches the target object storage gateway server RGW for the target RGW process corresponding to the request address carried in the user access request. It should be noted that since different address ranges set by the reverse proxy server correspond to different RGW processes, the reverse proxy server determines the address range to which the request address belongs, and based on the address range to which the request address belongs, searches the target RGW process corresponding to the current address range from the target object storage gateway server RGW. In this way, based on the request address contained in the user access request, apisix is ​​used to group and manage the RGW processes to ensure that the user access request is sent to the target RGW process corresponding to the request address.

[0086] In a scenario of load balancing of an achievable server cluster, when the request identifier is a Uniform Resource Identifier (URI) contained in a user access request, the reverse proxy server in the server cluster searches for the target RGW process corresponding to the URI carried in the user access request from the target object storage gateway server RGW. It should be noted that since the RGW processes corresponding to different URIs set by the reverse proxy server are different, the reverse proxy server searches for the target RGW process corresponding to the current URI from the target object storage gateway server RGW. In this way, based on the URI contained in the user access request, apisix is ​​used to group and manage the RGW processes to ensure that the user access request is sent to the target RGW process corresponding to the URI.

[0087] In the embodiment of the present application, step 304 searches for the target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server, such as Figure 5 As shown, it can also be achieved through the following steps:

[0088] Step 3041: Search the target object storage gateway server for the first process corresponding to the request identifier through the reverse proxy server.

[0089] The first process pre-allocates the RGW processes corresponding to the request identifier carried in the user access request to the multiple RGW processes.

[0090] Exemplarily, the first process may be one of a plurality of RGW processes corresponding to the same address range.

[0091] In the embodiment of the present application, a reverse proxy server in a server cluster searches a target object storage gateway server for a first process that is pre-assigned and corresponds to a request identifier carried in a user access request.

[0092] Step 3042: Determine through the reverse proxy server that the first process is in a disconnected state.

[0093] The disconnected state may be understood as a failure in normal communication between the first process and the target object storage gateway server.

[0094] In the embodiment of the present application, a reverse proxy server in a server cluster requests a target storage gateway server RGW corresponding to a user, and determines that a first process corresponding to the request identifier is disconnected from the target storage gateway server RGW.

[0095] In other embodiments of the present application, it can also be determined through a reverse proxy server that the first process is in an upgraded state.

[0096] In other embodiments of the present application, after determining that the first process is in a disconnected state through the reverse proxy server, the weight of the first process is set as the first parameter through the reverse proxy server.

[0097] The first parameter is used to indicate that the first process is in a disconnected state. For example, the first parameter may be 0, indicating that the first process is in a disconnected state and cannot process the user access request.

[0098] In a load balancing scenario of a realizable server cluster, the weight of the first process in the reverse proxy server apisix in the server cluster can be dynamically modified through the HyperText Transfer Protocol (HTTP), that is, the weight of the first process can be dynamically modified to a first parameter through an HTTP request; in this way, there is no need to restart the reverse proxy server apisix, and the modified weight of the first process can take effect dynamically. In addition, when the first process is in normal working state, the weight of the first process can still be dynamically modified to a second parameter through an HTTP request, and the second parameter is different from the first parameter, and the second parameter is a positive integer greater than the first parameter. In this way, when the first process is in a disconnected state, the weight of the first process is dynamically modified through an HTTP request without restarting the service, and it will not affect other RGW processes from receiving user access requests, and the user will not be aware of it, and it will not affect the performance of the cluster.

[0099] In other embodiments of the present application, after step 3042 determines that the first process is in a disconnected state through the reverse proxy server, the following steps may also be performed:

[0100] The reverse proxy server determines that the first process changes from a disconnected state to an idle state.

[0101] The weight of the first process is modified from the first parameter to the second parameter through the reverse proxy server; wherein the second parameter is used to indicate that the first process is in an idle state.

[0102] Step 3043: Search the target object storage gateway server for a second process corresponding to the request identifier through the reverse proxy server.

[0103] Among them, the second process is different from the first process.

[0104] The second process pre-allocates the RGW processes corresponding to the request identifier carried in the user access request to the multiple RGW processes.

[0105] In the embodiment of the present application, the second process may be one of the multiple RGW processes corresponding to the same address range. It should be noted that the first process and the second process may be two different RGW processes among the multiple RGW processes corresponding to the same address range.

[0106] In an embodiment of the present application, it is determined that the first process is in a disconnected state, and a second process corresponding to a request identifier carried in a user access request is searched in advance from the target object storage gateway server through a reverse proxy server in the server cluster.

[0107] In other embodiments of the present application, the weight of the second process is less than the weight of the first process.

[0108] Here, the higher the weight of the RGW process, the more user access requests it receives. Specifically, a request class identifier corresponds to an address range, and an address range corresponds to multiple RGW processes. The higher the weight of these RGW processes, the more user access requests it receives.

[0109] In an embodiment of the present application, the weight of the second process corresponding to the request identifier of the user access request is less than the weight of the first process corresponding to the request identifier of the user access request, that is, the number of user access requests corresponding to the request identifier received by the second process is less than the number of user access requests corresponding to the request identifier received by the first process.

[0110] Step 3044: When the second process is in an idle state, determine that the second process is the target process.

[0111] The idle state can be understood as the target object storage gateway server RGW not invoking the second RGW process to process any user access request.

[0112] In an embodiment of the present application, the reverse proxy server in the server cluster determines that the target object storage gateway server RGW does not call the second process to process any user access request, that is, determines that the second process is in an idle state, and determines the second process as the target process.

[0113] Step 305: Send the user access request to the target object storage gateway server through the reverse proxy server.

[0114] Step 306: Call the target process through the target object storage gateway server to respond to the user access request.

[0115] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0116] This application provides a load balancing method for a server cluster, such as Figure 6 As shown, the method comprises the following steps:

[0117] Step 401: When a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server.

[0118] Step 402: Determine the resource utilization of each object storage gateway server among all object storage gateway servers through the reverse proxy server.

[0119] The resource utilization is the ratio of the number of RGW processes in working state in the RGW to the total number of RGW processes in the RGW.

[0120] In an embodiment of the present application, apisix is ​​used to determine the ratio of the number of RGW processes in working state of each RGW among all RGWs to the total number of RGW processes in each RGW, that is, the resource utilization of each RGW. Based on the resource utilization of each RGW, the target object storage gateway server RGW can be determined.

[0121] In other embodiments of the present application, after determining the resource utilization rate of each RGW in all RGWs through the reverse proxy server in step 402, the following steps may also be performed:

[0122] The first request rate of user access requests is determined through apisix, and the second request rate threshold and the third request rate threshold of user access requests that are preset are obtained through apisix. When the first request rate of user access requests is less than the second request rate, apisix receives the user access requests forwarded by keepalived; when the first request rate of user access requests is greater than the second request rate but not greater than the third request rate, apisix delays receiving the user access requests forwarded by keepalived; when the first request rate of user access requests is greater than the third request rate, apisix refuses to receive the user access requests forwarded by keepalived, generates request failure information, and outputs the request failure information. In this way, apisix controls the rate and amount of user access request traffic injected into the server cluster, smoothing out the burst traffic in the server cluster.

[0123] Step 403: Determine an object storage gateway server whose resource utilization is less than a resource utilization threshold among all object storage gateway servers, and use it as the target object storage gateway server.

[0124] The resource utilization threshold may be a threshold pre-set in the RGW based on the historical resource utilization of all RGWs, or may be a threshold dynamically set in the RGW in real time based on the current resource utilization of all RGWs.

[0125] In the embodiment of the present application, after determining the resource utilization of each RGW among all RGWs through the reverse proxy server apisix, it is determined whether there is an RGW whose resource utilization is less than the resource utilization threshold among all RGWs. If there is an RGW whose resource utilization is less than the resource utilization threshold, one of the RGWs is obtained as the target object storage gateway server RGW. In this way, the resource utilization of the RGW is improved, and at the same time, the processing efficiency of the user access request is improved.

[0126] Step 404: Determine the target process for processing the user access request on the target object storage gateway server through the reverse proxy server.

[0127] Step 405: Send the user access request to the target object storage gateway server through the reverse proxy server.

[0128] Step 406: Call the target process through the target object storage gateway server to respond to the user access request.

[0129] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0130] Based on the above embodiments, the present application provides a load balancing device for a server cluster, which can be applied to Figure 2 , 4 ~6 corresponds to a load balancing method for a server cluster, refer to Figure 7 As shown, the load balancing device 7 of the server cluster includes:

[0131] The first sending unit 701 is used to forward the user access request to the reverse proxy server through the load balancing server when the load balancing server in the server cluster receives the user access request sent by different clients;

[0132] The first processing unit 702 is used to determine the target object storage gateway server corresponding to the user access request through the reverse proxy server;

[0133] The second processing unit 703 is used to determine the target process for processing the user access request on the target object storage gateway server through the reverse proxy server;

[0134] The second sending unit 704 is used to send the user access request to the target object storage gateway server through the reverse proxy server;

[0135] The third processing unit 705 is configured to call the target process through the target object storage gateway server to respond to the user access request.

[0136] In other embodiments of the present application, the second processing unit 703 is also used to determine the request identifier carried by the user access request through the reverse proxy server; and search for the target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.

[0137] In other embodiments of the present application, the second processing unit 703 is also used to search for a first process corresponding to the request identifier from the target object storage gateway server through a reverse proxy server; determine that the first process is in a lost state through the reverse proxy server; search for a second process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server; wherein the second process is different from the first process; and when the second process is in an idle state, determine that the second process is the target process.

[0138] In other embodiments of the present application, the second processing unit 703 is also used to make the weight of the second process smaller than the weight of the first process.

[0139] In other embodiments of the present application, the second processing unit 703 is further used to set the weight of the first process as a first parameter through the reverse proxy server; wherein the first parameter is used to indicate that the first process is in a disconnected state.

[0140] In other embodiments of the present application, the second processing unit 703 is also used to determine, through a reverse proxy server, that the first process changes from a lost state to an idle state; and to modify, through the reverse proxy server, the weight of the first process from the first parameter to the second parameter; wherein the second parameter is used to characterize that the first process is in an idle state.

[0141] In other embodiments of the present application, the first processing unit 702 is also used to determine the resource utilization of each object storage gateway server among all object storage gateway servers through the reverse proxy server; and determine an object storage gateway server among all object storage gateway servers whose resource utilization is less than the resource utilization threshold as the target object storage gateway server.

[0142] The present application provides a load balancing device for a server cluster. When a load balancing server in a server cluster receives a user access request sent by different clients, the load balancing server forwards the user access request to a reverse proxy server; the reverse proxy server determines the target object storage gateway server corresponding to the user access request; the reverse proxy server determines the target process for processing the user access request on the target object storage gateway server; the reverse proxy server sends the user access request to the target object storage gateway server; the target object storage gateway server calls the target process to respond to the user access request; thus, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Thus, not only the user access request loop problem is solved, but also the server cluster is guaranteed to receive and process the user access request in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved; in addition, the weight of the rgw process is controlled by dynamically modifying the routing configuration of apisix through HTTP requests, without restarting the apisix service, thereby improving the efficiency of the server cluster in processing data.

[0143] Based on the above embodiments, the present application provides an electronic device which can be applied to Figure 2 , 4 ~6 corresponds to a load balancing method for a server cluster, refer to Figure 8 As shown, the electronic device 8 ( Figure 8 Electronic devices 8 in the Figure 7 The server cluster load balancing device 7) includes: a memory 81 and a processor 82, wherein the processor 82 is used to execute the server cluster load balancing program stored in the memory 81, and the electronic device 8 implements the following steps through the processor 82:

[0144] When the load balancing server in the server cluster receives user access requests sent by different clients, it forwards the user access requests to the reverse proxy server through the load balancing server;

[0145] Determine the target object storage gateway server corresponding to the user access request through the reverse proxy server;

[0146] Determine the target process for processing user access requests on the target object storage gateway server through the reverse proxy server;

[0147] Send the user access request to the target object storage gateway server through the reverse proxy server;

[0148] The target process is called by the target object storage gateway server to respond to the user access request.

[0149] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0150] The request identifier carried in the user access request is determined through the reverse proxy server; and the target process corresponding to the request identifier is searched from the target object storage gateway server through the reverse proxy server.

[0151] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0152] Search the target object storage gateway server for a first process corresponding to the request identifier through a reverse proxy server; determine that the first process is in a disconnected state through the reverse proxy server; search the target object storage gateway server for a second RGW process corresponding to the request identifier through the reverse proxy server; wherein the second process is different from the first process; and when the second process is in an idle state, determine that the second process is the target process.

[0153] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0154] The weight of the second process is less than the weight of the first process.

[0155] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0156] The weight of the first process is set as a first parameter through the reverse proxy server; wherein the first parameter is used to indicate that the first process is in a disconnected state.

[0157] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0158] Determine through a reverse proxy server that the first process changes from a disconnected state to an idle state; modify through the reverse proxy server the weight of the first process from the first parameter to a second parameter; wherein the second parameter is used to characterize that the first process is in an idle state.

[0159] In other embodiments of the present application, the processor 82 is used to execute the load balancing program of the server cluster stored in the memory 81 to implement the following steps:

[0160] Determine the resource utilization of each object storage gateway server among all object storage gateway servers through the reverse proxy server; determine an object storage gateway server among all object storage gateway servers whose resource utilization is less than the resource utilization threshold value as the target object storage gateway server.

[0161] The present application provides an electronic device, when a load balancing server in a server cluster receives a user access request sent by different clients, the load balancing server forwards the user access request to a reverse proxy server; the reverse proxy server determines the target object storage gateway server corresponding to the user access request; the reverse proxy server determines the target process for processing the user access request on the target object storage gateway server; the reverse proxy server sends the user access request to the target object storage gateway server; the target object storage gateway server calls the target process to respond to the user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. In this way, not only the user access request loop problem is solved, but also the server cluster is guaranteed to receive and process the user access request in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved; in addition, the weight of the rgw process is controlled by dynamically modifying the routing configuration of apisix through HTTP requests, without restarting the apisix service, which improves the efficiency of the server cluster in processing data.

[0162] The present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the following steps:

[0163] When the load balancing server in the server cluster receives user access requests sent by different clients, it forwards the user access requests to the reverse proxy server through the load balancing server;

[0164] Determine the target object storage gateway server corresponding to the user access request through the reverse proxy server;

[0165] Determine the target process for processing user access requests on the target object storage gateway server through the reverse proxy server;

[0166] Send the user access request to the target object storage gateway server through the reverse proxy server;

[0167] The target process is called by the target object storage gateway server to respond to the user access request.

[0168] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0169] The request identifier carried in the user access request is determined through the reverse proxy server; and the target process corresponding to the request identifier is searched from the target object storage gateway server through the reverse proxy server.

[0170] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0171] Searching for a first process corresponding to a request identifier from a target object storage gateway server through a reverse proxy server; determining that the first process is in a disconnected state through a reverse proxy server; searching for a second process corresponding to the request identifier from the target object storage gateway server through a reverse proxy server; wherein the second process is different from the first process; and determining that the second process is a target process when the second process is in an idle state.

[0172] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0173] The weight of the second process is less than the weight of the first process.

[0174] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0175] The weight of the first process is set as a first parameter through the reverse proxy server; wherein the first parameter is used to indicate that the first process is in a disconnected state.

[0176] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0177] Determine through a reverse proxy server that the first process changes from a disconnected state to an idle state; modify through the reverse proxy server the weight of the first process from the first parameter to a second parameter; wherein the second parameter is used to characterize that the first process is in an idle state.

[0178] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:

[0179] Determine the resource utilization of each object storage gateway server among all object storage gateway servers through the reverse proxy server; determine an object storage gateway server among all object storage gateway servers whose resource utilization is less than the resource utilization threshold value as the target object storage gateway server.

[0180] The present application provides a storage medium, when the load balancing server in the server cluster receives the user access request sent by different clients, the load balancing server forwards the user access request to the reverse proxy server; the reverse proxy server determines the target object storage gateway server corresponding to the user access request; the reverse proxy server determines the target process for processing the user access request on the target object storage gateway server; the reverse proxy server sends the user access request to the target object storage gateway server; the target object storage gateway server calls the target process to respond to the user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. In this way, not only the problem of user access request loop is solved, but also the server cluster is guaranteed to receive and process the user access request in a balanced manner, and the problem of providing a single point to the outside in the server cluster is solved; in addition, the weight of the rgw process is controlled by dynamically modifying the routing configuration of apisix through HTTP requests, without restarting the apisix service, which improves the efficiency of the server cluster in processing data.

[0181] It should be noted that the above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0182] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0183] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0184] In addition, all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), disks or optical disks, and other media that can store program codes.

[0185] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0186] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0187] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0188] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A load balancing method for a server cluster, characterized in that: The method comprises: When the load balancing server in the server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to the reverse proxy server, which is an apisix server; Determine, by means of the reverse proxy server, a target object storage gateway server corresponding to the user access request; Determine, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request; Sending the user access request to the target object storage gateway server through the reverse proxy server; Calling the target process through the target object storage gateway server to respond to the user access request; The determining, by the reverse proxy server, a target object storage gateway server corresponding to the user access request includes: Determine the resource utilization rate of each object storage gateway server among all object storage gateway servers through the reverse proxy server; An object storage gateway server whose resource utilization is less than a resource utilization threshold among all the object storage gateway servers is determined as the target object storage gateway server.

2. The load balancing method for a server cluster according to claim 1, characterized in that: The step of determining, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request comprises: Determine, by the reverse proxy server, the request identifier carried in the user access request; The target process corresponding to the request identifier is searched from the target object storage gateway server through the reverse proxy server.

3. The load balancing method for a server cluster according to claim 2, characterized in that: The step of searching the target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server includes: Searching, through the reverse proxy server, from the target object storage gateway server for a first process corresponding to the request identifier; Determining, by the reverse proxy server, that the first process is in a disconnected state; Searching, through the reverse proxy server, from the target object storage gateway server for a second process corresponding to the request identifier; wherein the second process is different from the first process; When the second process is in an idle state, the second process is determined to be the target process.

4. The load balancing method for a server cluster according to claim 3, characterized in that: The weight of the second process is smaller than the weight of the first process.

5. The load balancing method for a server cluster according to claim 3, characterized in that: After determining that the first process is in a disconnected state through the reverse proxy server, the method includes: The weight of the first process is set as a first parameter through the reverse proxy server; wherein the first parameter is used to indicate that the first process is in the disconnected state.

6. The load balancing method for a server cluster according to claim 4, characterized in that: After the weight of the first process is set as the first parameter by the reverse proxy server, the method includes: Determining, by the reverse proxy server, that the first process changes from the disconnected state to the idle state; The weight of the first process is modified from the first parameter to the second parameter through the reverse proxy server; wherein the second parameter is used to indicate that the first process is in the idle state.

7. A load balancing device for a server cluster, characterized in that: The device comprises: A first sending unit is used for forwarding user access requests sent by different clients to a reverse proxy server through the load balancing server when the load balancing server in the server cluster receives the user access requests, and the reverse proxy server is an apisix server; The first processing unit is used to determine the target object storage gateway server corresponding to the user access request through the reverse proxy server; and is also used to determine the resource utilization rate of each object storage gateway server among all the object storage gateway servers through the reverse proxy server; and determine that one object storage gateway server among all the object storage gateway servers whose resource utilization rate is less than the resource utilization threshold is the target object storage gateway server; A second processing unit, configured to determine, through the reverse proxy server, a target process on the target object storage gateway server for processing the user access request; A second sending unit, configured to send the user access request to the target object storage gateway server through the reverse proxy server; The third processing unit is configured to call the target process through the target object storage gateway server to respond to the user access request.

8. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor is used to execute the executable instructions stored in the memory to implement the load balancing method for a server cluster as described in any one of claims 1 to 6.

9. A computer storage medium, characterized in that The computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the load balancing method for a server cluster as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Hyper-converged normal recording system based on distributed object storage

    CN108881942A

  • Object storage service management method and electronic equipment

    CN111212111A

  • Container mirror image warehouse processing method, device and equipment and storage medium

    CN112306970A