Application scheduling method and device
By obtaining the decentralized scheduling levels and paths of data center nodes, candidate nodes are screened to improve application scheduling efficiency, solving the problem of low node evaluation efficiency in the prior art, and achieving more efficient application scheduling.
Patent Information
- Application Number
- CN202011098217.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-10-14
AI Technical Summary
When existing data centers apply scheduling, node evaluation efficiency is low, resulting in low scheduling efficiency.
By obtaining the decentralized scheduling level and node path of the application to be scheduled, selecting the decentralized scheduling path that can receive the application to be scheduled, filtering the candidate nodes, and determining the node that receives the application to be scheduled among the candidate nodes.
It improves the efficiency of applying decentralized scheduling, reduces the number of candidate nodes, and improves scheduling efficiency.
Smart Images

Figure CN112148461B_ABST
Abstract
Description
Background Art
[0002] With the booming development of cloud computing, distributed storage and other technologies, various data centers have become a hot research direction in the field of Internet communication technology due to their low cost, high efficiency and lightweight testing. Common data centers are topological network architectures, in which topological domains are set up level by level, and nodes are set up in the bottom-level topological domain, which are used to carry the operation of applications.
[0003] In existing solutions, when scheduling applications to nodes, each node is usually evaluated one by one to select the most appropriate node to schedule the application, which results in low efficiency in scheduling applications. Summary of the invention
[0004] The present application aims to provide an application scheduling method and device, which can at least improve the efficiency of application replica scheduling to a certain extent.
[0005] According to one aspect of an embodiment of the present application, a scheduling method for an application is provided, comprising: obtaining a decentralized scheduling level of the application to be scheduled, and obtaining a node path of the node to be scheduled; based on the decentralized scheduling level, selecting a decentralized scheduling path of the application to be scheduled from the node path; if the decentralized scheduling path can receive the application to be scheduled, using the node to be scheduled as a candidate node that can receive the application to be scheduled; and determining a node that receives the application to be scheduled from the candidate nodes.
[0006] According to one aspect of an embodiment of the present application, a scheduling device for an application is provided, comprising: an acquisition module, configured to acquire a decentralized scheduling level of an application to be scheduled, and acquire a node path of a node to be scheduled; a selection module, configured to select a decentralized scheduling path of the application to be scheduled from the node path based on the decentralized scheduling level; a judgment module, configured to use the node to be scheduled as a candidate node capable of receiving the application to be scheduled if the decentralized scheduling path can receive the node to be scheduled; and a determination module, configured to determine a node that receives the application to be scheduled from among the candidate nodes.
[0007] In some embodiments of the present application, based on the aforementioned scheme, the selection module is configured to: use the topological domain at the decentralized scheduling level in the node path as the decentralized scheduling topological domain; and select the path from the highest-level topological domain in the node path to the decentralized scheduling topological domain as the decentralized scheduling path.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the judgment module is configured as follows: if the decentralized scheduling path is capable of receiving the application to be scheduled, before taking the node to be scheduled as a candidate node, obtain the number of applications in the decentralized scheduling path that have a correlation with the application to be scheduled as a first number; in other topological domains in the topological network except the topological domain in the node path, obtain the topological domain at the decentralized scheduling level as a comparison topological domain; obtain the number of applications in each of the comparison topological domains that have a correlation with the application to be scheduled as a second number; based on the first number and the second number, determine whether the decentralized scheduling path is capable of receiving the node to be scheduled.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the judgment module is configured to: obtain the minimum value of the first number and the second number; and dispatch a related application having a correlation with the application to be scheduled to the distributed scheduling path. If the difference between the first number of the distributed scheduling path and the minimum value after distributed scheduling is equal to one, the distributed scheduling path can receive the node to be scheduled; if the difference between the first number of the distributed scheduling path and the minimum value after distributed scheduling is greater than one, the distributed scheduling path cannot receive the node to be scheduled.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the judgment module is configured to: obtain the application tag of the application to be scheduled; search for an application with the same application tag as the application to be scheduled in the distributed scheduling path; and count the number of applications with the same application tag as the application to be scheduled in the distributed scheduling path as the first number.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the judgment module is configured to: obtain the applications in each node of the distributed scheduling path; among the applications in each node of the distributed scheduling path, search for the application in the distributed scheduling path that has the same application label as the application to be scheduled.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the judgment module is configured to: obtain the application label of the application to be scheduled; obtain the applications in each of the comparison topology domains that have the same application label as the application to be scheduled; and count the number of applications in each of the comparison topology domains that have the same application label as the application to be scheduled as the second number.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the acquisition module is configured to: obtain the node label of the node to be scheduled, and obtain the topological domain identifier to which the node to be scheduled belongs at each level of the topological network from the node label; determine the node path based on the topological domain identifier to which the node to be scheduled belongs at each level of the topological network.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the determination module is configured to: obtain node information of the candidate node; calculate the score of the candidate node based on the node information; and determine the node that receives the application to be scheduled among the candidate nodes based on the score.
[0015] According to one aspect of an embodiment of the present application, a computer-readable program medium is provided, which stores computer program instructions. When the computer program instructions are executed by a computer, the computer executes any of the above methods.
[0016] According to one aspect of an embodiment of the present application, an electronic device is provided, including: a processor; a memory, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the method described in any one of the above items is implemented.
[0017] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0018] In the technical solutions provided in some embodiments of the present application, by obtaining the decentralized scheduling level of the application to be scheduled and the node path of the node to be scheduled, based on the decentralized scheduling level, the decentralized scheduling path of the application to be scheduled is selected in the node path, if the decentralized scheduling path can receive the application to be scheduled, the node to be scheduled is used as a candidate node that can receive the application to be scheduled, and the node to be scheduled is screened through the decentralized scheduling path in the node path to obtain the candidate node, the candidate node is the node after screening, the number of candidate nodes may be less than the number of nodes to be scheduled, and the node that receives the application to be scheduled is determined among the candidate nodes, which can improve the efficiency of decentralized scheduling of the application to a certain extent.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.
[0021] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0022] Figure 2 A flowchart of a scheduling method for an application according to an embodiment of the present application is schematically shown;
[0023] Figure 3 A schematic diagram of a topology diagram of an embodiment of the present application is schematically shown;
[0024] Figure 4 A schematic diagram of a topology diagram of an embodiment of the present application is schematically shown;
[0025] Figure 5 A block diagram schematically shows a scheduling device for an application according to an embodiment of the present application;
[0026] Figure 6 The figure is a hardware diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0028] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0031] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0032] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0033] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0034] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0035] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0036] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0037] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume in a dispersed manner. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, IDentity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0038] The process of the storage system distributing and scheduling physical storage space for logical volumes is as follows: according to the estimated capacity of the objects stored in the logical volumes (this estimate often has a large margin relative to the capacity of the actual objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. One logical volume can be understood as a stripe, thereby distributing the physical storage space for the logical volumes.
[0039] Kubernetes clusters usually contain multiple nodes, and these nodes may even span racks, switches, and availability zones, forming multi-level topological domains. In a Kubernetes cluster (or a PaaS platform based on Kubernetes), you can tell Kubernetes how to deploy the application by submitting deployment description files such as Depoloyment and StatefulSet. The deployment description files can control the number of replicas and add some constraints that affect the scheduler's scheduling: node selection, node affinity, anti-affinity between replicas, topology label distributed scheduling, etc. Some of these applications must have multiple replicas and require distributed scheduling in different topological domains to tolerate the availability of the application after a single topological domain fails and to meet the high availability requirements of the application.
[0040] However, the specified node selection, node affinity, and anti-affinity methods between replicas cannot meet the requirements of decentralized scheduling of applications at specified topological levels. To specify node selection and node affinity, users need to plan which nodes can schedule replicas of the application, and need to add custom application-related labels. If there are too many, it will be very confusing, and application replicas can only be scheduled on these nodes, which lacks flexibility and tends to place multiple copies of the application on certain specified nodes instead of decentralized scheduling; anti-affinity between replicas, strong anti-affinity will cause the number of topological domains to be less than the number of replicas, and the extra replicas cannot be scheduled. Weak anti-affinity lacks controllability, and the final scheduling result may not meet the principle of balanced decentralized scheduling of all topological domains; the native topological label decentralized scheduling method only regards the identifier of each node or topological domain as a separate label, without the concept of topological path, and requires that nodes in different physical topological domains of the specified decentralized scheduling level be marked with different label values, otherwise they will be counted as the same domain, and users need to have an accurate understanding of the setting of this constraint, which is cumbersome to configure.
[0041] Figure 1 A schematic diagram of an exemplary system architecture 100 to which the technical solution of the embodiments of the present application can be applied is shown.
[0042] like Figure 1 As shown, the system architecture 100 may include a terminal device 101 (the terminal device may be one or more of a smart phone, a tablet computer, a portable computer, and a desktop computer), a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as a wired communication link, a wireless communication link, and the like.
[0043] In one embodiment of the present application, the server 103 obtains the decentralized scheduling level of the application to be scheduled and the node path of the node to be scheduled, and selects the decentralized scheduling path of the application to be scheduled in the node path based on the decentralized scheduling level. If the decentralized scheduling path can receive the application to be scheduled, the node to be scheduled is used as a candidate node that can receive the application to be scheduled. The nodes to be scheduled are screened through the decentralized scheduling path in the node path to obtain candidate nodes. The candidate nodes are screened nodes, and the number of candidate nodes may be less than the number of nodes to be scheduled. Determining the node that receives the application to be scheduled from the candidate nodes can improve the efficiency of decentralized scheduling of the application to a certain extent.
[0044] It should be understood that Figure 1The number of terminal devices 101, networks 102, and servers 103 is only illustrative. Depending on the implementation needs, there can be any number of terminal devices 101, networks 102, and servers 103. For example, server 103 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0045] It should be noted that the scheduling method for applications provided in the embodiments of the present application is generally executed by the server 103, and accordingly, the scheduling device for applications is generally provided in the server 103. However, in other embodiments of the present application, the terminal device 101 may also have similar functions to the server 103, thereby executing the scheduling method for applications provided in the embodiments of the present application.
[0046] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0047] Figure 2 The flowchart of the scheduling method of an application according to an embodiment of the present application is schematically shown. The execution subject of the scheduling method of the application may be a server, for example, Figure 1 Server 103 shown in .
[0048] Reference Figure 2 As shown, the scheduling method of the application includes at least steps S210 to S240, which are described in detail as follows:
[0049] In step S210, the decentralized scheduling level of the application to be scheduled is obtained, and the node path of the node to be scheduled is obtained.
[0050] In one embodiment of the present application, application information can be set for the application to be scheduled, and the application information can include annotations with a specified topology level decentralized scheduling, application tags, etc., wherein the application tags are used to distinguish different applications. The application tags of multiple copies of the same application can be the same.
[0051] In one embodiment of the present application, the decentralized scheduling level may be extracted from the annotation of the decentralized scheduling of the specified topology level of the application to be scheduled, and there may be multiple decentralized scheduling levels.
[0052] In one embodiment of the present application, there may be multiple nodes to be scheduled, and the node path of each node to be scheduled may be obtained respectively, and a node path is executed for each node to be scheduled. Figure 2 Steps shown.
[0053] In one embodiment of the present application, the node label of the node to be scheduled can be obtained, and the topological domain identifier to which the node to be scheduled belongs at each level of the topological network can be obtained from the node label; based on the topological domain identifier to which the node to be scheduled belongs at each level of the topological network, the node path can be determined.
[0054] In one embodiment of the present application, the node path of each node in the topological network may be obtained first, and the node path of each node may be used as the node label of each node to form a node label list. The node label of the node to be scheduled may be obtained by searching in the node label list.
[0055] In one embodiment of the present application, in two adjacent levels of a topological network, in multiple next-level topological domains located in the same upper-level topological domain, the topological domain identifiers of the multiple next-level topological domains are different; in multiple next-level topological domains located in different upper-level topological domains, the topological domain identifiers of the multiple next-level topological domains can be the same. Since the node label contains the topological domain identifiers of each level, as long as one of the topological domain identifiers of each level is different, the node label is different, which makes it more convenient to set the topological domain identifier.
[0056] In one embodiment of the present application, a topological domain label may be set for a topological domain based on the topological domain identifiers of each level passed through to reach the topological domain, so that topological domains with the same topological domain identifier may be distinguished according to the topological domain label.
[0057] Continue to refer to Figure 2 In step S220, based on the decentralized scheduling level, a decentralized scheduling path of the application to be scheduled is selected from the node path.
[0058] In one embodiment of the present application, a topological domain at a decentralized scheduling level in a node path may be used as a decentralized scheduling topological domain; and a path from the highest-level topological domain in the node path to the decentralized scheduling topological domain may be selected as a decentralized scheduling path.
[0059] In step S230, if the decentralized scheduling path can receive the application to be scheduled, the node to be scheduled is taken as a candidate node that can receive the application to be scheduled.
[0060] In one embodiment of the present application, it is possible to determine whether a decentralized scheduling path can receive an application to be scheduled, and the number of applications that are related to the application to be scheduled in the decentralized scheduling path can be obtained as a first number; in other topological domains in the topological network except the topological domain in the node path, a topological domain at a decentralized scheduling level is obtained as a comparative topological domain; the number of applications that are related to the application to be scheduled in each comparative topological domain is obtained as a second number; based on the first number and the second number, it is determined whether the decentralized scheduling path can receive the node to be scheduled. By considering the number of applications that are related to the application to be scheduled in all topological domains at the decentralized scheduling level to determine whether the decentralized scheduling path can receive the application to be scheduled, the decentralized scheduling of the application can be made more reasonable.
[0061] In one embodiment of the present application, there may be multiple comparison topology domains, and accordingly, there may also be multiple second quantities, and the minimum value of the multiple second quantities is obtained. If the first number is less than or equal to the minimum value of the multiple second quantities, the decentralized scheduling path can receive the application to be scheduled, so that the application to be scheduled can be decentralized and scheduled to the path containing the least number of applications related to the application to be scheduled; if the first number is greater than the minimum value of the multiple second quantities, the decentralized scheduling path cannot receive the application to be scheduled.
[0062] In one embodiment of the present application, the minimum value of the first quantity and the second quantity can be obtained; a related application having a correlation with the application to be scheduled is distributed and scheduled in the distributed scheduling path; if the difference between the first quantity and the minimum value of the distributed scheduling path after the distributed scheduling is equal to one, the distributed scheduling path can receive the node to be scheduled; if the difference between the first quantity and the minimum value of the distributed scheduling path after the distributed scheduling is greater than one, the distributed scheduling path cannot receive the node to be scheduled, and the application in the distributed scheduling path after the distributed scheduling can only be at most one greater than the minimum value, which can make the distributed scheduling of the application more reasonable.
[0063] In one embodiment of the present application, an application tag of the application to be scheduled may be obtained, an application having the same application tag as the application to be scheduled in the decentralized scheduling path may be searched, and the number of applications having the same application tag as the application to be scheduled in the decentralized scheduling path may be counted as the first number.
[0064] In one embodiment of the present application, applications in each node of the decentralized scheduling path may be obtained, and among the applications in each node of the decentralized scheduling path, applications in the decentralized scheduling path having the same application label as the application to be scheduled are searched.
[0065] In one embodiment of the present application, the application label of the application to be scheduled can be obtained, the applications with the same application label as the application to be scheduled in each comparison topology domain can be obtained, and the number of applications with the same application label as the application to be scheduled in each comparison topology domain can be counted as the second number.
[0066] In one embodiment of the present application, the tag similarity can be calculated based on the application tags of any two applications, and whether there is a correlation between the two applications can be determined based on the tag similarity.
[0067] In one embodiment of the present application, if the tag similarity exceeds a set value, there is a correlation between the two applications.
[0068] Continue to refer to Figure 2 In step S240, a node that receives the application to be scheduled is determined among the candidate nodes.
[0069] In one embodiment of the present application, node information of the candidate nodes may be obtained, scores of the candidate nodes may be calculated based on the node information, and nodes that receive the application to be scheduled may be determined from among the candidate nodes based on the scores.
[0070] In one embodiment of the present application, the node information may include the affinity, anti-affinity, the total number of existing applications, and the total number of applications that can be processed of the candidate node.
[0071] exist Figure 2 In an embodiment of the present invention, by obtaining the decentralized scheduling level of the application to be scheduled and obtaining the node path of the node to be scheduled, based on the decentralized scheduling level, the decentralized scheduling path of the application to be scheduled is selected in the node path, if the decentralized scheduling path can receive the application to be scheduled, the node to be scheduled is used as a candidate node that can receive the application to be scheduled, and the node to be scheduled is screened through the decentralized scheduling path in the node path to obtain the candidate node, the candidate node is the node after screening, the number of candidate nodes may be less than the number of nodes to be scheduled, and the node that receives the application to be scheduled is determined among the candidate nodes, which can improve the efficiency of decentralized scheduling of the application to a certain extent.
[0072] In one embodiment of the present application, the scheduling method of the application of the present application can be used to perform decentralized scheduling of multiple copies of the same application at a specified level to meet the high availability requirements of multi-copy applications. For example, disaster recovery can be performed across multiple availability zones to prevent all scheduling in one availability zone, which would result in the application being inaccessible after a failure of this availability zone.
[0073] In one embodiment of the present application, the scheduling method of the application of the present application can be applied to the extension plug-in of the Kubernetes cluster, and the extension plug-in can be independently run as an extension plug-in of the native scheduler (Kube-Scheduler) of the Kubernetes cluster, and the extension plug-in can be used for multi-copy distributed scheduling. After the cluster administrator labels the cluster nodes with node labels of different topological levels and starts the extension plug-in, the user only needs to add a line of annotations to the deployment configuration of the application to be scheduled, specifying one or more distributed scheduling levels that want to be distributed, and the multiple copies of the application will be evenly distributed in the topological domains with different distributed scheduling levels.
[0074] In one embodiment of the present application, data can be input into an extension plug-in to which the distributed scheduling method of the present application is applied, and a node label can be added to each node to be scheduled in the cluster, wherein the node label includes topology domain identifiers at different topology levels. Figure 3 The topology diagram of an embodiment of the present application is schematically shown. Typical topology levels include region, zone, switch, rack, hostname, etc. There may also be only zone, hostname, etc. The cluster administrator can freely choose. The topology levels form a tree-structured topology diagram from top to bottom, representing the topology domain range from large to small. The distributed scheduling path of a node at the distributed scheduling level is a string of topological domain identifiers passed from top to bottom in the topology diagram to reach the specified distributed scheduling level. If the specified distributed scheduling level is the specified available zone level, the distributed scheduling path corresponding to the node path of a node is "the value of the node's region label:: the value of the node's available zone label", such as "region 1: available zone 1 (region1::zone1)".
[0075] In one embodiment of the present application, when the extension plug-in applying the distributed scheduling method of the present application is started, the node labels can be entered into the node label list in a topological order from top to bottom. A typical node label list is "region, zone, switch, rack, hostname".
[0076] In one embodiment of the present application, an annotation may be set for the application in the application deployment description, for example, specifying the distributed scheduling level as both the available zone and the node name (hostname), indicating that multiple copies of the application are to be distributed and scheduled to different available zones (zones) and distributed and scheduled to different node names (hostnames):
[0077] annotations:
[0078] topology-spread-layer:zone,hostname.
[0079] In one embodiment of the present application, a distributed scheduling level list topoLabels can be extracted from the application annotation. Multiple distributed scheduling levels may be specified in topoLabels. For example, if distributed scheduling of two levels, "zone" and "hostname", is required, there are two topology domain label names in this topoLabels.
[0080] In one embodiment of the present application, before the distributed scheduling application, the distributed scheduling path corresponding to the distributed scheduling level can be calculated for each node, and the path is used as the key, and the node information list and the number of matching related applications are used as values to form a key-value pair and stored in the statistical dictionary. For example, the node information list under the topological path "regionA::zone1" is "node1, node2, node3", and the number of matching related applications is initialized to 0; an application correlation selector is created according to the label of the input application to be scheduled. If the application is deployed in StatefulSet mode, the application name added by StatefulSet should be removed from the label in the selector.
[0081] In one embodiment of the present application, the statistical dictionary can be traversed to count the number of existing applications and the number of applications related to the input application at the nodes under each path for each path. The correlation means multiple copies of the same application. The correlation is determined according to whether the label on the application matches the correlation selector. If an application is a related application, the number of related applications matched under the path is increased by 1. During the statistical process, the maximum number of matched applications under a path (selectedpod Max) and the minimum number of matched applications (selectedpod Min) need to be recorded. After the statistics are completed, the statistical dictionary obtains the mapping relationship between each topological path and the number of existing applications related to the input application under it, such as the number of related applications under the topological path "regionA::zone1" is 1, the number of related applications under the topological path "regionA::zone2" is 1, and the number of related applications under the topological path "regionA::zone3" is 0. Selected pod Max is the maximum value of 1 among the three, and selected pod Min is the minimum value of 0 among the three.
[0082] In one embodiment of the present application, during the operation of the extension plug-in applying the distributed scheduling method of the present application, a dedicated controller may continuously synchronize node information and application information from the Kube-API Server and store them in the statistical dictionary.
[0083] In one embodiment of the present application, a node list can be obtained and returned to Kube-Scheduler, each node in the node list is traversed, and each node is screened: first, according to the distributed scheduling level, the distributed scheduling path corresponding to the node path of the node is determined, and the number of related applications (selected podCount) whose key is the distributed scheduling path is taken out from the statistical dictionary. If selected pod Count+1-selected pod Min>1, it means that if one more related application is scheduled on the distributed scheduling path, it will be 1 greater than the minimum number of related applications, which violates the principle of balance. This node cannot be scheduled and is removed from the candidate node list canSchedule and placed in the unschedulable node list canNotSchedule. Then the candidate node list canSchedule and the unschedulable node list canNotSchedule are returned to Kube-Scheduler.
[0084] In one embodiment of the present application, the balance principle can be: when the number of topological domains at a given topological level is greater than the number of application copies, the number of schedulable copies of this application in the topological domain is either 1 or 0; when the number of topological domains at a given topological level is equal to the number of application copies, the number of schedulable copies of this application in the topological domain is 1; when the number of topological domains at a given topological level is less than the number of application copies, the number of schedulable copies in the topological domain is either N or N+1, N>=1.
[0085] Figure 4 A schematic diagram of a topology diagram of an embodiment of the present application is shown schematically. Figure 4 As shown in the figure, there are three levels of topology: region, zone, and hostname. There are six nodes from node A to node F. Three copies of an application are submitted for zone-level and hostname-level distributed scheduling:
[0086] Explanation of zone-level distributed scheduling: If application 0 (pod-0) is distributed and scheduled in zone 1 (region1::zone1), then application 1 (pod-1) must be distributed and scheduled in zone 2 (region1::zone2). Application 2 (pod-2) may be distributed and scheduled in zone 1 (region1::zone1) or zone 2 (region1::zone2).
[0087] Explanation of node name (hostname) level distributed scheduling: If application 0 (pod-0) is distributed and scheduled on node name A (region1::zone1::hostnameA), and application 1 (pod-1) is distributed and scheduled on node name D (region1::zone2::hostnameD), application 2 (pod-2) cannot be distributed and scheduled on these two nodes that already have related pods. The other four nodes can all be distributed and scheduled.
[0088] The present application proposes a topology path-aware distributed scheduling method, which runs independently as an extension plug-in of the native scheduler of Kube-Scheduler, collects the topology label of each node in the cluster, and after specifying the annotation of one or more distributed scheduling levels in the deployment configuration of the application, the scheduler extension plug-in can calculate the distributed scheduling path of each candidate node for each specified distributed scheduling level and count the number of copies of this application that already exist on the distributed scheduling path, filter out the nodes that violate the balanced strategy according to a balanced distribution strategy, and return the remaining schedulable nodes to the native scheduler, thereby completing the distributed scheduling of the specified level of multi-copy application, meeting the distributed scheduling requirements of the application at specified different levels, so that the application can achieve the expected high availability level. The present application has the characteristics of topology path awareness, using the path spliced from top to bottom at the topology level as the topology domain label instead of a single topology identifier as the topology domain label, and tolerates the same value of a topology identifier of the same level under different topology domains, and is simpler to use, reducing the cumbersome manual configuration of distributed scheduling conditions, and being more transparent to users.
[0089] It is understandable that the above topology label names and topology levels are not limited to the above and can be specified arbitrarily.
[0090] The following describes an apparatus embodiment of the present application, which can be used to execute the scheduling method of the application in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the scheduling method of the application of the present application.
[0091] Figure 5 A block diagram of a scheduling device for an application according to an embodiment of the present application is schematically shown.
[0092] Reference Figure 5 As shown, an application scheduling device 500 according to an embodiment of the present application includes: an acquisition module 501, a selection module 502, a judgment module 503 and a determination module 504.
[0093] In some embodiments of the present application, based on the aforementioned scheme, the acquisition module 501 is configured to obtain the decentralized scheduling level of the application to be scheduled and obtain the node path of the node to be scheduled; the selection module 502 is configured to select the decentralized scheduling path of the application to be scheduled in the node path based on the decentralized scheduling level; the judgment module 503 is configured to select the node to be scheduled as a candidate node that can receive the application to be scheduled if the decentralized scheduling path can receive the node to be scheduled; the determination module 504 is configured to determine the node that receives the application to be scheduled among the candidate nodes.
[0094] In some embodiments of the present application, based on the aforementioned scheme, the selection module 502 is configured to: use the topological domain at the decentralized scheduling level in the node path as the decentralized scheduling topological domain; and select the path from the highest-level topological domain in the node path to the decentralized scheduling topological domain as the decentralized scheduling path.
[0095] In some embodiments of the present application, based on the aforementioned scheme, the judgment module 503 is configured as: if the decentralized scheduling path is capable of receiving the application to be scheduled, before taking the node to be scheduled as a candidate node, obtaining the number of applications in the decentralized scheduling path that have a correlation with the application to be scheduled as a first number; in other topological domains in the topological network except the topological domain in the node path, obtaining the topological domain at the decentralized scheduling level as a comparison topological domain; obtaining the number of applications in each comparison topological domain that have a correlation with the application to be scheduled as a second number; based on the first number and the second number, determining whether the decentralized scheduling path is capable of receiving the node to be scheduled.
[0096] In some embodiments of the present application, based on the aforementioned scheme, the judgment module 503 is configured to: obtain the minimum value of the first quantity and the second quantity; dispatch a related application having a correlation with the application to be scheduled to the distributed scheduling path; if the difference between the first quantity and the minimum value of the distributed scheduling path after the distributed scheduling is equal to one, the distributed scheduling path can receive the node to be scheduled; if the difference between the first quantity and the minimum value of the distributed scheduling path after the distributed scheduling is greater than one, the distributed scheduling path cannot receive the node to be scheduled.
[0097] In some embodiments of the present application, based on the aforementioned scheme, the judgment module 503 is configured to: obtain the application label of the application to be scheduled; search for an application with the same application label as the application to be scheduled in the decentralized scheduling path; and count the number of applications with the same application label as the application to be scheduled in the decentralized scheduling path as the first number.
[0098] In some embodiments of the present application, based on the aforementioned scheme, the judgment module 503 is configured to: obtain the applications in each node of the decentralized scheduling path; among the applications in each node of the decentralized scheduling path, search for the application in the decentralized scheduling path that has the same application label as the application to be scheduled.
[0099] In some embodiments of the present application, based on the aforementioned scheme, the judgment module 503 is configured to: obtain the application label of the application to be scheduled; obtain the applications with the same application label as the application to be scheduled in each comparison topology domain; and count the number of applications with the same application label as the application to be scheduled in each comparison topology domain as the second number.
[0100] In some embodiments of the present application, based on the aforementioned scheme, the acquisition module 501 is configured to: obtain the node label of the node to be scheduled, and obtain the topological domain identifier to which the node to be scheduled belongs at each level of the topological network from the node label; determine the node path based on the topological domain identifier to which the node to be scheduled belongs at each level of the topological network.
[0101] In some embodiments of the present application, based on the aforementioned scheme, the determination module 504 is configured to: obtain node information of the candidate nodes; calculate the scores of the candidate nodes based on the node information; and determine the nodes that receive the application to be scheduled among the candidate nodes based on the scores.
[0102] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0103] Refer to the following Figure 6 The electronic device 60 according to this embodiment of the present application is described. Figure 6 The electronic device 60 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0104] like Figure 6 As shown, the electronic device 60 is in the form of a general computing device. The components of the electronic device 60 may include but are not limited to: at least one processing unit 61, at least one storage unit 62, a bus 63 connecting different system components (including the storage unit 62 and the processing unit 61), and a display unit 64.
[0105] The storage unit stores program codes, which can be executed by the processing unit 61, so that the processing unit 61 executes the steps described in the above “Embodiment Method” section of this specification according to various exemplary implementations of the present application.
[0106] The storage unit 62 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .
[0107] The storage unit 62 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0108] Bus 63 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0109] The electronic device 60 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 60, and / or may communicate with any device that enables the electronic device 60 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 65. Furthermore, the electronic device 60 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 66. As shown, the network adapter 66 communicates with other modules of the electronic device 60 via a bus 63. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 60, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0110] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0111] According to one embodiment of the present application, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present application can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present specification.
[0112] According to one embodiment of the present application, the program product for implementing the above method of the implementation mode of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0113] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0114] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0115] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0116] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0117] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0118] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be performed without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A scheduling method for an application, characterized in that: include: Obtain the decentralized scheduling level of the application to be scheduled, and obtain the node path of the node to be scheduled; Based on the decentralized scheduling level, selecting a decentralized scheduling path of the application to be scheduled from the node path; If the decentralized scheduling path can receive the application to be scheduled, taking the node to be scheduled as a candidate node that can receive the application to be scheduled; Determining a node that receives the application to be scheduled among the candidate nodes; If the decentralized scheduling path is capable of receiving the application to be scheduled, before taking the node to be scheduled as a candidate node, the method includes: Acquire the number of applications in the decentralized scheduling path that are correlated with the application to be scheduled as a first number; In the topological network, in addition to the topological domain in the node path, a topological domain at the decentralized scheduling level is obtained as a comparison topological domain; Acquire the number of applications in each of the compared topology domains that are correlated with the application to be scheduled as a second number; Based on the first number and the second number, determining whether the decentralized scheduling path can receive the application to be scheduled; If the first number is less than or equal to the second number, it is determined that the decentralized scheduling path can receive the application to be scheduled.
2. The application scheduling method according to claim 1, characterized in that: The selecting, based on the decentralized scheduling level, the decentralized scheduling path of the application to be scheduled in the node path comprises: Using the topological domain at the decentralized scheduling level in the node path as the decentralized scheduling topological domain; A path from the highest-level topology domain in the node path to the decentralized scheduling topology domain is selected as the decentralized scheduling path.
3. The application scheduling method according to claim 1, characterized in that: The determining, based on the first number and the second number, whether the decentralized scheduling path can receive the application to be scheduled includes: Obtaining a minimum value between the first quantity and the second quantity; Distributedly scheduling a related application having a correlation relationship with the application to be scheduled in the distributed scheduling path, if the difference between the first number of the distributed scheduling path and the minimum value after distributed scheduling is equal to one, then the distributed scheduling path can receive the application to be scheduled; If the difference between the first number of the decentralized scheduling paths and the minimum value after decentralized scheduling is greater than one, the decentralized scheduling paths cannot receive the application to be scheduled.
4. The application scheduling method according to claim 1, characterized in that: The obtaining, as the first number, the number of applications in the decentralized scheduling path that are correlated with the application to be scheduled includes: Obtaining an application tag of the application to be scheduled; Searching for an application in the decentralized scheduling path that has the same application label as the application to be scheduled; The number of applications in the decentralized scheduling path that have the same application label as the application to be scheduled is counted as the first number.
5. The application scheduling method according to claim 4, characterized in that: The searching for an application having the same application label as the application to be scheduled in the decentralized scheduling path includes: Obtaining applications in each node of the decentralized scheduling path; Among the applications in each node of the decentralized scheduling path, an application having the same application label as the application to be scheduled in the decentralized scheduling path is searched.
6. The application scheduling method according to claim 1, characterized in that: The obtaining, as the second number, the number of applications in each of the compared topology domains that are correlated with the application to be scheduled includes: Obtaining an application tag of the application to be scheduled; Acquire applications in each of the compared topology domains that have the same application label as the application to be scheduled; The number of applications having the same application label as the to-be-scheduled application in each of the compared topology domains is counted as the second number.
7. The application scheduling method according to claim 1, characterized in that: The step of obtaining the node path of the node to be scheduled includes: Acquire a node label of the node to be scheduled, and acquire a topology domain identifier to which the node to be scheduled belongs at each level of the topology network from the node label; The node path is determined based on the topological domain identifiers to which the nodes to be scheduled belong at each level of the topological network.
8. The application scheduling method according to claim 1, characterized in that: The determining, among the candidate nodes, a node for receiving the application to be scheduled, comprises: Obtaining node information of the candidate node; Calculating the score of the candidate node based on the node information; A node for receiving the application to be scheduled is determined from among the candidate nodes based on the score.
9. An application scheduling device, characterized in that: include: An acquisition module configured to acquire a decentralized scheduling level of an application to be scheduled and acquire a node path of a node to be scheduled; A selection module configured to select a decentralized scheduling path of the application to be scheduled from the node path based on the decentralized scheduling level; A judgment module, configured to, if the decentralized scheduling path can receive the node to be scheduled, take the node to be scheduled as a candidate node that can receive the application to be scheduled; A determination module, configured to determine a node that receives the application to be scheduled from among the candidate nodes; If the decentralized scheduling path can receive the application to be scheduled, before taking the node to be scheduled as a candidate node, the method further includes: Acquire the number of applications in the decentralized scheduling path that are correlated with the application to be scheduled as a first number; In the topological network, in addition to the topological domain in the node path, a topological domain at the decentralized scheduling level is obtained as a comparison topological domain; Acquire the number of applications in each of the compared topology domains that are correlated with the application to be scheduled as a second number; Based on the first number and the second number, determining whether the decentralized scheduling path can receive the application to be scheduled; If the first number is less than or equal to the second number, it is determined that the decentralized scheduling path can receive the application to be scheduled.
10. A computer-readable program medium storing computer program instructions, characterized in that: When the computer program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 8.
11. An electronic device, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.
