CN113382077B - Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium - Google Patents

Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium Download PDF

Info

Publication number
CN113382077B
CN113382077B CN202110680340.3A CN202110680340A CN113382077B CN 113382077 B CN113382077 B CN 113382077B CN 202110680340 A CN202110680340 A CN 202110680340A CN 113382077 B CN113382077 B CN 113382077B
Authority
CN
China
Prior art keywords
node
micro
service
resources
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110680340.3A
Other languages
Chinese (zh)
Other versions
CN113382077A (en
Inventor
刘欣然
江雄烽
韦洪波
阮诗迪
韦昌福
唐羿轩
韦建成
齐鹏辉
郑志豪
龚舒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangxi Power Grid Co Ltd
Original Assignee
Guangxi Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangxi Power Grid Co Ltd filed Critical Guangxi Power Grid Co Ltd
Priority to CN202110680340.3A priority Critical patent/CN113382077B/en
Publication of CN113382077A publication Critical patent/CN113382077A/en
Application granted granted Critical
Publication of CN113382077B publication Critical patent/CN113382077B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a micro-service scheduling method, a micro-service scheduling device, computer equipment and a storage medium. The method comprises the following steps: acquiring a node state directory of a container management system, wherein the node state directory comprises available operation resources of each node in the container management system; acquiring target operation resources required by normal operation of the micro-service to be scheduled; and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation. When the micro-service scheduling is performed, the target node is determined by combining two influencing factors of the operation resources required by normal operation of the micro-service to be scheduled and the available operation resources of each node. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.

Description

Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of micro-service scheduling technologies, and in particular, to a micro-service scheduling method, apparatus, computer device, and storage medium.
Background
With the continued development of grid monitoring technology, traditional monolithic architectures have not met the needs in some ways well, based on which the system application of micro-service architecture has emerged.
The system of the micro-service architecture is a distributed system, and is divided into independent service units according to the service, each micro-service only focuses on completing one service, and the combined action of a plurality of micro-services can realize the normal operation of one application. The container service orchestration program (K8 s) system is a cluster management platform based on containers, and is used for managing containerized applications on a plurality of hosts in the cloud platform, and micro services are used as a small service in the applications and can be deployed and operated by means of containers of all nodes in the K8s system.
However, in the K8s system, when a node simultaneously floods into a large number of micro-service containers, the node may be in a congestion state, and even the node may crash, so that the micro-service carried by the node container is not available.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a micro-service scheduling method, apparatus, computer device, and storage medium that can efficiently schedule micro-services and balance the load distribution of each node.
In a first aspect, a method for micro-service scheduling is provided, the method comprising:
acquiring a node state directory of the container management system, wherein the node state directory comprises available operation resources of each node in the container management system;
acquiring target operation resources required by normal operation of the micro-service to be scheduled;
and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation.
In one embodiment, obtaining a node state directory of a container management system includes:
acquiring node operation information of each node in the container management system;
determining available operation resources of each node according to the node operation information;
and sorting the available operation resources of each node according to a preset specification to generate a node state catalog.
In one embodiment, obtaining node operation information of each node in the container management system includes:
transmitting a state reporting instruction to each node, wherein the state reporting instruction is used for indicating each node to report node operation information;
and receiving node operation information reported by each node.
In one embodiment, determining a target node from nodes in a container management system according to a target running resource and a node state directory, and deploying a micro-service to be scheduled to the target node to run, including:
acquiring at least one candidate node from the node state catalog according to available operation resources and target operation resources of each node in the container management system;
and determining a target node from at least one candidate node, and deploying the micro-service to be scheduled to the target node for operation.
In one embodiment, the node operation information further includes a node link, where the node link is used to indicate a transfer path between a node where the micro service to be scheduled is located and each node;
determining a target node from the at least one candidate node, comprising:
acquiring a transfer path between a node where a micro-service to be scheduled is located and each candidate node;
and determining the candidate nodes of which the transfer paths meet the preset conditions as target nodes.
In one embodiment, according to available operation resources and target operation resources of each node in the container management system, obtaining at least one candidate node from the node state catalog includes:
and determining the node with the available operation resource larger than the target operation resource as a candidate node according to the available operation resource and the target operation resource of each node in the container management system.
In one embodiment, the node operation information includes: and if the CPU occupancy rate and the memory occupancy rate are the same, the available operation resources comprise available CPU resources and available memory resources.
In a second aspect, there is provided a micro-service scheduling apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a node state directory of the container management system, wherein the node state directory comprises available operation resources of all nodes in the container management system;
the second acquisition module is used for acquiring target operation resources required by normal operation of the micro-service to be scheduled;
and the scheduling module is used for determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation.
In a third aspect, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of any of the micro-service scheduling methods of the first aspect described above when the computer program is executed by the processor.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the micro-service scheduling methods of the first aspect described above.
The micro-service scheduling method, the micro-service scheduling device, the computer equipment and the storage medium acquire the node state catalogue of the container management system, wherein the node state catalogue comprises available operation resources of each node in the container management system; acquiring target operation resources required by normal operation of the micro-service to be scheduled; and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation. In the method, in order to avoid the situations that the micro-service to be scheduled cannot normally run after being deployed on the node due to overlarge running resources of the micro-service to be scheduled and too few available resources of the node, the node is blocked and the like, when the micro-service scheduling is carried out, two influencing factors of the running resources required by the micro-service to be scheduled in normal running and the available running resources of each node are comprehensively considered to determine the target node. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.
Drawings
FIG. 1 is a schematic diagram of a container management system according to one embodiment of the present application;
FIG. 2 is a flow chart of a micro service scheduling method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a micro service scheduling method according to another embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a micro service scheduling method according to another embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a micro service scheduling method according to another embodiment of the present disclosure;
FIG. 6 is a flowchart illustrating a micro service scheduling method according to another embodiment of the present disclosure;
FIG. 7 is a block diagram of a micro service scheduling apparatus according to one embodiment of the present application;
fig. 8 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Before explaining the micro-service expansion method of the application, the nouns and application environments related to the application are explained.
Kubernetes system: the container service orchestration program (Kubernetes, K8 s) provides application deployment, maintenance, and extension mechanisms, etc., and can conveniently manage running containerized applications across machines using a K8s system, which can run on physical machines.
The K8s system consists of a control node and an operation node according to node functions.
Wherein the control node is responsible for scheduling and managing the whole system, and comprises an API Server (service interface) component, a Scheduler component and a Controller Manager (control center) component.
API Server as the entrance of K8s system encapsulates the add-drop-check operation of core object, provides external clients and internal component calls in RESTful (Representational state transfer ) interface mode, and maintains REST object to be persisted to etcd (key value storage system mainly used for shared configuration and service discovery). Schedulers are responsible for resource scheduling of clusters, allocating machines for newly built pod, and this part of work is split into one component, meaning that it can be replaced with other schedulers very conveniently. Controller Manager is a manager of various controllers in the K8s system, and is a control center inside the cluster, and is responsible for executing various controllers. There are generally two types of controllers: an endpoint controller and a replica controller. The endpoint controller (Endpoint Controller) periodically associates a service with a pod (association information is maintained by an endpoint object), ensuring that the mapping of the service to the pod is always up-to-date; the replica controller (Replication Controller) periodically associates replication Controller with the pod, ensuring that the number of replications replication Controller define always corresponds to the number of pods actually running.
The operation node may be a physical host or a Virtual Machine (VM) responsible for operating the service container. A service for starting and managing pod, kubelet, is run on each running node and can be managed by the control node. Service processes running on the running node include kubelet, kube-proxy, and docker daemon.
Kubelet responsibility controls the docker container, such as start/stop and monitor operating status, etc., which periodically retrieves the pod assigned to the host from etcd and starts or stops the corresponding container based on the pod information. Meanwhile, the method also receives an HTTP request of the API Server and reports the running state of the pod. Kube Proxy is responsible for providing Proxy for pod, it will periodically obtain all services from etcd, and create Proxy according to the services information, when a certain client pod will access other pod, the access request will be forwarded through the local Proxy. The docker deamon listens to the client's requests and manages the docker's mirror, container, network, disk, etc. Where the docker mirror is a read-only template that can be used to create the docker container. The image is a lightweight, executable, stand-alone software package used to package software runtime environments and software developed based on the runtime environments. It contains all the content needed to run a certain software, including code, runtime, libraries, environment variables, configuration files, etc.
Micro-services: a variant of a software development technology Service Oriented Architecture (SOA) architectural style constructs an application as a set of loosely coupled services. In a micro-service architecture, the services are fine-grained and the protocol is lightweight. The micro service architecture splits a complex application into multiple service modules, and each module focuses on a single service function to provide services to the outside. The service modules can be compiled and deployed independently, and meanwhile, the service modules can be communicated with each other and combined into a whole to provide services to the outside, so that the micro-service architecture has the advantages of flexible deployment, convenient updating and maintenance and the like, and is widely applied to a large number of applications and services of the current Internet.
The micro-service scheduling method provided by the application can be applied to an application environment shown in figure 1. Wherein the container management system 100 includes a control center 110 and a plurality of nodes 120, the control center 110 communicates with the plurality of nodes 120 through a network. In the K8s system architecture, the node 120 is an operation node in the K8s system, and may be a virtual machine or a physical server; the control center 110 is a control node in the K8s system, and may be a terminal device.
Each node 120 has an assigned pod that can be viewed as a "logical host" of the application layer by a containerized environment. The Pod may include multiple containers and the applications corresponding to the multiple containers in the Pod are typically tightly coupled, each container carrying a micro-service, the Pod being created, launched or destroyed on the node 120.
The control center 110 is responsible for resource quota management in the K8s system, ensures that the designated object does not occupy excessive system resources at any time, and avoids the problem that the whole system is in operation disorder or even unexpected downtime caused by the defects of design or realization of certain service processes, thereby playing a very important role in the stable operation and stability of the whole cluster.
Each node is provided with a plurality of containers, micro services are carried in the containers, when a node deploys a large number of containers simultaneously and carries more micro services, the node may be in a congestion state, even the node is halted, and the micro services carried in the node containers are not available.
Based on this, in the embodiment of the present application, when any micro service needs to be scheduled, the control center 110 may determine, according to the available operation resources on each node 120 and the operation resources required for the normal operation of the micro service to be scheduled, the node where the micro service to be scheduled is deployed.
In one embodiment, as shown in fig. 2, a micro service scheduling method is provided, and the method is applied to the control center 110 in fig. 1 for illustration, and includes the following steps:
step 210: the method comprises the steps of obtaining a node state catalog of the container management system, wherein the node state catalog comprises available operation resources of all nodes in the container management system.
The container management system comprises nodes, wherein micro services are deployed on each node, and node resources required to be occupied by different micro services are different. Thus, the number of micro services that can be deployed on a node depends on the available operating resources of the node, including available central processing unit (central processing unit, CPU) resources and available memory resources.
In one possible implementation manner, when the control center is connected with a plurality of nodes, the operation resources of each node are stored, and the corresponding relationship between the nodes and the operation resources of the nodes is established, so that the node state catalog of the container management system is obtained.
The corresponding relationship between the node and the node operation resource can be represented in a list or a topology structure, and the application is not limited to this. Along with the change condition of the number of the node deployment micro services, the control center updates the operation resources of each node to determine the available operation resources of each node.
Step 220: and obtaining target operation resources required by normal operation of the micro-service to be scheduled.
The micro-service to be scheduled can be an added micro-service to be deployed in the container management system, or an original micro-service on any node in the container management system, but the micro-service needs to be scheduled to other nodes for operation.
The target operation resources are CPU resources and memory resources which are needed to be occupied by the normal operation of the micro-service to be scheduled.
Step 230: and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation.
It can be appreciated that the available operating resources of a node can ensure that the micro-service to be scheduled can be deployed on the node only when the micro-service to be scheduled is operating normally. In other words, if the available operation resources of the node cannot guarantee the normal operation of the micro-service to be scheduled, the micro-service to be scheduled cannot be deployed on the node, otherwise, a congestion state of the node is caused, even the node crashes, and the normal operation of other micro-services borne by the node container is affected.
In one possible implementation manner, the implementation process of the step 230 may be: and determining a node with the available CPU resource larger than the CPU resource required by the micro-service operation to be scheduled and the available memory resource larger than the memory resource required by the micro-service operation to be scheduled as a target node in the node state catalog according to the CPU resource required by the micro-service operation to be scheduled, the memory resource and the node state catalog of the container management system, and deploying the micro-service to be scheduled to the target node for operation.
In the embodiment of the application, a node state directory of a container management system is obtained, wherein the node state directory comprises available operation resources of all nodes in the container management system; acquiring target operation resources required by normal operation of the micro-service to be scheduled; and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation. In the method, in order to avoid the situations that the micro-service to be scheduled cannot normally run after being deployed on the node due to overlarge running resources of the micro-service to be scheduled and too few available resources of the node, the node is blocked and the like, when the micro-service scheduling is carried out, two influencing factors of the running resources required by the micro-service to be scheduled in normal running and the available running resources of each node are comprehensively considered to determine the target node. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.
In one embodiment, as shown in fig. 3, the implementation process of obtaining the node state directory (step 210 above) of the container management system includes the following steps:
step 310: node operation information of each node in the container management system is obtained.
In one possible implementation, the node operation information includes a CPU occupancy rate and a memory occupancy rate, and in another implementation, the node operation information includes occupied CPU resources and occupied memory resources, where both of the node operation information may reflect a duty cycle of unavailable resources in the node.
The implementation process of step 310 may be: the control center sends a state reporting instruction to each node, wherein the state reporting instruction is used for indicating each node to report node operation information; and the control center receives node operation information reported by each node.
As an example, the state report information request terminal collects IP address information of each node in the K8s system, then sends a state report instruction to each node in the K8s system based on the IP address information, and after each node in the K8s system receives the state report instruction, sends node operation information in response to the state report instruction to the state report information request terminal, so that the state report information request terminal can obtain node operation information of each node in the K8s system.
It should be noted that, the IP address information of the node may be a physical IP address of the node in the K8s system or a virtual IP address of the node, which is not limited in this application.
It can be understood that the status report information request end may be a control node in the K8s system (i.e. the control center 110 in the container management system 100 shown in fig. 1 of the present application), or may be a control terminal outside the K8s system, which is not limited in this application.
Step 320: and determining available operation resources of each node according to the node operation information.
Wherein the available operating resources of the node include available CPU resources and available memory resources.
In one possible implementation, the control center 110 stores the total operating resources of each node when communication is established with each node. Thus, after the node operation information reported by the node is received, the available operation resources of the node can be determined according to the total operation resources of the node and the resource occupancy rate/occupied resources reported by the node.
As one example, for any node, its available CPU resource determination process is:
available CPU resource = total CPU resource-total CPU resource x CPU occupancy;
available CPU resource = total CPU resource-occupied CPU resource.
Similarly, for any node, the available memory resource determination process is:
available memory resources = total memory resources-total memory resources x memory occupancy;
available memory resources = total memory resources-occupied memory resources.
Step 330: and sorting the available operation resources of each node according to a preset specification to generate a node state catalog.
The preset specifications may include, but are not limited to, the following:
(1) The order of available operating resources from large to small;
(2) The order of available operating resources from small to large;
(3) And the connection sequence can be established by the node corresponding to the operation resource and the control center.
The node state directory includes node information and available operation resources of the node, where the node information may include information such as a node name, a node IP address, a node identifier, a node deployment container, and the like, which is not limited in this application.
In the embodiment of the application, the available operation resources of each node are acquired through a node reporting form, and the available operation resources of all nodes are sorted according to a preset specification to obtain a node state catalog. Thus, the available resources of each node in the container management system can be clearly known through the node state catalogue.
Based on any of the embodiments described above, in one possible implementation, see fig. 4. If the micro service to be scheduled is a newly added micro service, the implementation process of deploying the micro service to be scheduled to the target node operation (step 230 above) according to the target operation resource and the node state directory includes the following steps:
step 410: and acquiring at least one candidate node from the node state catalog according to the available operation resources and the target operation resources of each node in the container management system.
The available operation resources of the node comprise available CPU resources and available memory resources, and the target operation resources of the micro service to be scheduled comprise target CPU resources and target memory resources.
In one possible implementation, the implementation procedure of step 410 is: and determining the node with the available operation resource larger than the target operation resource as a candidate node according to the available operation resource and the target operation resource of each node in the container management system.
As an example, the available CPU resources and the available memory resources of each node are checked through the node state directory, the available CPU resources are greater than the target CPU resources, and the nodes with the available memory resources greater than the target memory resources are determined as candidate nodes, so as to obtain at least one candidate node.
Step 420: and determining a target node from at least one candidate node, and deploying the micro-service to be scheduled to the target node for operation.
When the candidate node is one, the candidate node is taken as a target node; when the candidate nodes are two or more, one node is selected from the two or more candidate nodes as a target node.
As one example, the process of selecting a target node from two or more candidate nodes may be: taking one candidate node with the largest difference value between the available operation resources of the node and the target operation resources as a target node; or, taking one candidate node with the largest difference between the target available CPU resource and the target CPU resource as a target node; or, taking a candidate node with the largest difference between the available memory resource and the target memory resource as the target node; alternatively, a candidate node is arbitrarily designated as the target node, which is not limited in this application.
After the target node is determined, a container for running the micro-service to be scheduled is created on the target node to deploy the micro-service to be scheduled to the target node for running.
In the embodiment of the application, two influencing factors of the operation resources required by normal operation of the micro-service to be scheduled and the available operation resources of each node are comprehensively considered, a target node is determined from the node state catalog, and the micro-service to be scheduled is deployed to the target node for operation. Therefore, deployment of the micro-services to be scheduled is realized, balanced distribution of the micro-services on each node in the container management system is ensured, and each micro-service can normally operate.
In another possible implementation, based on the above embodiment, see fig. 5. If the micro service to be scheduled is the original micro service of any node in the container management system, the implementation process of deploying the micro service to be scheduled to the target node according to the target operation resource and the node state directory (step 230 above) includes the following steps:
step 510: and acquiring at least one candidate node from the node state catalog according to the available operation resources and the target operation resources of each node in the container management system.
Step 510 is the same as step 410, and the specific implementation process is referred to step 410, and will not be repeated here.
Step 520: and obtaining a transfer path between the node where the micro-service to be scheduled is located and each candidate node.
When communication is established between each node in the control center 110, that is, when the micro-service deployment condition of each node is stored, the control center may also add a transition path between each node and other nodes in the node state directory when generating the state directory according to the node operation information reported by each node.
That is, the node state directory of the container management system includes: a plurality of nodes, available operating resources for each node, and a transition path between each node.
In one possible implementation manner, the implementation process of the step 520 may be: and acquiring a node state catalog of the container management system, and inquiring a transfer path between the node and other candidate nodes from the node state catalog according to the node where the micro-service to be scheduled is located.
Step 530: and determining the candidate nodes of which the transfer paths meet the preset conditions as target nodes, and deploying the micro-services to be scheduled to the target nodes for operation.
The preset condition may be that the transfer path is shortest, or that the time consumed when the micro service is scheduled based on the transfer path is shortest, which is not limited in the present application.
As one example, the process of selecting a target node from two or more candidate nodes may be: and taking the candidate node corresponding to the path with the shortest transfer path as the target node.
After the target node is determined, a container for running the micro-service to be scheduled is created on the target node to deploy the micro-service to be scheduled to the target node for running.
In the embodiment of the application, at least one candidate node is determined from the node state catalog according to the operation resources required by the normal operation of the micro-service to be scheduled and the available operation resources of each node, and the micro-service to be scheduled can normally operate on the candidate node. Further, considering the micro-service scheduling path and time, determining a target node from the candidate nodes according to the transfer path between the node where the micro-service to be scheduled is located and each candidate node, and deploying the micro-service to be scheduled to the target node for operation. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.
Based on the above embodiment, as shown in fig. 6, the present application further provides another micro-service scheduling method, which is described by taking the control center 110 in fig. 1 as an example, and includes the following steps:
step 610: transmitting a state reporting instruction to each node, wherein the state reporting instruction is used for indicating each node to report node operation information;
step 620: receiving node operation information reported by each node;
step 630: determining available operation resources of each node according to the node operation information;
step 640: sorting available operation resources of each node according to a preset specification to generate a node state catalog;
step 650: acquiring target operation resources required by normal operation of the micro-service to be scheduled;
step 660: acquiring at least one candidate node from the node state catalog according to available operation resources and target operation resources of each node in the container management system;
step 670: and determining a target node from at least one candidate node, and deploying the micro-service to be scheduled to the target node for operation.
Step 680: acquiring a transfer path between a node where a micro-service to be scheduled is located and each candidate node;
step 690: and determining the candidate nodes of which the transfer paths meet the preset conditions as target nodes, and deploying the micro-services to be scheduled to the target nodes for operation.
The specific implementation process of the above steps may refer to the corresponding embodiments of fig. 2 to 5, which will not be described herein again, and by the above micro-service scheduling method, when performing micro-service scheduling, two influencing factors of the operation resources required for normal operation of the micro-service to be scheduled and the available operation resources of each node are comprehensively considered to determine the target node. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.
It should be understood that, although the steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-6 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 7, there is provided a micro service scheduling apparatus 700 comprising: a first acquisition module 710, a second acquisition module 720, and a scheduling module 730, wherein:
a first obtaining module 710, configured to obtain a node state directory of the container management system, where the node state directory includes available operation resources of each node in the container management system;
a second obtaining module 720, configured to obtain a target operation resource required for normal operation of the micro-service to be scheduled;
the scheduling module 730 is configured to determine a target node from the nodes in the container management system according to the target running resource and the node state directory, and deploy the micro-service to be scheduled to the target node for running.
In one embodiment, the first acquisition module 710 includes:
the first acquisition unit is used for acquiring node operation information of each node in the container management system;
the first determining unit is used for determining available operation resources of each node according to the node operation information;
and the catalog generating unit is used for sorting the available operation resources of each node according to a preset specification and generating a node state catalog.
In one embodiment, the first obtaining unit is further configured to:
transmitting a state reporting instruction to each node, wherein the state reporting instruction is used for indicating each node to report node operation information;
and receiving node operation information reported by each node.
In one embodiment, the scheduling module 730 includes:
the second acquisition unit is used for acquiring at least one candidate node from the node state catalog according to the available operation resources and the target operation resources of each node in the container management system;
and the second determining unit is used for determining a target node from at least one candidate node and deploying the micro-service to be scheduled to the target node for operation.
In one embodiment, the node operation information further includes a node link, where the node link is used to indicate a transfer path between a node where the micro service to be scheduled is located and each node;
the second determining unit is further configured to:
acquiring a transfer path between a node where a micro-service to be scheduled is located and each candidate node;
and determining the candidate nodes of which the transfer paths meet the preset conditions as target nodes.
In one embodiment, the second obtaining unit is further configured to:
and determining the node with the available operation resource larger than the target operation resource as a candidate node according to the available operation resource and the target operation resource of each node in the container management system.
In one embodiment, the node operation information includes: and if the CPU occupancy rate and the memory occupancy rate are the same, the available operation resources comprise available CPU resources and available memory resources.
In the embodiment of the present application, the micro service scheduling device 600 acquires a node state directory of the container management system, where the node state directory includes available operation resources of each node in the container management system; acquiring target operation resources required by normal operation of the micro-service to be scheduled; and determining a target node from all nodes in the container management system according to the target operation resource and the node state catalog, and deploying the micro-service to be scheduled to the target node for operation. In the method, in order to avoid the situation that the micro-service to be scheduled cannot normally run after being deployed on the node due to overlarge running resources of the micro-service to be scheduled and too few available resources of the node, and the node is blocked, when the micro-service scheduling is carried out, two influencing factors of the running resources required by the normal running of the micro-service to be scheduled and the available running resources of each node are comprehensively considered, and the target node is determined. Therefore, the micro-service scheduling efficiency is improved, the micro-service on each node in the container management system is guaranteed to be distributed uniformly, and each micro-service can operate normally.
The specific limitation of the micro service scheduling apparatus may be referred to the limitation of the micro service scheduling method hereinabove, and will not be described herein. The modules in the micro service scheduling apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 8. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program when executed by a processor implements a micro-service scheduling method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided that includes a memory having a computer program stored therein and a processor that when executing the computer program performs the steps of any of the micro-service scheduling methods shown in the embodiments of the present application.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor implements the steps of any of the micro-service scheduling methods shown in the embodiments of the present application.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (9)

1. A method of micro-service scheduling, the method comprising:
acquiring target operation resources required by normal operation of the micro-service to be scheduled;
acquiring node operation information of each node in the container management system;
determining available operation resources of each node according to the node operation information;
sorting the available operation resources of each node according to a preset specification, and generating a node state directory based on the transfer paths between each node and other nodes;
acquiring at least one candidate node from the node state catalog according to available operation resources of each node in the container management system and the target operation resources;
obtaining a transfer path between the node where the micro-service to be scheduled is located and each candidate node from the node state catalog;
determining a candidate node of the transfer path meeting a preset condition as a target node, wherein the preset condition is that the transfer path is shortest, or that time consumption is shortest when micro service is scheduled based on the transfer path;
and deploying the micro-service to be scheduled to the target node for operation.
2. The method for micro-service scheduling according to claim 1, wherein the obtaining node operation information of each node in the container management system includes:
transmitting a state reporting instruction to each node, wherein the state reporting instruction is used for indicating each node to report node operation information;
and receiving node operation information reported by each node.
3. The method for scheduling micro services according to claim 1, wherein the micro services to be scheduled are newly added micro services to be deployed in the container management system or original micro services on any node in the container management system, and the original micro services need to be scheduled to other nodes for operation.
4. The micro service scheduling method according to claim 1, wherein the preset specification includes any one of the following:
the available operation resources are in sequence from large to small;
the order of the available operation resources from small to large;
and establishing the connection sequence between the node corresponding to the available operation resource and the control center.
5. The method of micro-service scheduling according to claim 1, wherein the obtaining at least one candidate node from the node state directory according to the available operation resources and the target operation resources of each node in the container management system includes:
and determining the node with the available operation resource larger than the target operation resource as the candidate node according to the available operation resource of each node in the container management system and the target operation resource.
6. The micro service scheduling method of claim 1, wherein the node operation information includes: and if the CPU occupancy rate and the memory occupancy rate are the same, the available operation resources comprise available CPU resources and available memory resources.
7. A micro service scheduling apparatus, the apparatus comprising:
the first acquisition module is used for acquiring node operation information of each node in the container management system; determining available operation resources of each node according to the node operation information; sorting the available operation resources of each node according to a preset specification, and generating a node state directory based on the transfer paths between each node and other nodes;
the second acquisition module is used for acquiring target operation resources required by normal operation of the micro-service to be scheduled;
the scheduling module is used for acquiring at least one candidate node from the node state catalog according to the available operation resources and the target operation resources of each node in the container management system; obtaining a transfer path between the node where the micro-service to be scheduled is located and each candidate node from the node state catalog; determining a candidate node of the transfer path meeting a preset condition as a target node, wherein the preset condition is that the transfer path is shortest, or that time consumption is shortest when micro service is scheduled based on the transfer path; and deploying the micro-service to be scheduled to the target node for operation.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the micro service scheduling method of any one of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the micro service scheduling method of any of claims 1 to 6.
CN202110680340.3A 2021-06-18 2021-06-18 Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium Active CN113382077B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110680340.3A CN113382077B (en) 2021-06-18 2021-06-18 Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110680340.3A CN113382077B (en) 2021-06-18 2021-06-18 Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113382077A CN113382077A (en) 2021-09-10
CN113382077B true CN113382077B (en) 2023-05-23

Family

ID=77577796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110680340.3A Active CN113382077B (en) 2021-06-18 2021-06-18 Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113382077B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114546812B (en) * 2022-04-27 2022-07-22 网思科技股份有限公司 Energy consumption measuring method and device for application service, computer equipment and storage medium
CN115379019A (en) * 2022-08-19 2022-11-22 济南浪潮数据技术有限公司 Service scheduling method, device, equipment and storage medium
CN117687739A (en) * 2022-09-05 2024-03-12 华为云计算技术有限公司 Resource scheduling method and related equipment thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104227A (en) * 2019-12-28 2020-05-05 北京浪潮数据技术有限公司 Resource control method and device of K8s platform and related components
CN111464659A (en) * 2020-04-27 2020-07-28 广州虎牙科技有限公司 Node scheduling method, node pre-selection processing method, device, equipment and medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255052B2 (en) * 2017-05-30 2019-04-09 International Business Machines Corporation Dynamic deployment of an application based on micro-services
US11360825B2 (en) * 2019-12-17 2022-06-14 Citrix Systems, Inc. Systems and methods for service resource allocation and deployment
CN112214321B (en) * 2020-10-10 2023-06-16 中国联合网络通信集团有限公司 Node selection method and device for newly added micro service and micro service management platform
CN112269641B (en) * 2020-11-18 2023-09-15 网易(杭州)网络有限公司 Scheduling method, scheduling device, electronic equipment and storage medium
CN112685153A (en) * 2020-12-25 2021-04-20 广州奇盾信息技术有限公司 Micro-service scheduling method and device and electronic equipment
CN112631680A (en) * 2020-12-28 2021-04-09 南方电网数字电网研究院有限公司 Micro-service container scheduling system, method, device and computer equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104227A (en) * 2019-12-28 2020-05-05 北京浪潮数据技术有限公司 Resource control method and device of K8s platform and related components
CN111464659A (en) * 2020-04-27 2020-07-28 广州虎牙科技有限公司 Node scheduling method, node pre-selection processing method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
左灿 ; 刘晓洁 ; .一种改进的Kubernetes动态资源调度方法.数据通信.2019,(第02期),全文. *

Also Published As

Publication number Publication date
CN113382077A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
EP3637733B1 (en) Load balancing engine, client, distributed computing system, and load balancing method
CN106919445B (en) Method and device for scheduling containers in cluster in parallel
US8104038B1 (en) Matching descriptions of resources with workload requirements
CN111880936B (en) Resource scheduling method, device, container cluster, computer equipment and storage medium
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN112506659A (en) Management method of edge device and related device
CN105786603B (en) Distributed high-concurrency service processing system and method
EP3442201B1 (en) Cloud platform construction method and cloud platform
JPWO2007072544A1 (en) Information processing apparatus, computer, resource allocation method, and resource allocation program
US10761869B2 (en) Cloud platform construction method and cloud platform storing image files in storage backend cluster according to image file type
JP2019144717A (en) Service provision system and resource allocation method and resource allocation program
CN112910937B (en) Object scheduling method and device in container cluster, server and container cluster
US20220329651A1 (en) Apparatus for container orchestration in geographically distributed multi-cloud environment and method using the same
CN109992373B (en) Resource scheduling method, information management method and device and task deployment system
Eidenbenz et al. Latency-aware industrial fog application orchestration with kubernetes
JPWO2014171130A1 (en) Information processing system, deployment method, processing device, and deployment device
CN113204353A (en) Big data platform assembly deployment method and device
WO2018235739A1 (en) Information processing system and resource allocation method
CN113608838A (en) Deployment method and device of application image file, computer equipment and storage medium
CN112306640A (en) Container dispensing method, apparatus, device and medium therefor
JP2016177324A (en) Information processing apparatus, information processing system, information processing method, and program
CN115987872A (en) Cloud system based on resource routing
CN113485830A (en) Micro-service automatic capacity expansion method for power grid monitoring system
CN113672665A (en) Data processing method, data acquisition system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant