Request scheduling method and device in cluster system, electronic equipment and storage medium
By setting scheduling thresholds within the scheduling cycle in the distributed storage system, the storage nodes are divided into serviceable and non-serviceable pools, which solves the problem of unsatisfactory load balancing, achieves more balanced request scheduling and system stability, and improves the efficiency of domain name mounting processing.
Patent Information
- Application Number
- CN202411855512.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-16
AI Technical Summary
In the prior art, the load balancing strategy of the distributed storage system is not ideal, which affects the stability of the cluster system. How to schedule client connection requests more evenly and reasonably to ensure system stability?
By obtaining the number of requested connections for each storage node within the preset scheduling period, the total number of requested connections in the cluster system is calculated, and the scheduling threshold is determined based on the total number of nodes. The nodes that meet the threshold are divided into a serviceable resource pool, and the nodes that do not meet the threshold are divided into an unserviceable resource pool, and new connection requests are scheduled.
It achieves balanced and reasonable scheduling of client connection requests, improves the stability of the cluster system, and improves the efficiency of domain name mounting through optimized processing of domain name servers.
Smart Images

Figure CN119629252B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cluster service, in particular to a request scheduling method in a cluster system, and further relates to a request scheduling device in a cluster system, an electronic device and a computer readable storage medium. BACKGROUND
[0002] A distributed storage system adopts a distributed and fully symmetrical architecture, integrates scattered storage resources, provides a unified namespace for users, and enables users to access the system through any node and handle client connection requests. To balance the distribution of client connection requests and ensure business reliability, the storage system proposes various load balancing strategies for users to choose, such as round-robin 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, and mismatched strategies, the effect of load balancing may not be ideal.
[0003] Therefore, how to more evenly and reasonably schedule client connection requests to effectively ensure the stability of the cluster system is a problem to be solved by those skilled in the art. SUMMARY
[0004] The purpose of the present application is to provide a request scheduling method in a cluster system, which can more evenly and reasonably schedule client connection requests to effectively ensure the stability of the cluster system. Another purpose of the present application is to provide a request scheduling device in a cluster system, an electronic device, a computer readable storage medium and a computer program product, 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 master service node and a plurality of storage nodes, each of the storage nodes being connected to the master service node, the method being applied to the master service node and comprising:
[0006] In a preset scheduling period, the number of request connections of each storage node is obtained, and the total number of request connections of the cluster system is calculated;
[0007] According to the total number of request connections and the total number of nodes in the cluster system, a scheduling threshold in the preset scheduling period is determined;
[0008] The storage nodes meeting the scheduling threshold are added to a serviceable resource pool, and the storage nodes not meeting the scheduling threshold are added to a non-serviceable resource pool;
[0009] For a new connection request in 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 comprises a domain name server, the master service node is connected to the domain name server, and the method further comprises:
[0011] Uploading node information and request connection numbers of each serviceable node in the serviceable resource pool to the domain name server, so that the domain name server responds to a domain name mounting request initiated by a client in reference to the node information and connection numbers of each serviceable node.
[0012] Optionally, the request scheduling method in the cluster system further comprises:
[0013] Performing fault detection on each storage node in the cluster system to determine a fault storage node;
[0014] Selecting a target serviceable node from the serviceable resource pool, and scheduling all connection requests on the fault storage node to the target serviceable node.
[0015] Optionally, selecting a target serviceable node from the serviceable resource pool, and scheduling all connection requests on the fault storage node to the target serviceable node comprises:
[0016] Determining an actual request connection number on the fault storage node;
[0017] For each serviceable node in the serviceable resource pool, calculating a difference between a request connection number on the serviceable node and the scheduling threshold;
[0018] Arranging each serviceable node in the serviceable resource pool in descending order of the difference to obtain a serviceable node sequence;
[0019] Selecting a first or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual request connection number;
[0020] Scheduling all the connection requests on the fault storage node to the target serviceable node;
[0021] Correspondingly, for a new connection request in 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, comprising:
[0022] For the new connection request in the preset scheduling period, a serviceable node with the least number of connection requests is selected from the serviceable resource pool as the target storage node;
[0023] The new connection request is scheduled to the target storage node.
[0024] Optionally, after determining the fault storage node, the method further comprises:
[0025] Recording node information of the fault storage node to a fault node list;
[0026] Performing fault detection on each fault storage node in the fault node list at a preset time interval to determine a fault recovery node;
[0027] The fault recovery node is added to the serviceable resource pool.
[0028] Optionally, adding the storage node meeting the scheduling threshold to the serviceable resource pool and adding the storage node not meeting the scheduling threshold to the non-serviceable resource pool comprises:
[0029] The storage node with the number of connection requests lower than the scheduling threshold is added to the serviceable resource pool;
[0030] The storage node with the number of connection requests not lower than the scheduling threshold is added to the non-serviceable resource pool.
[0031] Optionally, the request scheduling method in the cluster system further comprises:
[0032] In the preset scheduling period, the real-time number of connection requests of each non-serviceable node in the non-serviceable resource pool is counted;
[0033] The non-serviceable node with the real-time number of connection requests lower than the scheduling threshold is removed from the non-serviceable resource pool and added to the serviceable resource pool.
[0034] In a second aspect, the application further discloses a request scheduling device in a cluster system, the cluster system comprising a main service node and a plurality of storage nodes, each of the storage nodes being connected to the main service node, the device being applied to the main service node and comprising:
[0035] An obtaining module is configured to obtain the number of connection requests of each of the storage nodes and calculate a total number of connection requests of the cluster system in a preset scheduling period;
[0036] A determining module is configured to determine a scheduling threshold in the preset scheduling period according to the total number of connection requests and a total number of nodes of the storage nodes in the cluster system.
[0037] a setting module, configured to add the storage node satisfying the scheduling threshold to a serviceable resource pool, and add the storage node not satisfying the scheduling threshold to a non-serviceable resource pool;
[0038] a scheduling module, configured to select a target storage node in the serviceable resource pool for a new connection request in the preset scheduling period, and schedule the new connection request to the target storage node.
[0039] In a third aspect, the present application discloses an electronic device, comprising:
[0040] a memory, configured to store a computer program;
[0041] a processor, configured to execute the computer program to implement the steps of the request scheduling method in any one of the cluster systems.
[0042] In a fourth aspect, the present application discloses a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the request scheduling method in any one of the cluster systems.
[0043] In a fifth aspect, the present application discloses a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps of the request scheduling method in any one of the cluster systems.
[0044] The present application provides a request scheduling method in a cluster system, the cluster system comprising a master service node and a plurality of storage nodes, each of the storage nodes being connected to the master service node, the method being applied to the master service node, comprising: obtaining a request connection number of each of the storage nodes in a preset scheduling period, and calculating a total request connection number of the cluster system; determining a scheduling threshold in the preset scheduling period according to the total request connection number and a total number of the storage nodes in the cluster system; adding the storage node satisfying the scheduling threshold to a serviceable resource pool, and adding the storage node not satisfying the scheduling threshold to a non-serviceable resource pool; selecting a target storage node in the serviceable resource pool for a new connection request in the preset scheduling period, and scheduling the new connection request to the target storage node.
[0045] By using the master service node in the cluster system, the request connection number of each storage node in the cluster system is detected according to a scheduling period, so that the total number of request connections of the cluster system in the current scheduling period is obtained, and the scheduling threshold in the current scheduling period is determined in combination with the total number of storage nodes in the cluster system. Therefore, the client connection request received in the current scheduling period can be scheduled according to the scheduling threshold, that is, all the 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 the serviceable nodes to provide services for new client connection requests. As can be seen, the present technical solution can more evenly and reasonably schedule the client connection request, so as to effectively ensure the stability of the cluster system.
[0046] In an embodiment of the present application, the cluster system can further implement domain name mounting processing, and the cluster system further has a domain name server in communication connection with the master service node. The master service node can synchronously upload the node information and the request connection number of each serviceable node in the current scheduling period to the domain name server, so that when the domain name server receives a domain name mounting request initiated by a client, the serviceable node can be selected according to the node information and the request connection number of each serviceable node to respond to the domain name mounting request, without the need to detect and select the serviceable node in the cluster system again, thereby effectively improving the efficiency of the domain name mounting processing.
[0047] The request scheduling device in the cluster system, the electronic equipment, the computer readable storage medium and the computer program product provided by the present application also have the above technical effects, which will not be described herein. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the prior art and the technical solutions in the embodiments of the present application, the drawings used in the description of the prior art and the embodiments of the present application will be briefly introduced. Of course, the drawings described below with respect to the embodiments of the present application are only a part of the embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor, and the obtained drawings also belong to the protection scope of the present application.
[0049] Figure 1 A structural schematic diagram of a cluster system provided by the present application;
[0050] Figure 2 A flowchart of a request scheduling method in a cluster system provided by the present application;
[0051] Figure 3 A structural schematic diagram of a request scheduling device in a cluster system provided by the present application;
[0052] Figure 4 A structural schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION
[0053] The core of the present application is to provide a request scheduling method in a cluster system, which can more evenly and reasonably schedule client connection requests to effectively ensure the stability of the cluster system. Another core of the present application is to provide a request scheduling device in a cluster system, an electronic device, a computer readable storage medium and a computer program product, all of which have the above beneficial effects.
[0054] In order to more clearly and completely describe the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be introduced below in combination with the drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0055] The embodiments of the present application provide a request scheduling method in a cluster system.
[0056] First, please refer to Figure 1 , Figure 1 A structural schematic diagram of a cluster system provided by the present application, the cluster system includes a master service node and a plurality of storage nodes, and each storage node is connected to the master service node, and the request scheduling method provided by the embodiments of the present application is realized based on the cluster system.
[0057] Further, please refer to Figure 2 , Figure 2 A flowchart of a request scheduling method in a cluster system provided by the present application, the request scheduling method in the cluster system is applied to Figure 1 The master service node can include the following S101 to S104.
[0058] S101: In a preset scheduling period, the number of request connections of each storage node is obtained, and the total number of request connections of the cluster system is calculated.
[0059] The step is designed to realize the statistics of the number of request connections on each storage node in the cluster system and the total number of request connections in the cluster system. It should be noted that the request scheduling method provided in the embodiments of the present application can be executed according to a scheduling period, and S101-S104 is executed once in each scheduling period to effectively ensure the balance of request scheduling. Of course, the specific duration of the scheduling period does not affect the implementation of the technical solution, for example, it can be one day or one week. Specifically, when a scheduling period starts, the number of request connections on each storage node in the cluster system can be obtained in sequence, and the total number of request connections in the cluster system can be obtained by summation.
[0060] S102: determining a scheduling threshold in a preset scheduling period according to the total number of request connections and the total number of storage nodes in the cluster system.
[0061] The step is designed to realize the calculation of the scheduling threshold in the current scheduling period. In the specific implementation process, the quotient value between the total number of request connections in the storage system and the total number of storage nodes can be directly taken as the scheduling threshold in the current scheduling period. Of course, the determination method of the scheduling threshold is not unique, for example, when the service capabilities of the storage nodes are different, a weight calculation based on the actual service capabilities of the storage nodes can also be added to obtain the scheduling threshold in the current scheduling period, so as to further improve the accuracy of the request scheduling result.
[0062] S103: adding the storage nodes meeting the scheduling threshold to the serviceable resource pool, and adding the storage nodes not meeting the scheduling threshold to the non-serviceable resource pool.
[0063] The step is designed to realize the division of the storage nodes based on the scheduling threshold, that is, adding the storage nodes meeting the scheduling threshold to the serviceable resource pool, and adding the storage nodes not meeting the scheduling threshold to the non-serviceable resource pool. It can be understood that the storage nodes in the serviceable resource pool are all serviceable nodes (i.e., can provide connection request services) in the current scheduling period, and the storage nodes in the non-serviceable resource pool are all non-serviceable nodes (i.e., cannot provide connection request services) in the current scheduling period.
[0064] In an embodiment of the present application, adding the storage nodes meeting the scheduling threshold to the serviceable resource pool and adding the storage nodes not meeting the scheduling threshold to the non-serviceable resource pool can include:
[0065] adding the storage nodes with the number of request connections lower than the scheduling threshold to the serviceable resource pool;
[0066] adding the storage nodes with the number of request connections not lower than the scheduling threshold to the non-serviceable resource pool.
[0067] Therefore, the embodiment of the present application provides a storage node division method based on a scheduling threshold, that is, a storage node with a request connection number lower than the scheduling threshold is added into the serviceable resource pool as a serviceable node, and a storage node with a request connection number not lower than the scheduling threshold is added into the non-serviceable resource pool as a non-serviceable node.
[0068] S104: For a new connection request in 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.
[0069] This step is aimed at realizing reasonable scheduling of a new client connection request. Specifically, when a new connection request initiated by any client is received in the present scheduling period, an optimal serviceable node in the serviceable resource pool can be directly selected as a target storage node to provide service for the new connection request, that is, the new connection request is scheduled to the target storage node for processing. Further, a serviceable node with the least request connection number can be directly selected as the target storage node to process the new connection request.
[0070] In an embodiment of the present application, the request scheduling method in the cluster system can further include:
[0071] In a preset scheduling period, real-time connection request numbers of the non-serviceable nodes in the non-serviceable resource pool are counted.
[0072] The non-serviceable node with a real-time connection request number lower than the scheduling threshold is removed from the non-serviceable resource pool and added into the serviceable resource pool.
[0073] The request scheduling method in the cluster system provided by the embodiment of the present application can further realize dynamic adjustment of the storage nodes in the cluster system. Specifically, for each non-serviceable node in the non-serviceable resource pool, a real-time connection request number thereof can be counted in the present scheduling period, and once the real-time connection request number is lower than the scheduling threshold, the corresponding non-serviceable node can be directly removed from the non-serviceable resource pool and added into the serviceable resource pool to continue to provide service for the client connection request.
[0074] It can be seen that the request scheduling method in the cluster system provided by the embodiment of the present application utilizes the master service node in the cluster system to detect the request connection number of each storage node in the cluster system according to a scheduling period, so as to obtain the total request connection number of the cluster system in the current scheduling period, thereby the scheduling threshold in the current scheduling period can be determined in combination with the total number of storage nodes in the cluster system. Thus, the client connection request received in the current scheduling period can be scheduled in reference to the scheduling threshold, that is, all the 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 the serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can more evenly and reasonably schedule the client connection requests, so as to effectively ensure the stability of the cluster system.
[0075] On the basis of the above embodiment:
[0076] In an embodiment of the present application, the cluster system can further include a domain name server, the master service node is connected with the domain name server, and the request scheduling method in the cluster system can further include: uploading the node information and the request connection number 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 in reference to the node information and the connection number of each serviceable node.
[0077] The request scheduling method in the cluster system provided by the embodiment of the present application can further implement the domain name mounting processing function. Specifically, the current cluster system can also be deployed with a domain name server (DNS server), which can be in communication connection with the master service node. Thus, in each scheduling period, the master service node can upload the node information and the request connection number of each serviceable node in the serviceable resource pool collected by itself to the domain name server. Thus, when the domain name server receives the domain name mounting request initiated by the client in the current scheduling period, it can select a mountable node from all the serviceable nodes in reference to the above information of the master service node to respond to the domain name mounting request, and implement the domain name mounting processing.
[0078] In the specific implementation process, the domain name server can directly select the serviceable node with the least request connection number as the mountable node, and feed back the node information of the mountable node to the client corresponding to the domain name mounting request, so that the client and the mountable node can interact with each other, and implement the domain name mounting processing. In a possible implementation manner, the above node information can be node IP information.
[0079] Therefore, in the embodiment of the present application, the cluster system can further implement domain name mounting processing, and the master service node can synchronously upload the node information and the request connection number of each serviceable node in the current scheduling period to the domain name server, so that when the domain name server receives a domain name mounting request initiated by a client, the domain name server can directly refer to the node information and the request connection number of each serviceable node to select a mountable node to respond to the domain name mounting request, without the need to detect and select the mountable node in the cluster system again, thereby effectively improving the domain name mounting processing efficiency.
[0080] In an embodiment of the present application, the request scheduling method in the cluster system can further include:
[0081] detecting the fault of each storage node in the cluster system to determine a fault storage node;
[0082] selecting a target serviceable node in the serviceable resource pool and scheduling all connection requests on the fault storage node to the target serviceable node.
[0083] The request scheduling method in the cluster system provided by the embodiment of the present application can further implement the fault node of each storage node in the cluster system. Specifically, the master service node can periodically detect the fault of each storage node in the cluster system to determine whether there is a fault storage node in the cluster system; further, when it is determined that there is a fault storage node in the cluster system, a target serviceable node can be directly selected in the serviceable resource pool to undertake all connection requests on the fault storage node. It can be understood that the number of target serviceable nodes can be one or multiple, as long as all connection requests on the fault storage node can be undertaken, which is not limited in the present application.
[0084] In the embodiment of the present application, the request scheduling method in the cluster system can further include:
[0085] sending a heartbeat signal to each storage node in the cluster system to determine whether a heartbeat response signal fed back by the storage node is received within a preset time length;
[0086] when the heartbeat response signal fed back by the storage node is received within the preset time length, determining that the storage node is a normal storage node;
[0087] when the heartbeat response signal fed back by the storage node is not received within the preset time length, determining that the storage node is a fault storage node.
[0088] The embodiment of the present application provides a fault detection method of a storage node, which can be realized through a heartbeat monitoring mechanism. Specifically, a main service node can periodically send a heartbeat signal to each storage node in a cluster system to determine whether a 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, the storage node can be determined as a normal storage node; otherwise, if the heartbeat response signal fed back by the storage node cannot be received within the preset time length, the storage node can be determined as a fault storage node, thereby realizing the fault detection of the storage node. It should be noted that the specific value of the preset time length does not affect the implementation of the technical solution, which can be set by the technician according to the actual situation, and the embodiment of the present application does not limit this. In a possible implementation manner, the preset time length can be 30 seconds.
[0089] Wherein, selecting a target serviceable node in the serviceable resource pool and scheduling all connection requests on the fault storage node to the target serviceable node can include:
[0090] Determining the actual request connection number on the fault storage node;
[0091] For each serviceable node in the serviceable resource pool, calculating the difference between the request connection number on the serviceable node and the scheduling threshold;
[0092] Arranging each serviceable node in the serviceable resource pool in descending order of the difference value to obtain a serviceable node sequence;
[0093] Selecting the first one or more serviceable nodes in the serviceable node sequence as the target serviceable node according to the actual request connection number;
[0094] Scheduling all connection requests on the fault storage node to the target serviceable node;
[0095] Correspondingly, for a new connection request in 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 can include:
[0096] For a new connection request in a preset scheduling period, selecting a serviceable node with the minimum request connection number in the serviceable resource pool as the target storage node;
[0097] Scheduling the new connection request to the target storage node.
[0098] The embodiment of the present application provides an implementation method for scheduling connection requests on a fault storage node. Specifically, for each serviceable node in the serviceable resource pool, the difference between the number of connection requests on the serviceable node and the scheduling threshold can be calculated, and all the serviceable nodes in the serviceable resource pool can be arranged in descending order of the difference value to obtain a serviceable node sequence. Thus, the actual number of connection requests on the fault storage node can be referred to for screening of a target serviceable node in the serviceable node sequence, and all the connection requests on the fault storage node can be scheduled to the target serviceable node for processing. More specifically, the sum of the difference values corresponding to the selected target serviceable nodes should be greater than or equal to the actual number of connection requests on the fault storage node, so as to effectively ensure that each connection request on the fault storage node can be scheduled to a serviceable node for processing.
[0099] Further, after detecting the fault of each storage node in the cluster system and determining the fault storage node, the method can further include:
[0100] Recording the node information of the fault storage node to a fault node list;
[0101] Detecting the fault of each fault storage node in the fault node list according to a preset time interval to determine a fault recovery node;
[0102] Adding the fault recovery 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 recovery of the fault node. Specifically, for the fault storage node in the cluster system, the node information thereof can be recorded in the form of a list, and the master service node can periodically detect the fault of each fault storage node in the fault node list to determine whether each fault storage node is recovered to normal, and add the recovered storage node (i.e., the fault recovery node) to the serviceable resource pool again to realize dynamic adjustment of the serviceable nodes in the serviceable resource pool. Further, the connection requests previously scheduled to other serviceable nodes can be migrated back to the fault recovery node for continuous service. Similarly, the specific value of the preset time interval does not affect the implementation of the technical solution, and can be set by the technician according to the actual situation, and the embodiment of the present application does not limit this. In a possible implementation manner, the preset time interval can be 1 hour.
[0104] On the basis of 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 by the embodiment of the present application is as follows:
[0106] 1. On the master service node of the distributed storage system, set a timer to collect the request connection numbers of each storage node in the storage system, and perform summation to obtain the total request connection number 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 load balancing, determine the threshold value of the request connection number of each storage node as N / M (scheduling threshold value).
[0108] 3. The master service node can match and check the real-time request connection number K of each storage node. When K≥N / M, delete the IP address of the storage node from the serviceable resource pool, and the deleted storage node forms the non-serviceable resource pool.
[0109] 4. The master service node queries the IP address and request connection number K of each storage node in the non-serviceable resource pool one by one. When K<N / M, determine whether the IP address is in the serviceable resource pool, and if not, re-add the IP address to the serviceable resource pool.
[0110] 5. When a client initiates a new connection request, the master service node can select a serviceable storage node from the serviceable resource pool according to the set balancing strategy to serve the client.
[0111] 6. When a single node fault occurs in the distributed storage system due to abnormal conditions, the service on the fault storage node can be migrated to one or more storage nodes in the serviceable resource pool, at which time the service pressure on the storage node will double. Further, the storage node can be directly added to the non-serviceable resource pool.
[0112] 7. After the fault is recovered, the previously migrated service can be re-migrated to the recovered storage node, at which time the recovered node and the storage node that previously undertook the migrated service can be re-added to the serviceable resource pool.
[0113] 8. The DNS server is also deployed in the distributed storage system, and the serviceable resource pool can be synchronously established on the DNS server. The master service node can report the related information of the serviceable resource pool detected by itself to the DNS server.
[0114] 9. When a business client initiates a domain name mounting request, the DNS server can directly obtain the IP address with the lowest request connection number from the serviceable resource pool thereon, and respond to the business client for mounting.
[0115] 10. When the DNS server finds that a large number of mounting requests have been received in a short period of time, it can directly obtain IP information from the serviceable resource pool by polling and respond to the business client.
[0116] It can be seen that the request scheduling method in the cluster system provided by the embodiment of the application utilizes the master service node in the cluster system to detect the request connection number of each storage node in the cluster system according to a scheduling period, so as to obtain the total request connection number of the cluster system in the current scheduling period, so that the scheduling threshold in the current scheduling period can be determined in combination with the total number of storage nodes in the cluster system. Thus, the client connection request received in the current scheduling period can be scheduled in reference to the scheduling threshold, that is, all the 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 the serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can more evenly and reasonably schedule the client connection requests, so as to effectively ensure the stability of the cluster system.
[0117] The embodiment of the application provides a request scheduling device in a cluster system.
[0118] Please refer to Figure 3 , Figure 3 Fig. 1 is a structural schematic diagram of a request scheduling device provided by the application. The cluster system includes a master service node and a plurality of storage nodes, each storage node is connected to the master service node, and the device is applied to the master service node and can include:
[0119] The acquisition module 1 is configured to acquire the request connection number of each storage node and calculate the total request connection number of the cluster system in a preset scheduling period.
[0120] The determination module 2 is configured to determine the scheduling threshold in the preset scheduling period according to the total request connection number and the total number of nodes of the storage nodes in the cluster system.
[0121] The setting module 3 is configured to add the storage nodes meeting the scheduling threshold to a serviceable resource pool and add the storage nodes not meeting the scheduling threshold to a non-serviceable resource pool.
[0122] The scheduling module 4 is configured to select a target storage node in the serviceable resource pool for a new connection request in the 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 application utilizes the master service node in the cluster system to detect the request connection numbers of each storage node in the cluster system according to a scheduling period, so as to obtain the total request connection number of the cluster system in the current scheduling period, and thus the scheduling threshold in the current scheduling period can be determined in combination with the total number of storage nodes in the cluster system. In this way, the client connection requests received in the current scheduling period can be scheduled in reference to the scheduling threshold, that is, all the 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 the serviceable nodes to provide services for new client connection requests. It can be seen that the technical solution can more evenly and reasonably schedule the client connection requests, so as to effectively ensure the stability of the cluster system.
[0124] In an embodiment of the application, the cluster system can further include a domain name server, the master service node is connected with the domain name server, and the request scheduling device can further include:
[0125] a domain name request processing module configured to upload the node information and the request connection numbers of the serviceable nodes 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 in reference to the node information and the connection numbers of the serviceable nodes.
[0126] In an embodiment of the application, the request scheduling device in the cluster system can further include:
[0127] a detection module configured to detect each storage node in the cluster system to determine a fault storage node;
[0128] a migration module configured to select a target serviceable node in the serviceable resource pool and schedule all the connection requests on the fault storage node to the target serviceable node.
[0129] In an embodiment of the application, the migration module can be specifically configured to determine the actual request connection number on the fault storage node; for each serviceable node in the serviceable resource pool, calculate the difference between the request connection number 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 request connection number; and schedule all the connection requests on the fault storage node to the target serviceable node.
[0130] Correspondingly, the scheduling module 4 can be specifically configured to select the serviceable node with the smallest request connection number in the serviceable resource pool as the target storage node for the new connection request in the preset scheduling period; and schedule the new connection request to the target storage node.
[0131] In an embodiment of the present application, the request scheduling device in the cluster system can further comprise:
[0132] The recovery module is configured to record the node information of the failed storage node to a failed node list after the failure detection of each storage node in the cluster system and the determination of the failed storage node; perform the failure detection on each failed storage node in the failed node list according to a preset time interval to determine a failure recovery node; and add the failure recovery node to the serviceable resource pool.
[0133] In an embodiment of the present application, the setting module 3 can be specifically configured to add the storage node with the request connection number lower than the scheduling threshold to the serviceable resource pool; and add the storage node with the request connection number not lower than the scheduling threshold to the non-serviceable resource pool.
[0134] In an embodiment of the present application, the request scheduling device in the cluster system can further comprise:
[0135] The monitoring module is configured to count the real-time connection request number of each non-serviceable node in the non-serviceable resource pool within a preset scheduling period; eliminate the non-serviceable node with the real-time connection request number lower than the scheduling threshold from the non-serviceable resource pool and add the non-serviceable node to the serviceable resource pool.
[0136] For the device provided in the embodiments of the present application, refer to the above-mentioned method embodiments, which will not be repeated here.
[0137] An electronic device is provided in the embodiments of the present application.
[0138] Please refer to Figure 4 , Figure 4 The electronic device provided in the present application can comprise:
[0139] The memory 11 is configured to store a computer program.
[0140] The processor 10 is configured to implement the steps of the request scheduling method in any one of the cluster systems when executing the computer program.
[0141] As shown in Figure 4 , the electronic device can comprise 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 can complete the communication among each other through the communication bus 13.
[0142] In the embodiments of the present application, the processor 10 can be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device.
[0143] The processor 10 can invoke a program stored in the memory 11, and specifically, the processor 10 can perform the operations in the embodiments of the request scheduling method in the cluster system.
[0144] The memory 11 stores one or more programs, which can include program codes including computer operation instructions. In the embodiments of the present application, the memory 11 at least stores programs for implementing the following functions:
[0145] In a preset scheduling period, the number of request connections of each storage node is obtained, and the total number of request connections of the cluster system is calculated;
[0146] The scheduling threshold in the preset scheduling period is determined according to the total number of request connections and the total number of storage nodes in the cluster system;
[0147] The storage nodes meeting the scheduling threshold are added to the serviceable resource pool, and the storage nodes not meeting the scheduling threshold are added to the non-serviceable resource pool;
[0148] For a new connection request in the preset scheduling period, a target storage node is selected in the serviceable resource pool, and the new connection request is scheduled to the target storage node.
[0149] In a possible implementation, the memory 11 can include a program storage area and a data storage area. The program storage area can store an operating system and at least one application program required by a function, etc. The data storage area can store data created in the use process.
[0150] In addition, the memory 11 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device or other volatile solid-state storage device.
[0151] The communication interface 12 can be an interface of a communication module, used for connecting with other devices or systems.
[0152] Of course, it needs to be explained that, Figure 4 The structures shown do not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device can include more or fewer components than Figure 4 those shown, or combine certain components.
[0153] The embodiments of the present application provide 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, computer-readable storage media can be any available medium that can be stored by a computer or a data storage device such as a server or data center that integrates one or more available media. For example, it can be magnetic media (such as floppy disks, hard disks, tapes, etc.), optical media (such as DVDs) or semiconductor media (such as solid-state drives) 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 this 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 any of the above-mentioned request scheduling methods in the cluster system can be implemented.
[0159] Specifically, in each of the above embodiments, all or part of the embodiments may be implemented through software, hardware, firmware, or any combination thereof. When implemented through software, all or part of the embodiments may 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, which, when loaded and executed on a computer, may generate, in whole or in part, the processes or functions described in the embodiments of the present application. 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, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) method.
[0161] For an introduction to the computer program product provided in the embodiments of the present application, please refer to the above method embodiments, which will not be elaborated in this application.
[0162] The various embodiments described in the specification are intended to be exemplary only. The same are presented in order to more completely explain the present application and its preferred embodiments. It should be understood that various modifications can be made to the embodiments described in specific examples without departing from the scope of the present application. Accordingly, the detailed description is not intended as an indication that the present application is limited to several preferred embodiments. Rather, the detailed description is intended to illustrate a number of embodiments described herein. The same are presented as examples of the present application. Other embodiments can be developed and fall within the scope of the present application. Accordingly, the scope of the present application is limited by the claims.
[0163] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, various components have been described above generally in terms of their functionality, without reference to the specific manner in which such functionality is achieved. Such skilled persons will appreciate that the respective steps illustrated in the various examples could be achieved with any one of a number of algorithms, which have been developed and used to achieve the described functionality, and that the respective steps could be implemented in either hardware or software, depending on the particular application and design constraints. Skilled persons can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted to cause a departure from the scope of the present application.
[0164] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0165] The above provides a detailed description of the technical solutions of the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the examples is only to help understand the method of the present application and its core idea. It should be noted that for those skilled in the art, without departing from the principles of the present application, some 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 primary service node and multiple storage nodes, each of the storage nodes is connected to the primary service node, and the method is applied to the primary 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 an unserviceable resource pool; 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; 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, including: adding the storage nodes whose requested connection number is lower than the scheduling threshold to the serviceable resource pool; adding the storage nodes whose requested connection number is not lower than the scheduling threshold to the unserviceable resource pool.
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 mount 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 faulty storage node are dispatched 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 dispatching all connection requests on the faulty 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; Dispatching 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 from 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: 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.
7. A request scheduling device in a cluster system, characterized in that: The cluster system includes a primary service node and multiple 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: An acquisition module, configured 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, configured 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; a scheduling module, configured 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; The setting module is specifically configured to add the storage node whose number of requested connections is lower than the scheduling threshold to the serviceable resource pool; and add the storage node whose number of requested connections is not lower than the scheduling threshold to the unserviceable resource pool.
8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is configured to implement the steps of the request scheduling method in a cluster system according to any one of claims 1 to 6 when executing the computer program.
9. 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 6 are implemented.
Citation Information
Patent Citations
Network-based game system capable of serving massive number of game players
US20070184903A1
Management of overload condition for 5g or other next generation wireless network
US20210045007A1