Request scheduling method and device in cluster system, electronic equipment and storage medium
By setting the scheduling cycle on the main service node of the cluster system, calculating the total number of requested connections of the storage node and determining the scheduling threshold, and dividing the serviceable and unservable resource pools, the problem of unbalanced client connection request scheduling in the cluster system is solved, and system stability and domain name mount processing efficiency are improved.
Patent Information
- Application Number
- CN202411855512.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-16
AI Technical Summary
In the cluster system, the load balancing strategy has defects, resulting in unbalanced client connection request scheduling, affecting system stability.
By setting a preset scheduling cycle on the main service node, the number of requested connections for each storage node is obtained, the total number of requested connections is calculated, and the scheduling threshold is determined based on the total number and the number of nodes. The storage node that meets the threshold is added to the serviceable resource pool, otherwise it will be added to the non-serviceable resource pool, and then select the target storage node in the serviceable resource pool for scheduling when a new connection request is requested.
It realizes more balanced and reasonable scheduling of client connection requests, effectively guarantees the stability of the cluster system, and improves the efficiency of domain name mount processing.
Smart Images

Figure CN119629252A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cluster services, and in particular to a request scheduling method in a cluster system, and also to a request scheduling device, an electronic device, and a computer-readable storage medium in a cluster system. Background Art
[0002] The distributed storage system adopts a distributed, fully symmetrical architecture to integrate scattered storage resources and provide a unified namespace for users, so that users can access the system through any node and process client connection requests. In order to evenly distribute client connection requests and ensure business reliability, the storage system proposes various load balancing strategies for users to choose, such as polling strategy, connection number strategy, etc. The system connects multiple clients to each storage node according to the selected strategy, so that the business and hard disk pressure of different storage nodes are relatively balanced. However, in actual use, due to various reasons, such as node downtime, load balancing defects, policy mismatch, etc., the load balancing effect may not be ideal.
[0003] Therefore, how to perform a more balanced and reasonable scheduling of client connection requests to effectively ensure the stability of the cluster system is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0004] The purpose of the present application is to provide a request scheduling method in a cluster system, which can schedule client connection requests in a more balanced and reasonable manner to effectively ensure the stability of the cluster system; another purpose of the present application is to provide a request scheduling device, electronic device, computer-readable storage medium and computer program product in a cluster system, all of which have the above-mentioned beneficial effects.
[0005] In a first aspect, the present application provides a request scheduling method in a cluster system, the cluster system comprising a primary service node and a plurality of storage nodes, each of the storage nodes being connected to the primary service node, the method being applied to the primary service node, comprising:
[0006] Within a preset scheduling period, obtaining the number of connection requests of each storage node, and calculating the total number of connection requests of the cluster system;
[0007] Determining a scheduling threshold within the preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system;
[0008] Adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool;
[0009] For a new connection request within the preset scheduling period, a target storage node is selected from the serviceable resource pool, and the new connection request is scheduled to the target storage node.
[0010] Optionally, the cluster system further includes a domain name server, the primary service node is connected to the domain name server, and the method further includes:
[0011] The node information and the number of connection requests of each serviceable node in the serviceable resource pool are uploaded to the domain name server, so that the domain name server responds to the domain name mounting request initiated by the client with reference to the node information and the number of connection requests of each serviceable node.
[0012] Optionally, the request scheduling method in the cluster system further includes:
[0013] Performing fault detection on each of the storage nodes in the cluster system to determine the faulty storage node;
[0014] A target serviceable node is selected in the serviceable resource pool, and all connection requests on the failed storage node are scheduled to the target serviceable node.
[0015] Optionally, selecting a target serviceable node in the serviceable resource pool, and scheduling all connection requests on the failed storage node to the target serviceable node includes:
[0016] Determining the actual number of requested connections on the failed storage node;
[0017] For each serviceable node in the serviceable resource pool, calculating a difference between the number of requested connections on the serviceable node and the scheduling threshold;
[0018] Arranging the serviceable nodes in the serviceable resource pool in descending order of the difference value to obtain a serviceable node sequence;
[0019] Selecting the first one or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual number of requested connections;
[0020] Scheduling all the connection requests on the failed storage node to the target serviceable node;
[0021] Accordingly, for a new connection request within the preset scheduling period, selecting a target storage node in the serviceable resource pool and scheduling the new connection request to the target storage node includes:
[0022] For the new connection request within the preset scheduling period, selecting a serviceable node with the smallest number of requested connections in the serviceable resource pool as the target storage node;
[0023] The new connection request is dispatched to the target storage node.
[0024] Optionally, after performing fault detection on each storage node in the cluster system and determining the faulty storage node, the method further includes:
[0025] Recording the node information of the faulty storage node to a faulty node list;
[0026] Performing fault detection on each of the fault storage nodes in the fault node list at a preset time interval to determine a fault recovery node;
[0027] Add the fault recovery node to the serviceable resource pool.
[0028] Optionally, adding the storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding the storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool, includes:
[0029] Adding the storage node whose requested connection number is lower than the scheduling threshold to the serviceable resource pool;
[0030] The storage nodes whose number of requested connections is not less than the scheduling threshold are added to the unserviceable resource pool.
[0031] Optionally, the request scheduling method in the cluster system further includes:
[0032] Within the preset scheduling period, counting the number of real-time connection requests of each unserviceable node in the unserviceable resource pool;
[0033] The unserviceable nodes whose number of real-time connection requests is lower than the scheduling threshold are removed from the unserviceable resource pool and added to the serviceable resource pool.
[0034] In a second aspect, the present application further discloses a request scheduling device in a cluster system, wherein the cluster system includes a primary service node and a plurality of storage nodes, each of the storage nodes is connected to the primary service node, and the device is applied to the primary service node, including:
[0035] An acquisition module, used to acquire the number of connection requests of each storage node within a preset scheduling period, and calculate the total number of connection requests of the cluster system;
[0036] A determination module, configured to determine a scheduling threshold within the preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system;
[0037] A setting module, used to add storage nodes that meet the scheduling threshold to a serviceable resource pool, and to add storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool;
[0038] The scheduling module is used to select a target storage node in the serviceable resource pool for a new connection request within the preset scheduling period, and schedule the new connection request to the target storage node.
[0039] In a third aspect, the present application further discloses an electronic device, comprising:
[0040] Memory for storing computer programs;
[0041] The processor is used to implement the steps of any one of the request scheduling methods in the cluster system described above when executing the computer program.
[0042] In a fourth aspect, the present application further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the request scheduling method in any cluster system as described above are implemented.
[0043] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of any of the request scheduling methods in the cluster system as described above.
[0044] The present application provides a request scheduling method in a cluster system, wherein the cluster system includes a main service node and multiple storage nodes, each of which is connected to the main service node. The method is applied to the main service node, including: obtaining the number of request connections of each storage node within a preset scheduling period, and calculating the total number of request connections of the cluster system; determining a scheduling threshold within the preset scheduling period based on the total number of request connections and the total number of storage nodes in the cluster system; adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to an unserviceable resource pool; for new connection requests within the preset scheduling period, selecting a target storage node from the serviceable resource pool, and scheduling the new connection request to the target storage node.
[0045] By applying the technical solution provided by the present application, the main service node in the cluster system is used to detect the number of connection requests of each storage node in the cluster system according to the scheduling cycle, so as to obtain the total number of connection requests of the cluster system in the current scheduling cycle, so as to determine the scheduling threshold in the current scheduling cycle in combination with the total number of storage nodes in the cluster system. Thus, the client connection requests received in the current scheduling cycle can be scheduled with reference to the scheduling threshold, that is, all storage nodes in the cluster system are divided into serviceable nodes and non-serviceable nodes based on the scheduling threshold in the current scheduling cycle, so as to select serviceable nodes to provide services for new client connection requests. It can be seen that the present technical solution can perform more balanced and reasonable scheduling of client connection requests to effectively ensure the stability of the cluster system.
[0046] In one embodiment of the present application, the cluster system can further implement domain name mounting processing. A domain name server is also deployed in the cluster system to communicate with the main service node. The main service node can synchronously upload the node information and the number of requested connections of each serviceable node in the current scheduling cycle to the domain name server, so that when the domain name server receives the domain name mounting request initiated by the client, it can directly refer to the node information and the number of requested connections of each service node to select a mountable node to respond to the domain name mounting request, without the need to re-detect and screen the mountable nodes in the cluster system, thereby effectively improving the efficiency of domain name mounting processing.
[0047] The request scheduling device, electronic device, computer-readable storage medium and computer program product in the cluster system provided in this application also have the above-mentioned technical effects, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings required for use in the description of the prior art and the embodiments of the present application are briefly introduced below. Of course, the drawings described below in relation to the embodiments of the present application are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present application.
[0049] Figure 1 A schematic diagram of the structure of a cluster system provided in this application;
[0050] Figure 2 A flowchart of a request scheduling method in a cluster system provided by the present application;
[0051] Figure 3 A schematic diagram of the structure of a request scheduling device in a cluster system provided by the present application;
[0052] Figure 4 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0053] The core of the present application is to provide a request scheduling method in a cluster system, which can schedule client connection requests in a more balanced and reasonable manner to effectively ensure the stability of the cluster system; another core of the present application is to provide a request scheduling device, electronic device, computer-readable storage medium and computer program product in a cluster system, all of which have the above-mentioned beneficial effects.
[0054] In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0055] An embodiment of the present application provides a request scheduling method in a cluster system.
[0056] First, please refer to Figure 1 , Figure 1 This is a structural diagram of a cluster system provided in the present application. The cluster system includes a main service node and multiple storage nodes, and each storage node is connected to the main service node. The request scheduling method provided in an embodiment of the present application is implemented based on the cluster system.
[0057] For further information, please refer to Figure 2 , Figure 2 A schematic diagram of a request scheduling method in a cluster system provided by the present application, wherein the request scheduling method in the cluster system is applied to Figure 1 The main service node shown may include the following S101 to S104.
[0058] S101: within a preset scheduling period, obtaining the number of connection requests of each storage node, and calculating the total number of connection requests of the cluster system.
[0059] This step aims to realize the statistics of the number of requested connections on each storage node in the cluster system and the total number of requested connections in the cluster system. It should be noted that the request scheduling method provided in the embodiment of the present application can be executed according to the scheduling cycle, and S101~104 is executed once every time a scheduling cycle is opened to effectively ensure the balance of request scheduling; of course, the specific duration of the scheduling cycle does not affect the implementation of the present technical solution, for example, it can be one day or one week. Specifically, at the beginning of a scheduling cycle, the number of requested connections on each storage node in the cluster system can be obtained in turn, and the total number of requested connections in the cluster system can be obtained by adding and calculating.
[0060] S102: Determine a scheduling threshold within a preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system.
[0061] This step is intended to calculate the scheduling threshold in the current scheduling cycle. In the specific implementation process, the quotient between the total number of requested connections and the total number of storage nodes in the storage system can be directly used as the scheduling threshold in the current scheduling cycle. Of course, the method for determining the scheduling threshold is not unique. For example, when the service capabilities of each storage node are different, a weight calculation based on the actual service capabilities of the storage node can be added to obtain the scheduling threshold in the current scheduling cycle, thereby further improving the accuracy of the request scheduling results.
[0062] S103: adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool.
[0063] This step aims to realize the division of storage nodes based on the scheduling threshold, that is, to add the storage nodes that meet the scheduling threshold to the serviceable resource pool, and to add the storage nodes that do not meet the scheduling threshold to the unserviceable resource pool. It can be understood that the storage nodes in the serviceable resource pool are all serviceable nodes in the current scheduling period (that is, they can provide connection request services), and the storage nodes in the unserviceable resource pool are all unserviceable nodes in the current scheduling period (that is, they cannot provide connection request services).
[0064] In one embodiment of the present application, adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool may include:
[0065] Add storage nodes whose request connection number is lower than the scheduling threshold to the serviceable resource pool;
[0066] Add storage nodes whose request connection number is not less than the scheduling threshold to the unserviceable resource pool.
[0067] It can be seen that the embodiment of the present application provides a storage node division method based on the scheduling threshold, that is, the storage nodes whose request connection number is lower than the scheduling threshold are added to the serviceable resource pool as serviceable nodes, and the storage nodes whose request connection number is not lower than the scheduling threshold are added to the unserviceable resource pool as unserviceable nodes.
[0068] S104: For a new connection request within a preset scheduling period, a target storage node is selected from a serviceable resource pool, and the new connection request is scheduled to the target storage node.
[0069] This step aims to achieve reasonable scheduling of new client connection requests. Specifically, when a new connection request initiated by any client is received during this scheduling period, an optimal serviceable node can be directly selected from the serviceable resource pool as the target storage node to provide services for the new connection request, that is, the new connection request can be scheduled to this target storage node for processing. Furthermore, the serviceable node with the least number of requested connections can be directly used as the target storage node to process the new connection request.
[0070] In one embodiment of the present application, the request scheduling method in the cluster system may further include:
[0071] Within a preset scheduling period, count the number of real-time connection requests of each unserviceable node in the unserviceable resource pool;
[0072] The unserviceable nodes whose real-time connection request number is lower than the scheduling threshold are removed from the unserviceable resource pool and added to the serviceable resource pool.
[0073] The request scheduling method in the cluster system provided by the embodiment of the present application can further realize the dynamic adjustment of the storage nodes in the cluster system. Specifically, for each unserviceable node in the unserviceable resource pool, the number of its connection requests can be counted in real time during the current scheduling cycle. Once the number of real-time connection requests is lower than the scheduling threshold, the corresponding unserviceable node can be directly removed from the unserviceable resource pool and added to the serviceable resource pool to continue to provide services for client connection requests.
[0074] It can be seen that the request scheduling method in the cluster system provided by the embodiment of the present application uses the main service node in the cluster system to detect the number of request connections for each storage node in the cluster system according to the scheduling period, so as to obtain the total number of request connections of the cluster system in the current scheduling period, so as to determine the scheduling threshold in the current scheduling period in combination with the total number of storage nodes in the cluster system. Thus, the client connection requests received in the current scheduling period can be scheduled with reference to the scheduling threshold, that is, all storage nodes in the cluster system are divided into serviceable nodes and non-serviceable nodes based on the scheduling threshold in the current scheduling period, so as to select serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can perform more balanced and reasonable scheduling of client connection requests to effectively ensure the stability of the cluster system.
[0075] Based on the above embodiments:
[0076] In one embodiment of the present application, the cluster system may further include a domain name server, and the main service node is connected to the domain name server. The request scheduling method in the cluster system may further include: uploading the node information and the number of requested connections of each serviceable node in the serviceable resource pool to the domain name server, so that the domain name server responds to the domain name mounting request initiated by the client with reference to the node information and the number of connection requests of each serviceable node.
[0077] The request scheduling method in the cluster system provided by the embodiment of the present application can further realize the domain name mounting processing function. Specifically, a domain name server (DNS server) can also be deployed in the current cluster system, and the domain name server can be communicated with the main service node. Therefore, in each scheduling cycle, the main service node can upload the node information and the number of requested connections of each serviceable node in the serviceable resource pool collected by itself to the domain name server. Therefore, when the domain name server receives a domain name mounting request initiated by the client in the current scheduling cycle, it can refer to the above information of the main service node to select a mountable node from all serviceable nodes to respond to the domain name mounting request, thereby realizing domain name mounting processing.
[0078] In the specific implementation process, the domain name server can directly select the serviceable node with the least number of requested connections as the mountable node, and feed back the node information of the mountable node to the client corresponding to the domain name mount request, so that the client can exchange information with the mountable node to implement the domain name mount processing. In a possible implementation method, the above node information can specifically be node IP information.
[0079] It can be seen that in the embodiment of the present application, the cluster system can further realize domain name mounting processing. The main service node can synchronously upload the node information and the number of requested connections of each serviceable node in the current scheduling cycle to the domain name server, so that when the domain name server receives the domain name mounting request initiated by the client, it can directly refer to the node information and the number of requested connections of each service node to select a mountable node to respond to the domain name mounting request, without having to re-detect and screen the mountable nodes in the cluster system, thereby effectively improving the efficiency of domain name mounting processing.
[0080] In one embodiment of the present application, the request scheduling method in the cluster system may further include:
[0081] Perform fault detection on each storage node in the cluster system to determine the faulty storage node;
[0082] A target serviceable node is selected from the serviceable resource pool, and all connection requests on the failed storage node are dispatched to the target serviceable node.
[0083] The request scheduling method in the cluster system provided by the embodiment of the present application can further realize the faulty nodes of each storage node in the cluster system. Specifically, the main service node can regularly perform fault detection on each storage node in the cluster system to determine whether a faulty storage node has appeared in the cluster system; further, when it is determined that a faulty storage node has appeared in the cluster system, the target serviceable node can be directly selected from the serviceable resource pool to undertake all connection requests on the faulty storage node. It can be understood that the number of target serviceable nodes can be one or more, and all connection requests on the faulty storage node can be undertaken, and this application does not limit this.
[0084] The step of performing fault detection on each storage node in the cluster system and determining the faulty storage node may include:
[0085] Send a heartbeat signal to each storage node in the cluster system to determine whether the heartbeat response signal fed back by the storage node is received within a preset time period;
[0086] When a heartbeat response signal fed back by the storage node is received within a preset time period, the storage node is determined to be a normal storage node;
[0087] When the heartbeat response signal fed back by the storage node is not received within a preset time period, the storage node is determined to be a faulty storage node.
[0088] The embodiment of the present application provides a method for fault detection of a storage node, which can be implemented through a heartbeat monitoring mechanism. Specifically, the main service node can periodically send a heartbeat signal to each storage node in the cluster system to determine whether the heartbeat response signal fed back by each storage node can be received within a preset time length. Obviously, if the heartbeat response signal fed back by the storage node can be received within the preset time length, it can be determined that the storage node is a normal storage node; conversely, if the heartbeat response signal fed back by the storage node cannot be received within the preset time length, it can be determined that the storage node is a faulty storage node, thereby realizing the fault detection of the storage node. It should be noted that the specific value of the above-mentioned preset time length does not affect the implementation of the present technical solution, and can be set by technical personnel according to actual conditions. The embodiment of the present application does not limit this. In a possible implementation method, the preset time length can be taken as 30 seconds.
[0089] The step of selecting a target serviceable node in the serviceable resource pool and dispatching all connection requests on the failed storage node to the target serviceable node may include:
[0090] Determine the actual number of requested connections on the failed storage node;
[0091] For each serviceable node in the serviceable resource pool, the difference between the number of requested connections on the serviceable node and the scheduling threshold is calculated;
[0092] Arrange the serviceable nodes in the serviceable resource pool in descending order of difference to obtain a serviceable node sequence;
[0093] Select the first one or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual number of requested connections;
[0094] Dispatching all connection requests on the failed storage node to the target serviceable node;
[0095] Accordingly, for a new connection request within a preset scheduling period, selecting a target storage node in the serviceable resource pool and scheduling the new connection request to the target storage node may include:
[0096] For new connection requests within a preset scheduling period, a serviceable node with the smallest number of requested connections is selected from the serviceable resource pool as the target storage node;
[0097] Dispatches new connection requests to the target storage node.
[0098] An embodiment of the present application provides an implementation method for scheduling connection requests on a faulty storage node. Specifically, for each serviceable node in a serviceable resource pool, the difference between the number of requested connections on the serviceable node and the scheduling threshold can be calculated, and all serviceable nodes in the serviceable resource pool can be arranged in order of the difference from large to small to obtain a serviceable node sequence. Thus, the target serviceable node can be screened in the serviceable node sequence with reference to the actual number of requested connections on the faulty storage node, and all connection requests on the faulty storage node can be scheduled to the target serviceable node for processing. More specifically, it is necessary to ensure that the sum of the differences corresponding to the selected target serviceable nodes is greater than or equal to the actual number of requested connections on the faulty storage node, so as to effectively ensure that each connection request on the faulty storage node can be scheduled to a serviceable node for processing.
[0099] Furthermore, after performing fault detection on each storage node in the cluster system and determining the faulty storage node, the following steps may be performed:
[0100] Record the node information of the failed storage node to the failed node list;
[0101] Perform fault detection on each fault storage node in the fault node list at a preset time interval to determine the fault recovery node;
[0102] Add the failover node to the serviceable resource pool.
[0103] The request scheduling method in the cluster system provided by the embodiment of the present application can further implement node scheduling processing after the faulty node is recovered. Specifically, for the faulty storage nodes in the cluster system, their node information can be recorded in the form of a list, and the main service node can regularly perform fault detection on each faulty storage node in the faulty node list to determine whether each faulty storage node has returned to normal, and re-add the restored storage nodes (i.e., the above-mentioned fault recovery nodes) to the serviceable resource pool to achieve dynamic adjustment of the serviceable nodes in the serviceable resource pool. Furthermore, the connection requests previously scheduled to other serviceable nodes can also be migrated back to the fault recovery node to continue to provide services. Similarly, the specific value of the above-mentioned preset time interval does not affect the implementation of the present technical solution, and can be set by technical personnel according to actual conditions. The embodiment of the present application does not limit this. In a possible implementation method, the preset time interval can be set to 1 hour.
[0104] Based on the above embodiments, the embodiment of the present application takes a distributed storage system as an example to provide another request scheduling method in a cluster system.
[0105] The implementation process of the request scheduling method in the cluster system provided in the embodiment of the present application is as follows:
[0106] 1. On the primary service node of the distributed storage system, set a timer to collect the number of request connections of each storage node in the storage system, sum them up to obtain the total number of request connections N of all storage nodes in the storage system, and collect the total number M of storage nodes in the storage system.
[0107] 2. To achieve the load balancing effect in the storage system, determine the threshold of the number of request connections of each storage node as N / M (scheduling threshold).
[0108] 3. The primary service node can check the real-time number of request connections K for each storage node one by one. When K ≥ N / M, delete the IP address of this storage node from the serviceable resource pool, and the deleted storage nodes form an unserviceable resource pool.
[0109] 4. The primary service node queries the IP addresses and the number of request connections K of each storage node in the unserviceable resource pool one by one. When K < N / M, determine whether its IP address is in the serviceable resource pool according to the IP address. If not, add this IP address back to the serviceable resource pool.
[0110] 5. When a client service newly initiates a connection request, the primary service node can select a serviceable storage node from the serviceable resource pool for this client according to the set balancing strategy.
[0111] 6. When a single-node failure occurs in the distributed storage system due to an abnormal situation, the service on the faulty storage node can be drifted to one or more storage nodes in the serviceable resource pool. At this time, the service pressure on this storage node will double. Further, this storage node can be directly added to the unserviceable resource pool.
[0112] 7. After the failure is recovered, the previously drifted service can be回迁 to the storage node where the failure is recovered. At this time, both the failure-recovered node and the storage node that previously undertook the drifted service can be added back to the serviceable resource pool.
[0113] 8. A DNS server is also deployed in the distributed storage system. A serviceable resource pool can be synchronously established on the DNS server, and the primary service node can synchronously report the relevant information of the serviceable resource pool detected by itself to the DNS server.
[0114] 9. When a service client initiates a domain name mounting request, the DNS server can directly obtain the IP address with the lowest number of request connections in its serviceable resource pool and respond to the service client for mounting.
[0115] 10. When the DNS server finds that a large number of mounting requests are received within a short period of time, it can directly obtain the IP information from the serviceable resource pool by polling and respond to the service client.
[0116] It can be seen that the request scheduling method in the cluster system provided by the embodiment of the present application uses the main service node in the cluster system to detect the number of request connections for each storage node in the cluster system according to the scheduling period, so as to obtain the total number of request connections of the cluster system in the current scheduling period, so as to determine the scheduling threshold in the current scheduling period in combination with the total number of storage nodes in the cluster system. Thus, the client connection requests received in the current scheduling period can be scheduled with reference to the scheduling threshold, that is, all storage nodes in the cluster system are divided into serviceable nodes and non-serviceable nodes based on the scheduling threshold in the current scheduling period, so as to select serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can perform more balanced and reasonable scheduling of client connection requests to effectively ensure the stability of the cluster system.
[0117] An embodiment of the present application provides a request scheduling device in a cluster system.
[0118] Please refer to Figure 3 , Figure 3 This is a structural diagram of a request scheduling device in a cluster system provided by the present application. The cluster system includes a main service node and multiple storage nodes, each storage node is connected to the main service node, and the device is applied to the main service node, which may include:
[0119] The acquisition module 1 is used to acquire the number of connection requests of each storage node within a preset scheduling period, and calculate the total number of connection requests of the cluster system;
[0120] Determining module 2, used to determine a scheduling threshold within a preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system;
[0121] Setting module 3, used to add storage nodes that meet the scheduling threshold to the serviceable resource pool, and add storage nodes that do not meet the scheduling threshold to the unserviceable resource pool;
[0122] The scheduling module 4 is used to select a target storage node from the serviceable resource pool for a new connection request within a preset scheduling period, and schedule the new connection request to the target storage node.
[0123] It can be seen that the request scheduling device in the cluster system provided by the embodiment of the present application uses the main service node in the cluster system to detect the number of request connections for each storage node in the cluster system according to the scheduling period, so as to obtain the total number of request connections of the cluster system in the current scheduling period, so as to determine the scheduling threshold in the current scheduling period in combination with the total number of storage nodes in the cluster system. Thus, the client connection requests received in the current scheduling period can be scheduled with reference to the scheduling threshold, that is, all storage nodes in the cluster system are divided into serviceable nodes and non-serviceable nodes based on the scheduling threshold in the current scheduling period, so as to select serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can perform more balanced and reasonable scheduling of client connection requests to effectively ensure the stability of the cluster system.
[0124] In one embodiment of the present application, the cluster system may further include a domain name server, the primary service node is connected to the domain name server, and the request scheduling device may further include:
[0125] The domain name request processing module is used to upload the node information and the number of connection requests of each serviceable node in the serviceable resource pool to the domain name server, so that the domain name server can respond to the domain name mounting request initiated by the client with reference to the node information and the number of connection requests of each serviceable node.
[0126] In one embodiment of the present application, the request scheduling device in the cluster system may further include:
[0127] A detection module is used to perform fault detection on each storage node in the cluster system and determine the faulty storage node;
[0128] The migration module is used to select a target serviceable node in the serviceable resource pool and schedule all connection requests on the failed storage node to the target serviceable node.
[0129] In one embodiment of the present application, the migration module can be specifically used to determine the actual number of requested connections on the faulty storage node; for each serviceable node in the serviceable resource pool, calculate the difference between the number of requested connections on the serviceable node and the scheduling threshold; arrange the serviceable nodes in the serviceable resource pool in descending order of the difference to obtain a serviceable node sequence; select the first one or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual number of requested connections; schedule all connection requests on the faulty storage node to the target serviceable node;
[0130] Accordingly, the scheduling module 4 can be specifically used to select a serviceable node with the smallest number of requested connections as a target storage node in a serviceable resource pool for a new connection request within a preset scheduling period; and schedule the new connection request to the target storage node.
[0131] In one embodiment of the present application, the request scheduling device in the cluster system may further include:
[0132] The recovery module is used to perform fault detection on each storage node in the cluster system, and after determining the faulty storage node, record the node information of the faulty storage node to the faulty node list; perform fault detection on each faulty storage node in the faulty node list at a preset time interval to determine the faulty recovery node; and add the faulty recovery node to the serviceable resource pool.
[0133] In one embodiment of the present application, the setting module 3 can be specifically used to add storage nodes whose request connection numbers are lower than the scheduling threshold to the serviceable resource pool; and to add storage nodes whose request connection numbers are not lower than the scheduling threshold to the unserviceable resource pool.
[0134] In one embodiment of the present application, the request scheduling device in the cluster system may further include:
[0135] The monitoring module is used to count the number of real-time connection requests of each unserviceable node in the unserviceable resource pool within a preset scheduling period; remove the unserviceable nodes whose real-time connection request number is lower than the scheduling threshold from the unserviceable resource pool and add them to the serviceable resource pool.
[0136] For an introduction to the device provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0137] An embodiment of the present application provides an electronic device.
[0138] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application, and the electronic device may include:
[0139] A memory 11, used for storing computer programs;
[0140] The processor 10 can implement the steps of any one of the request scheduling methods in the cluster system described above when executing a computer program.
[0141] like Figure 4 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.
[0142] In the embodiment of the present application, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices, etc.
[0143] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in an embodiment of a request scheduling method in a cluster system.
[0144] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present application, the memory 11 at least stores programs for implementing the following functions:
[0145] Within a preset scheduling period, the number of connection requests of each storage node is obtained, and the total number of connection requests of the cluster system is calculated;
[0146] Determine a scheduling threshold within a preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system;
[0147] The storage nodes that meet the scheduling threshold are added to the serviceable resource pool, and the storage nodes that do not meet the scheduling threshold are added to the unserviceable resource pool;
[0148] For a new connection request within a preset scheduling period, a target storage node is selected from the serviceable resource pool, and the new connection request is scheduled to the target storage node.
[0149] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.
[0150] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.
[0151] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.
[0152] Of course, it should be noted that Figure 4 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 4 More or fewer components than shown, or combinations of certain components.
[0153] An embodiment of the present application provides a computer-readable storage medium.
[0154] The computer-readable storage medium provided in the embodiment of the present application stores a computer program, and when the computer program is executed by a processor, the steps of the request scheduling method in any of the above cluster systems can be implemented.
[0155] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.
[0156] For an introduction to the computer-readable storage medium provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0157] An embodiment of the present application provides a computer program product.
[0158] The computer program product provided in the embodiments of the present application includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the request scheduling method in any of the above cluster systems can be implemented.
[0159] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.
[0160] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0161] For an introduction to the computer program product provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0162] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0163] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0164] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0165] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples herein, and the description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A request scheduling method in a cluster system, characterized in that: The cluster system includes a main service node and multiple storage nodes, each of the storage nodes is connected to the main service node, and the method is applied to the main service node, including: Within a preset scheduling period, obtaining the number of connection requests of each storage node, and calculating the total number of connection requests of the cluster system; Determining a scheduling threshold within the preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system; Adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool; For a new connection request within the preset scheduling period, a target storage node is selected from the serviceable resource pool, and the new connection request is scheduled to the target storage node.
2. The request scheduling method in a cluster system according to claim 1, characterized in that: The cluster system further includes a domain name server, the primary service node is connected to the domain name server, and the method further includes: The node information and the number of connection requests of each serviceable node in the serviceable resource pool are uploaded to the domain name server, so that the domain name server responds to the domain name mounting request initiated by the client with reference to the node information and the number of connection requests of each serviceable node.
3. The request scheduling method in a cluster system according to claim 1, characterized in that: Also includes: Performing fault detection on each of the storage nodes in the cluster system to determine the faulty storage node; A target serviceable node is selected in the serviceable resource pool, and all connection requests on the failed storage node are scheduled to the target serviceable node.
4. The request scheduling method in a cluster system according to claim 3, characterized in that: Selecting a target serviceable node in the serviceable resource pool and scheduling all connection requests on the failed storage node to the target serviceable node includes: Determining the actual number of requested connections on the failed storage node; For each serviceable node in the serviceable resource pool, calculating a difference between the number of requested connections on the serviceable node and the scheduling threshold; Arranging the serviceable nodes in the serviceable resource pool in descending order of the difference value to obtain a serviceable node sequence; Selecting the first one or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual number of requested connections; Scheduling all the connection requests on the failed storage node to the target serviceable node; Accordingly, for a new connection request within the preset scheduling period, selecting a target storage node in the serviceable resource pool and scheduling the new connection request to the target storage node includes: For the new connection request within the preset scheduling period, selecting a serviceable node with the smallest number of requested connections in the serviceable resource pool as the target storage node; The new connection request is dispatched to the target storage node.
5. The request scheduling method in a cluster system according to claim 3, characterized in that: After performing fault detection on each storage node in the cluster system and determining the faulty storage node, the method further includes: Recording the node information of the faulty storage node to a faulty node list; Performing fault detection on each of the fault storage nodes in the fault node list at a preset time interval to determine a fault recovery node; Add the fault recovery node to the serviceable resource pool.
6. The request scheduling method in a cluster system according to claim 1, characterized in that: Adding storage nodes that meet the scheduling threshold to a serviceable resource pool, and adding storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool, includes: Adding the storage node whose requested connection number is lower than the scheduling threshold to the serviceable resource pool; The storage nodes whose number of requested connections is not less than the scheduling threshold are added to the unserviceable resource pool.
7. The request scheduling method in a cluster system according to claim 6, characterized in that: Also includes: Within the preset scheduling period, counting the number of real-time connection requests of each unserviceable node in the unserviceable resource pool; The unserviceable nodes whose number of real-time connection requests is lower than the scheduling threshold are removed from the unserviceable resource pool and added to the serviceable resource pool.
8. A request scheduling device in a cluster system, characterized in that: The cluster system includes a main service node and a plurality of storage nodes, each of the storage nodes is connected to the main service node, and the device is applied to the main service node, including: An acquisition module, used to acquire the number of connection requests of each storage node within a preset scheduling period, and calculate the total number of connection requests of the cluster system; A determination module, configured to determine a scheduling threshold within the preset scheduling period according to the total number of requested connections and the total number of storage nodes in the cluster system; A setting module, used to add storage nodes that meet the scheduling threshold to a serviceable resource pool, and to add storage nodes that do not meet the scheduling threshold to a non-serviceable resource pool; The scheduling module is used to select a target storage node in the serviceable resource pool for a new connection request within the preset scheduling period, and schedule the new connection request to the target storage node.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the request scheduling method in a cluster system as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the request scheduling method in a cluster system according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Capacity expansion method and device of server cluster and readable medium
CN111225004A
Load balancing detection method and device, equipment and storage medium
CN113504996A
Connection pool management method and device, electronic equipment and computer readable storage medium
CN117724849A
Load balancing method, device, equipment and medium
CN118069354A
Network-based game system capable of serving massive number of game players
US20070184903A1