Cluster Resource Scheduling Method, Device, Software Program, Electronic Device and Storage Medium
By configuring workloads and timeout queues in the cluster resource scheduling environment of the cloud network and executing the cluster resource scheduler based on the number of failed replicas, the problems of abnormal node exit and competition for subcluster resource are solved, improving the accuracy and reliability of cluster resource scheduling and improving user experience.
Patent Information
- Application Number
- CN202210144907.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-02-17
AI Technical Summary
In the cluster resource scheduling of cloud networks, the existing technology is difficult to effectively deal with the replica resourceless scheduling caused by abnormal node exits, as well as the competition for sub-cluster resources in multi-cluster environments, which affects the accuracy and reliability of cluster resource scheduling.
By configuring the workload and timeout queue in the cluster resource scheduling environment, when the workload reaches the timeout state, its status is adjusted to the secondary scheduling state, and based on the number of failed replicas, determine the number of failed replicas, and execute the cluster resource scheduler to utilize the maximum number of available replicas.
This method can ensure the availability of workloads, improve the accuracy and reliability of cluster resource scheduling, improve the efficiency of cluster resource usage, ensure the data processing speed of cloud server users, and improve the user experience.
Smart Images

Figure CN114546644B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the cluster resource scheduling processing technology of cloud networks, and particularly to a cluster resource scheduling method, device, software program, electronic device, and storage medium. Background Art
[0002] With the continuous development of computer technology, cloud virtual machines (CVMs) can provide secure and reliable elastic computing services and different instance types to meet specific usage scenarios of users. These instance types consist of different combinations of CPUs, memory, storage, and networks. When performing cluster resource scheduling during the operation of cloud virtual machines, the speed of cluster resource scheduling directly affects the resource utilization rate of the cloud data center and the user experience. Scheduling first ensures that users can be allocated resources, and then focuses on how to optimally allocate resources, that is, to improve resource utilization. However, in related technologies, during the operation of a cluster, there may still be a situation where a node abnormally exits, resulting in no resources for replicas to be scheduled. At the same time, in a multi-cluster environment, resource competition among sub-clusters may occur during task processing, affecting the accuracy and reliability of cluster resource scheduling. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a cluster resource scheduling method, device, software program, electronic device, and storage medium, which can execute a cluster resource scheduling program based on the number of failed replicas to achieve the maximum available replicas in the cluster resource scheduling environment, ensure the availability of the workload, and at the same time improve the accuracy and reliability of cluster resource scheduling, enhance the utilization efficiency of cluster resources, ensure the data processing speed of cloud virtual machine users, and improve the user experience.
[0004] The technical solution of the embodiments of the present invention is implemented as follows:
[0005] Embodiments of the present invention provide a cluster resource scheduling method, and the method includes:
[0006] Configure a workload in a cluster resource scheduling environment and determine a timeout queue for carrying the workload;
[0007] When the workload in the timeout queue reaches the timeout state, the controller component adjusts the state of the workload to the secondary scheduling state;
[0008] When the scheduler component determines that the state of the workload is the secondary scheduling state, based on the information of the workload, send a failed replica number detection request to the corresponding estimator component;
[0009] The estimator component determines the number of replicas with scheduling failures in response to the failed replica count detection request, and sends the number of replicas with scheduling failures to the scheduler component;
[0010] Based on the number of replicas with scheduling failures, the scheduler component executes a cluster resource scheduling program to achieve the maximum available number of replicas in the cluster resource scheduling environment.
[0011] An embodiment of the present invention further provides a cluster resource scheduling device, including:
[0012] An information transmission device for configuring a workload in a cluster resource scheduling environment and determining a timeout queue carrying the workload;
[0013] An information processing device for when the workload in the timeout queue reaches a timeout state, the controller component adjusts the state of the workload to a secondary scheduling state;
[0014] The information processing device is used for when the scheduler component determines that the state of the workload is the secondary scheduling state, sending a failed replica count detection request to the corresponding estimator component based on the information of the workload;
[0015] The information processing device is used for the estimator component to determine the number of replicas with scheduling failures in response to the failed replica count detection request, and send the number of replicas with scheduling failures to the scheduler component;
[0016] The information processing device is used for the scheduler component to execute a cluster resource scheduling program based on the number of replicas with scheduling failures to achieve the maximum available number of replicas in the cluster resource scheduling environment.
[0017] In the above solution, the information processing device is used for the controller component to determine the expected number of replicas in the cluster resource scheduling environment;
[0018] The information processing device is used for the controller component to perform real-time detection on the workload based on the expected number of replicas;
[0019] The information processing device is used for when the number of replicas in the workload is less than the expected number of replicas, adjusting the workload to the timeout queue.
[0020] In the above solution, the information processing device is used for when the number of replicas in the workload in the timeout queue changes, the controller component performs detection on the workload in the timeout queue based on the expected number of replicas;
[0021] The information processing device is configured to keep the workload in the timeout queue when the number of replicas in the workload is less than the desired number of replicas;
[0022] The information processing device is configured to delete the workload in the timeout queue when the number of replicas in the workload is greater than or equal to the desired number of replicas.
[0023] In the above solution, the information processing device is configured to enable the estimator component to obtain the node information and container group information of all nodes in the sub-cluster in the cluster resource scheduling environment;
[0024] The information processing device is configured to enable the estimator component to query the container group associated with the working replica in the sub-cluster in response to the failed replica count detection request, and determine the container group list corresponding to the container group;
[0025] The information processing device is configured to enable the estimator component to query the container group with scheduling failure from the container group list, and calculate the number of replicas with scheduling failure based on the container group with scheduling failure.
[0026] In the above solution, the information processing device is configured to determine the replica controller object list corresponding to the working replica when the type of the working replica is a resource type;
[0027] The information processing device is configured to find the container group list associated with the working replica through the cache of the replica controller object list;
[0028] The information processing device is configured to find the container group list associated with the working replica in the cache of the working replica when the type of the working replica is a state replica set type.
[0029] In the above solution, the information processing device is configured to enable the estimator component to obtain the node information and container group information of all nodes in the sub-cluster in the cluster resource scheduling environment when the estimator component is started;
[0030] The information processing device is configured to enable the estimator component to screen the nodes matching the workload from all nodes in the cluster resources in response to the maximum available replica count estimation request;
[0031] The information processing device is configured to determine the container group information corresponding to each node matching the workload, and determine the maximum available replica count of each node matching the workload based on the container group information;
[0032] The information processing device is used to determine the maximum available replica number in the cluster resource scheduling environment based on the maximum available replica number of each node matching the workload.
[0033] An embodiment of the present invention further provides an electronic device, which includes:
[0034] A memory for storing executable instructions;
[0035] A processor, when running the executable instructions stored in the memory, implements the foregoing cluster resource scheduling method.
[0036] An embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, and when the executable instructions are executed by a processor, the foregoing cluster resource scheduling method is implemented.
[0037] An embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the cluster resource scheduling method provided by the embodiment of the present application.
[0038] The embodiment of the present invention has the following beneficial effects:
[0039] In the embodiment of the present invention, by configuring a workload in a cluster resource scheduling environment and determining a timeout queue for carrying the workload; when the workload in the timeout queue reaches a timeout state, the controller component adjusts the state of the workload to a secondary scheduling state; when the scheduler component determines that the state of the workload is the secondary scheduling state, based on the information of the workload, a failed replica number detection request is sent to the corresponding estimator component; the estimator component responds to the failed replica number detection request, determines the number of replicas with scheduling failures, and sends the number of replicas with scheduling failures to the scheduler component; the scheduler component, based on the number of replicas with scheduling failures, executes a cluster resource scheduling program to utilize the maximum available replica number in the cluster resource scheduling environment, and can execute a cluster resource scheduling program based on the number of replicas with scheduling failures to utilize the maximum available replica number in the cluster resource scheduling environment, ensure the availability of the workload, improve the accuracy and reliability of cluster resource scheduling, improve the utilization efficiency of cluster resources, ensure the data processing speed of cloud server users, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the usage scenario of the cluster resource scheduling method provided by the embodiment of the present invention;
[0041] Figure 2 Schematic diagram of the composition structure of the electronic device provided by the embodiment of the present invention;
[0042] Figure 3 An optional flowchart of the cluster resource scheduling method provided by the embodiment of the present invention;
[0043] Figure 4 Schematic diagram of the architecture of the cluster resource scheduling device in the embodiment of the present invention;
[0044] Figure 5 An optional flowchart of the cluster resource scheduling method provided by the embodiment of the present invention;
[0045] Figure 6 An optional flowchart of the cluster resource scheduling method provided by the embodiment of the present invention;
[0046] Figure 7 An optional flowchart of the cluster resource scheduling method provided by the embodiment of the present invention. Detailed implementation manners
[0047] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0048] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0049] Before further elaborating on the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.
[0050] 1) In response to, which is used to represent the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more of the executed operations can be real-time or can have a set delay; without special instructions, there is no restriction on the execution order of the multiple executed operations.
[0051] 2) Terminal, including but not limited to: ordinary terminal, dedicated terminal, where the ordinary terminal maintains a long connection and / or a short connection with the sending channel, and the dedicated terminal maintains a long connection with the sending channel.
[0052] 3) Client, the carrier for implementing specific functions in the terminal. For example, a mobile client (APP) is the carrier for specific functions in a mobile terminal, such as the function of executing report production or the function of presenting reports.
[0053] 4) Component, a functional module of the view of a mini-program, also known as a front-end component, such as buttons, titles, tables, sidebars, content, and footers on a page. Components include modular code for easy reuse in different pages of the mini-program.
[0054] 5) Server cluster, which means gathering many servers together to perform the same service. From the perspective of the client, it seems like there is only one server. A server cluster can use multiple computers for parallel computing to obtain a very high computing speed, or use multiple computers for backup so that the entire system can still run normally even if any one machine breaks down. In the server cluster hard disk failure handling method provided in this application, it can be applied to cloud server usage scenarios and distributed server usage scenarios to achieve status detection and fault repair of server hard disks in different usage scenarios. Specifically, a cloud server (CVM Cloud Virtual Machine) is a simple, efficient, secure, and reliable computing service with elastic scalability of processing power. Its management method is simpler and more efficient than that of traditional single physical servers. Users do not need to purchase hardware in advance and can quickly create or release any number of cloud servers for their business processes and store the data of cloud server users. In the distributed server usage environment, the data and programs of users can be not located on one server but scattered among multiple servers. Similarly, the distributed server usage environment also requires a large number of hard disks to be configured and also needs to implement status detection and fault repair of server hard disks through the server cluster hard disk failure handling method provided in this application.
[0055] 6) Container cluster management system Kubernetes, also known as K8S, is an open-source container operation platform that can combine several containers into a service and dynamically allocate the hosts on which the containers run, etc., providing great convenience for users to use containers. Through Kubernetes, applications can be quickly deployed, quickly scaled, seamlessly docked with new application functions, and the use of hardware resources can be optimized.
[0056] A node is the basic element that makes up a container cluster. Nodes depend on the business and can be either virtual machines or physical machines. Each node contains the basic components required to run a container group Pod, including Kubelet (container management component), Kubeproxy (network proxy component), etc.
[0057] The Master node refers to the cluster control node that manages and controls the entire cluster. All control commands of k8s are sent to it, and it is responsible for the specific execution process. The kube-apiserver (resource access component), kube-controller-manager (operation management controller component), and kube-scheduler (scheduling component) running on the Master node maintain the healthy working state of the entire cluster by continuously communicating with the kubelet and kube-proxy on the worker nodes (Node). If the service of the Master node cannot access a certain Node, that Node will be marked as unavailable, and new Pods (container groups) will no longer be scheduled to it. However, additional detection is required for the Master itself to prevent it from becoming a single point of failure in the cluster, so high-availability deployment is also required for the Master service.
[0058] Nodes other than the Master are called Node or Worker nodes. You can use the node viewing command (kubectl get nodes) in the Master to view the Node nodes in the cluster. Each Node node will be assigned some workloads (Docker containers) by the Master node. When a certain Node fails, the workloads on that node will be automatically transferred to other nodes by the Master node.
[0059] Pod (container group): The smallest / simplest basic unit created or deployed by Kubernetes - the container group. A Pod represents a microservice process running on the cluster, and a microservice process encapsulates an edge container (or multiple edge containers) that provides the microservice application, storage resources, an independent network IP, and policy options for managing and controlling the running mode of the container.
[0060] 7) Workload: A type of application that can contain multiple replica instances.
[0061] 8) Replica: The instance unit of the workload, and each replica instance is an independent container.
[0062] 9) Secondary scheduling: Used during the task processing to reallocate the cluster resources to adapt to the task requirements.
[0063] Before introducing the cluster resource scheduling method provided by this application, first briefly describe the defects in the related technologies. In the related technologies, the following methods are usually used for resource scheduling in the cloud network:
[0064] 1) Detect nodes with resource utilization greater than 90% as overloaded replicas by overloading the node detection step, and then schedule and migrate these replicas. Eventually, the load balancing of all nodes in the storage cluster can be achieved. The drawback of this method is that it is only applicable to a single cluster and cannot be extended to multi-cluster use.
[0065] 2) First, receive the application container deployment instructions sent by the user and the cluster resource usage information uploaded by the federated cluster. Then, determine the deployment replicas of each sub-cluster in the federated cluster based on the total number of application templates in the application container deployment instructions and the cluster resource usage information. Eventually, replica scheduling considering the resource operation of the sub-cluster can be achieved. The drawback of this method is that there may still be a situation where a node abnormally exits during the operation of the cluster, resulting in no resources for replica scheduling, and at the same time, there will still be a problem of resource competition among sub-clusters. Therefore, there is still a risk that replicas cannot run properly.
[0066] 3) At fixed intervals or when a new node joins, filter out the Pods that need to be scheduled based on the resource utilization of each node and the average resource utilization of all nodes in the cluster, and migrate the Pods to nodes with a lower average resource utilization. The drawback of this method is that it cannot handle the scenario when the cluster resources are insufficient, and can only solve the cluster utilization balance when there is enough remaining resources in a single cluster. There is still a risk of system downtime.
[0067] To overcome the above drawbacks, this application provides a cluster resource scheduling method, device, software program, electronic device, and storage medium. Figure 1 For the schematic diagram of the usage scenario of the cluster resource scheduling method provided by the embodiments of the present invention, see Figure 1, with the continuous development of computer technology, cloud virtual machines (CVMs) can provide secure and reliable elastic computing services and different instance types to meet specific usage scenarios of users. Terminals (including terminal 10-1 and terminal 10-2) are provided with corresponding clients capable of performing different functions. Among them, the client belongs to the terminal (including terminal 10-1 and terminal 10-2) to obtain different information from the corresponding cloud server 200 through network 300, and different services can be deployed in the cloud server. The terminal is connected to the server 200 through network 300. Network 300 can be a wide area network, a local area network, or a combination of both, and uses a wireless link to achieve data transmission. These instance types provided by the cloud server are composed of different combinations of CPU, memory, storage, and network, and the user's service data is stored in the hard disk of the cloud server. However, during the operation of the cloud server, a large number of resource fragments are generated during the task processing process, resulting in resource redundancy, reducing the processing speed of the cloud server network, affecting the task processing speed, and affecting the usage effect of the cloud server network. In the embodiments provided by the present invention, the cloud server applications running in the cloud server 200 can be written in software code environments of different programming languages, and the code objects can be code entities of different types. For example, in the software code of the C language, a code object can be a function. In the software code of the JAVA language, a code object can be a class, and in the OC language on the IOS side, it can be a piece of object code. In the software code of the C++ language, a code object can be a class or a function to execute processing instructions from different terminals. Among them, in this application, the source of the compilation environment of the cloud server is no longer distinguished.
[0068] The structure of the cluster resource scheduling device in the embodiments of the present invention will be described in detail below. The cluster resource scheduling device can be implemented in various forms, such as a dedicated terminal with the processing function of the cluster resource scheduling device, or a server provided with the processing function of the cluster resource scheduling device, such as the server 200 in the foregoing Figure 1 above. Figure 2 FIG. is a schematic diagram of the composition structure of the cluster resource scheduling device provided by the embodiments of the present invention. It can be understood that Figure 2 only shows the exemplary structure of the cluster resource scheduling device rather than all structures, and can be implemented according to needs Figure 2 the partial structure or all structures shown.
[0069] The cluster resource scheduling device provided by an embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203, and at least one network interface 204. Each component in the cluster resource scheduling device is coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 205 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 205.
[0070] Among them, the user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, a button, a touchpad, or a touch screen, etc.
[0071] It can be understood that the memory 202 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The memory 202 in the embodiment of the present invention can store data to support the operation of a terminal (such as 10-1). Examples of these data include: any computer program for operating on the terminal (such as 10-1), such as an operating system and application programs. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs may include various application programs. The terminals involved in the embodiment of the present invention include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle-mounted terminals, etc. The embodiment of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, intelligent transportation, assisted driving, etc., to implement the cluster resource scheduling method provided by the present invention in various scenarios.
[0072] In some embodiments, the cluster resource scheduling device provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the cluster resource scheduling device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the cluster resource scheduling method provided by the embodiment of the present invention. For example, a processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs, Application Specific Integrated Circuits), DSPs, programmable logic devices (PLDs, Programmable Logic Devices), complex programmable logic devices (CPLDs, Complex Programmable Logic Devices), field-programmable gate arrays (FPGAs, Field-Programmable Gate Arrays), or other electronic components.
[0073] As an example of the implementation of the cluster resource scheduling device provided by the embodiments of the present invention by combining software and hardware, the cluster resource scheduling device provided by the embodiments of the present invention can be directly embodied as a combination of software modules executed by the processor 201. The software modules can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software modules in the memory 202, and combines with necessary hardware (for example, including the processor 201 and other components connected to the bus 205) to complete the cluster resource scheduling method provided by the embodiments of the present invention.
[0074] As an example, the processor 201 can be an integrated circuit chip with the ability to process signals, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0075] As an example of the implementation of the cluster resource scheduling device provided by the embodiments of the present invention by hardware, the device provided by the embodiments of the present invention can be directly implemented by using the processor 201 in the form of a hardware decoding processor. For example, it is implemented by one or more application-specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), complex programmable logic device (CPLD, Complex Programmable Logic Device), field programmable gate array (FPGA, Field-Programmable Gate Array) or other electronic components to implement the cluster resource scheduling method provided by the embodiments of the present invention.
[0076] The memory 202 in the embodiments of the present invention is used to store various types of data to support the operation of the cluster resource scheduling device. Examples of these data include: any executable instructions for operating on the cluster resource scheduling device, such as executable instructions, and the program for implementing the cluster resource scheduling method of the embodiments of the present invention can be included in the executable instructions.
[0077] In some other embodiments, the cluster resource scheduling device provided by the embodiments of the present invention can be implemented in a software manner. Figure 2Shows the cluster resource scheduling device stored in the memory 202, which can be software in the form of programs and plugins, etc., and includes a series of modules. As an example of the program stored in the memory 202, it can include the cluster resource scheduling device, and the software module information transmission module 2081 and information processing module 2082 are included in the cluster resource scheduling device. When the software modules in the cluster resource scheduling device are read into the RAM by the processor 201 and executed, the cluster resource scheduling method provided by the embodiments of the present invention will be implemented. Among them, the functions of each software module in the cluster resource scheduling device include:
[0078] The information transmission device 2081 is used to configure the workload in the cluster resource scheduling environment and determine the timeout queue carrying the workload.
[0079] The information processing device 2082 is used to adjust the state of the workload to the secondary scheduling state when the workload in the timeout queue reaches the timeout state.
[0080] The information processing device 2082 is used to send a failed replica number detection request to the corresponding estimator component based on the information of the workload when the scheduler component determines that the state of the workload is the secondary scheduling state.
[0081] The information processing device 2082 is used for the estimator component to determine the number of replicas that failed to schedule in response to the failed replica number detection request and send the number of replicas that failed to schedule to the scheduler component.
[0082] The information processing device 2082 is used for the scheduler component to execute the cluster resource scheduling program based on the number of replicas that failed to schedule to achieve the maximum available replica number in the cluster resource scheduling environment.
[0083] The information processing device 2082 is used to configure the corresponding cluster resources for the task to be processed according to the priority of the task to be processed in response to the cluster resource scheduling mode matching the cluster resources.
[0084] According to Figure 2 The electronic device shown. In one aspect of the present application, the present application also provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various alternative implementations of the above cluster resource scheduling method.
[0085] Reference Figure 3 ,Figure 3 FIG. 1 is an optional flowchart of the cluster resource scheduling method provided by an embodiment of the present invention. It can be understood that Figure 3 the steps shown can be executed by various electronic devices running the cluster resource scheduling device. For example, it can be a dedicated terminal with cluster resource scheduling function, a server, or a server cluster controller, a control terminal of a cloud network server. Among them, the dedicated terminal with the cluster resource scheduling device can be encapsulated in Figure 1 the server 200 shown to execute the corresponding software module in the preamble Figure 2 cluster resource scheduling device shown. The following will describe the steps shown in Figure 3 FIG. 1.
[0086] Step 301: The cluster resource scheduling device configures a workload in the cluster resource scheduling environment and determines a timeout queue for carrying the workload.
[0087] In some embodiments of the present invention, for the environment of a cloud server cluster, the cluster resource scheduling device may include different types of components, such as: a controller component, a scheduler component, and an estimator component. Specifically, referring to Figure 4 FIG. 2, Figure 4 FIG. 2 is a schematic architecture diagram of the cluster resource scheduling device in an embodiment of the present invention. Among them, the controller component is used to detect all workloads and only put the workloads that have not reached the expected number of replicas into the timeout queue for timing. When a timeout event occurs, the status of the workload will be updated to indicate that it needs to be rescheduled. The scheduler component is used to continuously detect all workloads. When a workload appears in a state that needs to be rescheduled, it will send a request to the estimator to obtain the number of failed replicas of the workload in each cluster and perform rescheduling based on this result. The estimator component is used to detect the cluster replicas and nodes of a sub-cluster to count the cluster resource usage. When receiving a failed replica statistics request from the scheduler, it will calculate and return the number of failed replicas in the cluster in real time. The controller component, the scheduler component, the estimator component, and the workload created by the user together constitute the control plane.
[0088] Among them, the embodiments of the present invention can be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. It can also be understood as the general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. The background 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. Therefore, cloud technology needs to be supported by cloud computing.
[0089] It should be noted that cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called the "cloud". The resources in the "cloud" seem to users to be infinitely expandable, and can be obtained at any time, used on demand, expanded at any time, and paid according to usage. As a basic capability provider of cloud computing, a cloud computing resource pool platform will be established, abbreviated as the cloud platform, generally referred to as Infrastructure as a Service (IaaS). Multiple types of virtual resources are deployed in the resource pool for external customers to choose and use. The cloud computing resource pool mainly includes: computing devices (which can be virtualized machines, including operating systems), storage devices, and network devices. When a user uses a cloud server to store data or deploy different application processes, by detecting the operating parameters of the server cluster hard disk, possible server cluster hard disk failures can be discovered in a timely manner, avoiding the loss of user data caused by server cluster hard disk failures with failure warnings.
[0090] Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that combines a large number of different types of storage devices (storage devices are also called storage nodes) in the network through functions such as cluster applications, grid technology, and distributed storage file systems, and works together through application software or application interfaces to provide data storage and business access functions externally. Currently, the storage method of the storage system is: create a logical volume. When creating a logical volume, physical storage space is allocated for each logical volume. This physical storage space may be a disk of a certain storage device or several storage devices. The client stores data on a certain logical volume, that is, stores the data on the file system. The file system divides the data into many parts, and each part is an object. The object not only contains data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume respectively, and the file system will record the storage location information of each object. Thus, when the client requests to access the data, the file system can enable the client to access the data according to the storage location information of each object. The process of the storage system allocating physical storage space for the logical volume is specifically: according to the capacity estimation of the objects stored in the logical volume (this estimation often has a large margin relative to the actual capacity of the objects to be stored) and the group of Redundant Array of Independent Disk (RAID), the physical storage space is pre-divided into stripes, and a logical volume can be understood as a stripe, thereby allocating physical storage space for the logical volume.
[0091] Taking the realization of the cluster resource scheduling method provided by this application through the cloud server network as an example, workloads are configured in the cluster resource scheduling environment, and a timeout queue for carrying the workloads is determined; when the workloads in the timeout queue reach the timeout state, the controller component adjusts the state of the workloads to the secondary scheduling state; when the scheduler component determines that the state of the workloads is the secondary scheduling state, based on the information of the workloads, a failed replica number detection request is sent to the corresponding estimator component; the estimator component responds to the failed replica number detection request, determines the number of replicas with scheduling failures, and sends the number of replicas with scheduling failures to the scheduler component; the scheduler component executes a cluster resource scheduling program based on the number of replicas with scheduling failures to utilize the maximum available replica number in the cluster resource scheduling environment, thereby ensuring the availability of the workloads, improving the accuracy and reliability of the cluster resource scheduling, and enhancing the usage efficiency of the cluster resources.
[0092] Among them, when applied to cloud products, the front end of the cloud product can be a Web UI component, which is used to receive Spark-related parameters filled in by users and generate job data according to the Spark-related parameters. Among them, the ClusterManager can be an open-source cluster resource scheduling platform such as YARN, Mesos, or Kubernetes. Spark itself already supports these open-source platforms, that is, the protocols between the Spark component and the ClusterManager component are compatible. The Driver is the job driver, the Work Node is the working node, the Executor is the task execution component, and the task is the smallest execution unit. Further, the package of structured data (spark SQL) is a package used by Spark to operate on structured data. Through this Spark SQL, the SQL language can be used to query data, and this Spark SQL supports multiple data sources, such as data warehouse tool (Hive) tables, etc. The component for streaming computing is a component provided by Spark for performing streaming computing on real-time data, and it provides an application programming interface (API Application Programming Interface) for operating on data streams.
[0093] Step 302: When the workloads in the timeout queue reach the timeout state, the controller component adjusts the state of the workloads to the secondary scheduling state.
[0094] In some embodiments of the present invention, configuring workloads in the cluster resource scheduling environment and determining a timeout queue for carrying the workloads includes:
[0095] The controller component determines the expected number of replicas in the cluster resource scheduling environment; the controller component performs real-time detection on the workload based on the expected number of replicas; when the number of replicas in the workload is less than the expected number of replicas, the workload is adjusted to the timeout queue. Since the usage environments of cloud server clusters are diverse, the value of the expected number of replicas can be flexibly set according to the usage environment of the cloud server cluster. For example, when the cloud server cluster processes information such as Tenpay payment of instant messaging clients or information on borrowing funds to purchase items in instant messaging clients, due to the large number of tasks, the expected number of replicas can be set to 10,000; for video processing tasks that can be completed by a single server cluster, the expected number of replicas can be set to 100 to make full use of the resources of the server cluster and reduce resource waste in the server cluster.
[0096] In some embodiments of the present invention, when the number of replicas of the workload in the timeout queue changes, the controller component detects the workload in the timeout queue based on the expected number of replicas; when the number of replicas in the workload is less than the expected number of replicas, the workload is kept in the timeout queue; when the number of replicas in the workload is greater than or equal to the expected number of replicas, the workload in the timeout queue is deleted. Since the number of replicas of the workload in the timeout queue is dynamic data, by performing real-time detection on the workload in the timeout queue, the workload in the timeout queue can be adjusted in a timely manner, reducing the number of workloads for secondary resource adjustment.
[0097] Step 303: When the scheduler component of the cluster resource scheduling device determines that the state of the workload is the secondary scheduling state, a failed replica number detection request is sent to the corresponding estimator component based on the information of the workload.
[0098] Among them, the information of the workload may include: resources such as StatefulSet, Deployment, ReplicaSet, Daemonset, etc. These resource information includes the number of application instances and the affinity rules of the application instances, etc. Only application instances that match the affinity rules of the Workload can be deployed on this computing node. The resource objects in the Kubernetes cluster can be applications (APPs) in the Kubernetes cluster, for example, one or more of resources such as Deployment, StatefulSet, Ingress, pod, container, Service, ReplicationController (RC), etc.
[0099] Step 304: The estimator component of the cluster resource scheduling device responds to the failed replica number detection request, determines the number of replicas with scheduling failures, and sends the number of replicas with scheduling failures to the scheduler component.
[0100] The following is Figure 5 to further illustrate the working process of determining the number of replicas with scheduling failures.
[0101] Refer to Figure 5 , Figure 5 which is an optional process schematic diagram of the cluster resource scheduling method provided by an embodiment of the present invention. It can be understood that Figure 5 the steps shown can be executed by various electronic devices running the cluster resource scheduling device, such as a dedicated terminal with cluster resource scheduling function, a server, or a server cluster controller, a control terminal of a cloud network server. Among them, the dedicated terminal with the cluster resource scheduling device can be encapsulated in Figure 1 the server 200 shown to execute the corresponding software module in the cluster resource scheduling device shown in the previous Figure 2 The following will describe the steps shown in Figure 5 detail.
[0102] Step 501: The estimator component obtains the node information and container group information of all nodes in the sub-cluster in the cluster resource scheduling environment.
[0103] Step 502: The estimator component responds to the failed replica number detection request, queries the container group associated with the working replica in the sub-cluster, and determines the container group list corresponding to the container group.
[0104] In some embodiments of the present invention, when the type of the working copy is a resource type, determine the list of replica controller objects corresponding to the working copy; find the list of container groups associated with the working copy through the cache of the list of replica controller objects. Taking Kubernetes (K8S) as an example, a Kubernetes cluster generally includes a master node, and multiple computing nodes respectively communicatively connected to the master node. Among them, the master node is used to manage and control multiple computing nodes. The computing nodes are working load nodes, which contain the original application directly deployed in the nodes and multiple container groups (Pods). Each container group encapsulates one or more containers (Containers) for hosting the application. A Pod is the basic operation unit of Kubernetes and the smallest deployable unit that can be created, debugged, and managed. The type of the working copy is a resource type (Deployment type), and deployment type tasks can be deployed. Deployment integrates functions such as online deployment, rolling upgrade, replica creation, suspension of online tasks, resumption of online tasks, and rollback to a previous version (successful / stable) of Deployment. To some extent, Deployment can achieve unattended online deployment, greatly reducing the complex communication and operation risks during the online deployment process. For a working copy of the Deployment type, the list of ReplicaSet objects associated with the Deployment type can be determined first, and then the associated Pod list can be found from the cache through the replica controller ReplicaSet. Among them, ReplicaSet is a type of replica controller in Kubernetes, and its main function is to control the pods managed by the ReplicaSet to keep the number of pod replicas always maintained at a preset number.
[0105] In some embodiments of the present invention, when the type of the working copy is a stateful replica set type, find the list of container groups associated with the working copy in the cache of the working copy. Among them, for a working copy of the StatefulSet type, the list of Pod objects associated with the working copy of the StatefulSet type can be directly found from the cache to save the search time and improve the resource scheduling speed.
[0106] Step 503: The estimator component queries the container groups with scheduling failures from the list of container groups, and calculates the number of replicas with scheduling failures based on the container groups with scheduling failures.
[0107] Step 305: The scheduler component of the cluster resource scheduling device executes the cluster resource scheduling program based on the number of replicas with scheduling failures to achieve the maximum available number of replicas in the cluster resource scheduling environment.
[0108] In some embodiments of the present invention, before executing the cluster resource scheduler, it is also necessary to determine the maximum available replica number. Specifically, referring to Figure 6 , Figure 6 FIG. Figure 6 is an optional flowchart of the cluster resource scheduling method provided by an embodiment of the present invention. It can be understood that Figure 6 the steps shown can be executed by various electronic devices running the cluster resource scheduling device, such as a dedicated terminal with cluster resource scheduling function, a server, or a server cluster controller, a control terminal of a cloud network server. Among them, the dedicated terminal with the cluster resource scheduling device can be encapsulated in Figure 1 the server 200 shown in FIG. Figure 2 to execute the corresponding software modules in the cluster resource scheduling device shown in the previous Figure 2 FIG. Figure 6 . The following will describe the steps shown in Figure 6 FIG. .
[0109] Step 601: When the estimator component starts, the estimator component obtains the node information and container group information of all nodes in the sub-cluster in the cluster resource scheduling environment.
[0110] Step 602: In response to the maximum available replica number estimation request, the estimator component filters out the nodes that match the workload from all the nodes in the cluster resource.
[0111] Step 603: Determine the container group information corresponding to each node that matches the workload, and based on the container group information, determine the maximum available replica number of each node that matches the workload.
[0112] Step 604: Based on the maximum available replica number of each node that matches the workload, determine the maximum available replica number in the cluster resource scheduling environment.
[0113] The following takes the resource manager of the WeChat server as an example of the cluster resource manager to illustrate the cluster resource scheduling method involved in the present invention. Among them, in combination with Figure 1 FIG. Figure 1 showing the usage environment diagram of the cluster resource scheduling method of the embodiment of the present invention; terminals (including terminals 11-1 and 11-2) are provided with corresponding clients capable of performing different functions. Among them, the corresponding clients of the terminals (including terminals 11-1 and 11-2) obtain different information through the WeChat application from the corresponding server 200 through the network 300 for browsing. The terminals are connected to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and uses a wireless link to implement data transmission. Among them, the server 200 runs a cluster resource manager that matches the WeChat application to implement resource scheduling. The terminals (such as Figure 1On the terminals 10-1 and 10-2, a client that can display software for corresponding financial lending can also be set up. For example, a client or plugin for conducting financial activities through virtual resources or physical resources or for lending through virtual resources. Through the corresponding client, users can obtain loans from financial institutions or platforms (such as the instant messaging client Tenpay payment or the process of borrowing funds to purchase items in the instant messaging client); the terminal is connected to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and uses a wireless link to achieve data transmission. The server (such as Figure 1 the server 300 in) is the server of enterprises such as banks, securities, and Internet finance that provide financial services such as payment, lending, and wealth management. When users who need to handle relevant financial services use client devices to access the services provided by the enterprise's customer server, the customer server can issue a payment task by triggering a small program in the instant messaging client of the user terminal. Since the number of tasks is large, the expected replica number can be set to 10,000. When the server cluster processes these payment tasks, in order to avoid the problem of sub-cluster resource competition during task processing, which affects the accuracy and reliability of cluster resource scheduling, refer to Figure 7 , Figure 7 FIG. is an optional flow diagram of the cluster resource scheduling method provided by an embodiment of the present invention. The architecture of the cluster resource scheduling is as Figure 4 shown. The following will be described for Figure 7 the steps shown.
[0114] Step 701: Create a workload. The controller component continuously determines whether the workload has reached the expected replica number.
[0115] Step 702: When the workload does not reach the expected replica number, the controller component stores the workload in the timeout queue.
[0116] Step 703: When a replica number update event occurs for the workload in the timeout queue, the controller component determines whether the expected replica number has been reached. If it has been reached, it is deleted from the timeout queue; otherwise, it is re-added to the timeout queue.
[0117] Step 704: When a workload in the timeout queue triggers a timeout, the controller component adjusts the status of the workload to the secondary scheduling status and writes it into the workload.
[0118] Step 705: The scheduler component detects that the status of the workload is the secondary scheduling status.
[0119] Step 706: The scheduler sends a failed replica number detection request to the sub-cluster estimator according to the information of the workload.
[0120] Step 707: The estimator component continuously detects cluster replicas and nodes to count the cluster resource usage.
[0121] Step 708: The estimator component calculates the total number of replicas with scheduling failures according to the request and returns it to the scheduler component.
[0122] Step 709: The scheduler re-executes the scheduling program according to the total number of replicas with scheduling failures to generate a secondary scheduling result.
[0123] In some embodiments of the present invention, as shown in Figure 4 When the current workload A triggers secondary scheduling and there are cases where replica scheduling fails in sub-cluster 1, the expected number of replicas of workload A in sub-cluster 1, sub-cluster 2, and sub-cluster 3 are r1, r2, and r3 respectively, the number of replicas with scheduling failures in sub-cluster 1 is f1, and the maximum available number of replicas in sub-cluster 2 and sub-cluster 3 are m2 and m3 respectively.
[0124] During the process of generating the secondary scheduling result, when m2 + m3 >= f1, the scheduler component fixes the expected number of replicas of workload A in sub-cluster 1 as r1 - f1, and then takes sub-cluster 2 and sub-cluster 3 as candidate clusters, and distributes the f1 failed replicas according to the ratio of the maximum available number of replicas m2:m3 as the secondary scheduling result of the failed replicas.
[0125] During the process of generating the secondary scheduling result, when m2 + m3 < f1, it is determined that this secondary scheduling fails, and wait for the next scheduling until the secondary scheduling is successful.
[0126] The present invention has the following beneficial technical effects:
[0127] The present invention configures workloads in a cluster resource scheduling environment and determines a timeout queue for carrying the workloads; when the workloads in the timeout queue reach the timeout state, the controller component adjusts the state of the workloads to the secondary scheduling state; when the scheduler component determines that the state of the workloads is the secondary scheduling state, based on the information of the workloads, it sends a failed replica number detection request to the corresponding estimator component; the estimator component responds to the failed replica number detection request, determines the number of replicas with scheduling failures, and sends the number of replicas with scheduling failures to the scheduler component; the scheduler component executes the cluster resource scheduling program based on the number of replicas with scheduling failures to achieve the use of the maximum available number of replicas in the cluster resource scheduling environment, and can execute the cluster resource scheduling program based on the number of replicas with scheduling failures to achieve the use of the maximum available number of replicas in the cluster resource scheduling environment, ensure the availability of the workloads, improve the accuracy and reliability of the cluster resource scheduling, improve the utilization efficiency of the cluster resources, ensure the data processing speed of cloud server users, and improve the user experience.
[0128] As described above, these are only embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A cluster resource scheduling method, characterized in that, the method includes: configuring a workload in a cluster resource scheduling environment and determining a timeout queue for carrying the workload; when the workload in the timeout queue reaches the timeout state, the controller component adjusts the state of the workload to the secondary scheduling state; when the scheduler component determines that the state of the workload is the secondary scheduling state, based on the information of the workload, it sends a failed replica number detection request to the corresponding estimator component; when the estimator component starts, the estimator component obtains the node information and container group information of the nodes in the sub-cluster of the cluster resource scheduling environment; the estimator component responds to the maximum available replica number estimation request, and filters nodes that match the workload from the nodes of the cluster resources based on the node information; determines the container group information corresponding to each node that matches the workload, and based on the container group information, determines the maximum available replica number of each node that matches the workload; based on the maximum available replica number of each node that matches the workload, determines the maximum available replica number in the cluster resource scheduling environment; the estimator component responds to the failed replica number detection request, determines the number of replicas with scheduling failures, and sends the number of replicas with scheduling failures to the scheduler component; the scheduler component executes a cluster resource scheduling program based on the number of replicas with scheduling failures to achieve the use of the maximum available replica number in the cluster resource scheduling environment.
2. The method according to claim 1, characterized in that, the configuring a workload in a cluster resource scheduling environment and determining a timeout queue for carrying the workload includes: the controller component determines the desired replica number of the cluster resource scheduling environment; the controller component performs real-time detection on the workload based on the desired replica number; when the number of replicas in the workload is less than the desired replica number, the workload is adjusted to the timeout queue.
3. The method according to claim 2, characterized in that, the method further includes: when the number of replicas of the workload in the timeout queue changes, the controller component performs detection on the workload in the timeout queue based on the desired replica number; when the number of replicas in the workload is less than the desired replica number, the workload is kept in the timeout queue; when the number of replicas in the workload is greater than or equal to the desired replica number, the workload in the timeout queue is deleted.
4. The method according to claim 1, characterized in that, the estimator component responds to the failed replica number detection request and determines the number of replicas with scheduling failures, including: the estimator component obtains the node information and container group information of all nodes in the sub-cluster of the cluster resource scheduling environment; the estimator component responds to the failed replica number detection request, queries the container group associated with the working replica in the sub-cluster, and determines the container group list corresponding to the container group; The estimator component queries the container groups with scheduling failures from the list of container groups, and calculates the number of failed replicas based on the container groups with scheduling failures.
5. The method according to claim 4, wherein, in response to the failed replica number detection request, the estimator component queries the container groups associated with the working replicas in the sub-cluster, and determines the corresponding list of container groups for the container groups, including: when the type of the working replica is a resource type, determining the list of replica controller objects corresponding to the working replica; finding the list of container groups associated with the working replica through the cache of the list of replica controller objects; when the type of the working replica is a state replica set type, finding the list of container groups associated with the working replica in the cache of the working replica.
6. A cluster resource scheduling device, wherein, the device includes: an information transmission device, configured to configure a workload in a cluster resource scheduling environment and determine a timeout queue for carrying the workload; an information processing device, when the workload in the timeout queue reaches a timeout state, the controller component adjusts the state of the workload to a secondary scheduling state; the information processing device, when the scheduler component determines that the state of the workload is the secondary scheduling state, sends a failed replica number detection request to the corresponding estimator component based on the information of the workload; when the estimator component is started, the estimator component obtains the node information and container group information of the nodes in the sub-cluster of the cluster resource scheduling environment; the estimator component, in response to the maximum available replica number estimation request, filters the nodes matching the workload from the nodes of the cluster resources based on the node information; determines the container group information corresponding to each node matching the workload, and determines the maximum available replica number of each node matching the workload based on the container group information; determines the maximum available replica number in the cluster resource scheduling environment based on the maximum available replica number of each node matching the workload; the information processing device, when the estimator component responds to the failed replica number detection request, determines the number of failed replicas and sends the number of failed replicas to the scheduler component; the information processing device, the scheduler component executes a cluster resource scheduling program based on the number of failed replicas to utilize the maximum available replica number in the cluster resource scheduling environment.
7. An electronic device, wherein, the electronic device includes: a memory for storing executable instructions; a processor, when running the executable instructions stored in the memory, implements the cluster resource scheduling method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing executable instructions, wherein, when the executable instructions are executed by a processor, the cluster resource scheduling method according to any one of claims 1 to 5 is implemented.
9. A computer program product including a computer program or instructions, wherein, When the computer program or instruction is executed by a processor, the cluster resource scheduling method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Resource scalable combination scheduling method in kubernetes
CN110347490A
Multi-cluster resource scheduling method, device and system
CN112445575A