CN112235383B - Container service cluster node scheduling method and device, server and storage medium - Google Patents

Container service cluster node scheduling method and device, server and storage medium Download PDF

Info

Publication number
CN112235383B
CN112235383B CN202011073137.1A CN202011073137A CN112235383B CN 112235383 B CN112235383 B CN 112235383B CN 202011073137 A CN202011073137 A CN 202011073137A CN 112235383 B CN112235383 B CN 112235383B
Authority
CN
China
Prior art keywords
node
nodes
container service
expanded
cluster
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
CN202011073137.1A
Other languages
Chinese (zh)
Other versions
CN112235383A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011073137.1A priority Critical patent/CN112235383B/en
Publication of CN112235383A publication Critical patent/CN112235383A/en
Application granted granted Critical
Publication of CN112235383B publication Critical patent/CN112235383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/10Protocols in which an application is distributed across nodes in the network
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application discloses a container service cluster node scheduling method and device, a server and a storage medium, and the application can be applied to the field of cloud technology, such as the field of cloud education, wherein the method comprises the following steps: acquiring a cluster load resource occupation amount of a target container service cluster; if the load resource occupation amount of the cluster is larger than or equal to the load resource occupation amount threshold, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the node number threshold; acquiring node attribute determining information, and determining nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded; and expanding the capacity of the target container service cluster based on the node to be expanded. The method can be executed by the cloud server, and by adopting the method, the capacity expansion time of the container service cluster can be automatically shortened.

Description

Container service cluster node scheduling method and device, server and storage medium
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and apparatus for scheduling container service cluster nodes, a server, and a storage medium.
Background
In the prior art, when a container instance which cannot be scheduled due to lack of available resources occurs in a container service cluster, a node scheduling system performs automatic capacity expansion operation in a node purchasing mode, and in this mode, the time for a user to wait for the capacity expansion node and pull the mirror image is usually more than six minutes, so that the time for the capacity expansion node of the container service cluster is too long, and the user experience is affected.
Disclosure of Invention
The embodiment of the application provides a method and a device for dispatching container service cluster nodes, a server and a storage medium, which can shorten the capacity expansion time of a container service cluster.
In one aspect, an embodiment of the present application provides a method for scheduling a container service cluster node, including:
acquiring a cluster load resource occupation amount of a target container service cluster;
if the cluster load resource occupation amount is larger than or equal to a load resource occupation amount threshold, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the node number threshold;
acquiring node attribute determining information, and determining nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded;
and expanding the capacity of the target container service cluster based on the node to be expanded.
With reference to the first aspect, in one possible implementation manner, the determining the number of nodes to be expanded according to the node number and the node number threshold of the target container service cluster includes:
if the number of the nodes is smaller than or equal to the threshold value of the number of the nodes, determining the number of the nodes to be expanded based on the expansion multiple of the target node and the number of the nodes;
And if the number of the nodes is larger than the threshold value of the number of the nodes, determining the threshold value of the number of the nodes as the number of the nodes to be expanded.
With reference to the first aspect, in one possible implementation manner, the node attribute determining information includes a number of shutdown nodes and/or capacity expansion node routing information of the target container service cluster;
the determining the node to be expanded according to the node attribute determining information and the number of nodes to be expanded includes:
if the number of the nodes to be expanded is smaller than or equal to the number of the shutdown nodes, determining M shutdown nodes from shutdown nodes included in the target container service cluster as nodes to be expanded, wherein M is equal to the number of the nodes to be expanded;
if the number of the nodes to be expanded is greater than the number of the shutdown nodes, K1 scheduling nodes are obtained based on the routing information of the expansion nodes, and the K1 scheduling nodes and all shutdown nodes included in the target container service cluster are determined to be the nodes to be expanded, wherein K1 is equal to the difference value between the number of the nodes to be expanded and the number of the shutdown nodes.
With reference to the first aspect, in a possible implementation manner, the capacity expansion node routing information includes subnet information;
The obtaining K1 scheduling nodes based on the capacity expansion node routing information includes:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and acquiring scheduling node configuration information from a node configuration information acquisition path indicated by the subnet information, and acquiring K1 scheduling nodes according to the scheduling node configuration information.
With reference to the first aspect, in one possible implementation manner, the capacity expansion node routing information includes a cluster identifier of a container service cluster;
the obtaining K1 scheduling nodes based on the capacity expansion node routing information includes:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and scheduling K1 shutdown nodes in the alternative container service cluster identified by the cluster identification as scheduling nodes.
With reference to the first aspect, in one possible implementation manner, the node to be expanded is a shutdown node;
the expanding the capacity of the target container service cluster based on the node to be expanded includes:
and sending a first trigger instruction to the shutdown node according to the node identifier of the shutdown node, triggering the shutdown node to start and cancel isolation so as to realize the capacity expansion of the target container service cluster.
With reference to the first aspect, in one possible implementation manner, the node to be expanded is a scheduling node;
the expanding the capacity of the target container service cluster based on the node to be expanded includes:
and sending a second trigger instruction to the dispatching node according to the node identification of the dispatching node, triggering the dispatching node to start and join the target container service cluster so as to realize the capacity expansion of the target container service cluster.
With reference to the first aspect, in a possible implementation manner, the method further includes:
if the cluster load resource occupation amount is smaller than the load resource occupation amount threshold, acquiring a cluster state value of the target container service cluster;
determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation quantity;
acquiring the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled;
and carrying out capacity reduction on the target container service cluster based on the node to be capacity reduced.
An embodiment of an aspect of the present application provides a container service cluster node scheduling device, including:
the load resource acquisition module is used for acquiring the cluster load resource occupation amount of the target container service cluster;
the capacity expansion quantity determining module is used for determining the quantity of nodes to be expanded according to the quantity of the nodes and the quantity threshold of the nodes of the target container service cluster if the load resource occupation quantity of the cluster is larger than or equal to the load resource occupation quantity threshold;
the acquisition determining module is used for acquiring node attribute determining information and determining the nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded;
and the capacity expansion module is used for expanding the capacity of the target container service cluster based on the number of the nodes to be expanded.
With reference to the second aspect, in one possible implementation manner, the capacity expansion amount determining module includes:
the first capacity expansion quantity determining unit is used for determining the quantity of the nodes to be expanded based on the capacity expansion multiple of the target node and the quantity of the nodes if the quantity of the nodes is smaller than or equal to the threshold value of the quantity of the nodes;
and the second capacity expansion quantity determining unit is used for determining the node quantity threshold value as the node quantity to be expanded if the node quantity is larger than the node quantity threshold value.
With reference to the second aspect, in one possible implementation manner, the node attribute determining information includes a number of shutdown nodes and/or capacity expansion node routing information of the target container service cluster;
the acquisition determining module includes:
the first node to be expanded determining unit is configured to determine M shutdown nodes from shutdown nodes included in the target container service cluster as nodes to be expanded if the number of the nodes to be expanded is less than or equal to the number of the shutdown nodes, where M is equal to the number of the nodes to be expanded;
and the second capacity-to-be-expanded node determining unit is used for acquiring K1 scheduling nodes based on the capacity-to-be-expanded node routing information if the number of the capacity-to-be-expanded nodes is larger than the number of the shutdown nodes, and determining all the shutdown nodes included in the K1 scheduling nodes and the target container service cluster as the capacity-to-be-expanded nodes, wherein K1 is equal to the difference value between the number of the capacity-to-be-expanded nodes and the number of the shutdown nodes.
With reference to the second aspect, in a possible implementation manner, the capacity expansion node routing information includes subnet information;
the second node to be expanded determining unit is specifically configured to:
Determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and acquiring scheduling node configuration information from a node configuration information acquisition path indicated by the subnet information, and acquiring K1 scheduling nodes according to the scheduling node configuration information.
With reference to the second aspect, in one possible implementation manner, the capacity-expansion node routing information includes a cluster identifier of a container service cluster;
the second node to be expanded determining unit is specifically configured to:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and scheduling K1 shutdown nodes in the alternative container service cluster identified by the cluster identification as scheduling nodes.
With reference to the second aspect, in one possible implementation manner, the node to be expanded is a shutdown node;
the capacity expansion module comprises:
and the startup capacity expansion unit is used for sending a first trigger instruction to the shutdown node according to the node identification of the shutdown node, triggering the shutdown node to start and cancel isolation so as to realize capacity expansion of the target container service cluster.
With reference to the second aspect, in one possible implementation manner, the node to be expanded is a scheduling node;
The capacity expansion module comprises:
and the scheduling capacity expansion unit is used for sending a second trigger instruction to the scheduling node according to the node identification of the scheduling node, triggering the scheduling node to start and join the target container service cluster so as to realize capacity expansion of the target container service cluster.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes: and the capacity reduction module.
The capacity reduction module is used for:
if the cluster load resource occupation amount is smaller than the load resource occupation amount threshold, acquiring a cluster state value of the target container service cluster;
determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation quantity;
acquiring the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled;
and carrying out capacity reduction on the target container service cluster based on the node to be capacity reduced.
In one aspect, an embodiment of the present application provides a server, including: the device comprises a processor, a memory and a transceiver, wherein the processor, the memory and the transceiver are mutually connected, and the memory is used for storing a computer program for supporting the container service cluster node scheduling device to execute the container service cluster node scheduling method, and the computer program comprises program instructions; the processor is configured to invoke the program instructions to perform a container service cluster node scheduling method as described above in the first aspect of the present application.
In one aspect, a computer storage medium is provided, where a computer program is stored, where the computer program includes program instructions; the program instructions, when executed by a processor, cause the processor to perform a container service cluster node scheduling method as described above in an aspect of embodiments of the present application.
In the embodiment of the application, if the cluster load resource occupation amount of the target container service cluster is greater than or equal to the load resource occupation amount threshold, the number of nodes to be expanded can be determined according to the node number and the node number threshold of the target container service cluster, and the nodes to be expanded can be determined according to the node attribute determining information and the number of nodes to be expanded, so that the target container service cluster can be expanded based on the nodes to be expanded, a certain idle available resource can be ensured to be always reserved in the target container cluster, and the expansion duration of the container service cluster is shortened.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic architecture diagram of a cluster node scheduling system provided in the present application;
fig. 2 is a flow chart of a container service cluster node scheduling method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of expanding a target container service cluster based on a shutdown node;
fig. 4 is another flow chart of a container service cluster node scheduling method provided in an embodiment of the present application;
fig. 5 is a schematic flow chart of acquiring K1 scheduling nodes based on subnet information provided in the present application;
fig. 6 is a schematic flow chart of capacity expansion of a target container service cluster based on a node to be expanded;
fig. 7 is another flow chart of expanding a target container service cluster based on a node to be expanded according to the present application;
fig. 8 is a schematic flow chart of the process of scaling a target container service cluster based on a node to be scaled;
FIG. 9 is a schematic flow chart of releasing a target container service cluster based on a shutdown node;
FIG. 10 is a schematic flow chart of self-healing of a target container service cluster provided by the present application;
fig. 11 is a schematic structural diagram of a container service cluster node scheduling device provided in an embodiment of the present application;
Fig. 12 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
According to the container service cluster node scheduling method, under the condition that the cluster load resource occupation amount of the target container service cluster is larger than or equal to the load resource occupation amount threshold, the number of nodes to be expanded can be determined according to the node number and the node number threshold of the target container service cluster, the nodes to be expanded can be determined according to the node attribute determining information and the node number to be expanded, and further the target container service cluster can be expanded based on the nodes to be expanded, so that certain idle available resources can be reserved in the target container cluster all the time, and the expansion duration of the container service cluster is shortened.
The container service cluster node scheduling method provided by the application can be applied to a cluster node scheduling system, wherein the system comprises a node scheduling platform, a database and a target container service cluster, and please refer to fig. 1, which is a schematic diagram of the architecture of the cluster node scheduling system provided by the application. As shown in fig. 1, the architecture diagram includes a node scheduling platform 100, a database 101, and a target container service cluster 102, where the target container service cluster 102 may include a plurality of nodes, and as shown in fig. 1, may specifically include a node 102a, a node 102b, a node 102c, a node …, and a node 102n.
Each node in the node scheduling platform 100 and the target container service cluster 102 includes, but is not limited to, a terminal or a server, where the server may be an independent physical server, or may be a server cluster or a distributed system formed by multiple physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein. The database 101 may be considered as an electronic file cabinet, i.e. a place where electronic files are stored, and a user may perform operations such as adding, querying, updating, deleting, etc. on data in the files. A "database" is a collection of data stored together in a manner that can be shared with multiple users, with as little redundancy as possible, independent of the application. The present application describes database 101 as a redis database.
In the container service cluster node scheduling method provided by the application, the node scheduling platform 100 obtains the cluster load resource occupation amount of the target container service cluster by accessing the target container service cluster 102, determines the number of nodes to be expanded according to the number of nodes of the target container service cluster and the threshold of the number of nodes when the cluster load resource occupation amount is greater than or equal to the threshold of the load resource occupation amount, obtains the node attribute determining information from the database 101, determines the nodes to be expanded according to the node attribute determining information and the number of nodes to be expanded, and expands the target container service cluster 102 based on the nodes to be expanded.
Fig. 2 is a flow chart of a container service cluster node scheduling method according to an embodiment of the present application. As shown in fig. 2, the method provided in the present application may include the following steps:
s101, acquiring the cluster load resource occupation quantity of the target container service cluster.
In some possible embodiments, the node scheduling platform may send a cluster load resource occupancy obtaining request to the target container service cluster according to a preset frequency (for example, once every three seconds), after the target container service cluster receives the request, obtain the load resource occupancy of each node in the target container service cluster according to the request, calculate the cluster load resource occupancy of the target container service cluster based on the load resource occupancy of each node, and return the cluster load resource occupancy of the target container service cluster, and the node scheduling platform receives the cluster load resource occupancy of the target container service cluster returned by the target container service cluster.
S102, if the cluster load resource occupation amount is larger than or equal to the load resource occupation amount threshold, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the node number threshold.
In some possible embodiments, if the cluster load resource occupancy is greater than or equal to the load resource occupancy threshold, further determining a relationship between the number of nodes of the target container service cluster and the node number threshold: if the number of the nodes is smaller than or equal to the threshold value of the number of the nodes, determining the number of the nodes to be expanded based on the expansion multiple of the target nodes and the number of the nodes; if the number of the nodes is larger than the threshold value of the number of the nodes, determining the threshold value of the number of the nodes as the number of the nodes to be expanded. The threshold value of the number of the nodes is determined based on the success rate of purchasing the nodes, the expansion multiple of the target node can be any positive number, and for a cloud education scene, the expansion multiple of the target node is generally 1 because the scale of a user is basically fixed. Wherein cloud education (Cloud Computing Education, ccodu) refers to an educational platform service based on cloud computing business model applications. On the cloud platform, all education institutions, training institutions, recruitment service institutions, propaganda institutions, industry associations, management institutions, industry media, legal structures and the like are integrated into a resource pool in a concentrated cloud mode, all resources are mutually displayed and interacted, the purposes are achieved according to needs, and therefore education cost is reduced, and efficiency is improved.
For example, assuming that the number of nodes of the target container service cluster is 10, the threshold of the number of nodes is 30, and the expansion multiple of the target node is 1, the product 20 between the number of nodes 10 of the target container service cluster and the expansion multiple 1 of the target node is determined as the number of nodes to be expanded.
For another example, assuming that the number of nodes of the target container service cluster is 40 and the threshold number of nodes is 30, the threshold number of nodes 30 is determined as the number of nodes to be expanded.
It should be noted that, in order to avoid that the target container service cluster is repeatedly expanded in the actual capacity expansion process, which leads to the occurrence of resource waste in the target container service cluster, the node scheduling platform may send a cluster state value update instruction to the redis database after determining the number of nodes to be expanded, where the instruction carries the number of nodes to be expanded, and the redis database receives the instruction and updates the available cluster resource in the cluster state value of the target container service cluster according to the number of nodes to be expanded carried by the instruction.
S103, acquiring node attribute determining information, and determining the nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded.
Alternatively, the node attribute determination information may include a number of shutdown nodes of the target container service cluster.
In some possible embodiments, the node scheduling platform obtains the number of shutdown nodes of the target container service cluster, and if the number of the to-be-expanded nodes is smaller than or equal to the number of the shutdown nodes, determines M shutdown nodes from shutdown nodes included in the target container service cluster as to-be-expanded nodes, where M is equal to the number of the to-be-expanded nodes.
Specifically, the node scheduling platform sends a shutdown node information acquisition request to the redis database, the request carries a cluster identifier of a target container service cluster, the redis database acquires the shutdown node information of the target container service cluster according to the cluster identifier carried by the request after receiving the request, and returns the shutdown node information of the target container service cluster, the node scheduling platform receives the shutdown node information of the target container service cluster returned by the redis database, the shutdown node information comprises the number of shutdown nodes, and M shutdown nodes are selected as nodes to be expanded according to all shutdown nodes contained in the shutdown node information under the condition that the number of the shutdown nodes is greater than or equal to the number of the nodes to be expanded.
S104, expanding the capacity of the target container service cluster based on the node to be expanded.
Optionally, the node to be expanded may be a shutdown node.
In some possible embodiments, the node scheduling platform sends a first trigger instruction to the shutdown node according to the node identifier of the shutdown node, and triggers the shutdown node to start and cancel isolation, so as to realize capacity expansion of the target container service cluster.
Specifically, please refer to fig. 3, which is a flow chart illustrating the capacity expansion of the target container service cluster based on the shutdown node. As shown in fig. 3, the node scheduling platform performs capacity expansion on the target container service cluster based on the shutdown node, which includes the following steps:
s1041, the node scheduling platform sends a startup instruction to the shutdown node.
Specifically, the node scheduling platform sends a startup instruction to the shutdown node according to the shutdown node identification.
S1042, the shutdown node boots up according to the boot command.
S1043, the shutdown node sends a node startup result to the node scheduling platform.
S1044, the node scheduling platform sends a node state query request carrying a node identifier of the shutdown node to the target container service cluster.
Specifically, the node scheduling platform receives the node startup result, and sends a shutdown node state query request to the target container service cluster under the condition that the node startup result is that startup is successful, wherein the request carries the node identification of the shutdown node.
S1045, the target container service cluster obtains the node state of the shutdown node according to the node identification of the shutdown node.
Specifically, the target container service cluster receives the request, and obtains the node state of the shutdown node according to the node identifier of the shutdown node carried by the request.
S1046, the target container service cluster sends the node state of the shutdown node to the node scheduling platform.
S1047, the node scheduling platform sends a node identification of the shutdown node carried by the isolation canceling instruction to the target container service cluster.
Specifically, the node scheduling platform receives the node state of the shutdown node, and sends an isolation canceling instruction to the target container service cluster under the condition that the node state is the startup state, wherein the instruction carries the node identification of the shutdown node.
S1048, the target container service cluster de-isolates the shutdown node according to the node identification of the shutdown node.
Specifically, the target container service cluster receives the instruction, and cancels the isolation of the shutdown node according to the node identification of the shutdown node carried by the instruction.
S1049, the target container service cluster sends a node isolation cancellation result to the node scheduling platform.
S10410, the node scheduling platform determines that the capacity expansion of the shutdown node is successful under the condition that the shutdown node is confirmed to be successfully cancelled.
Specifically, the node scheduling platform receives the node isolation cancellation result, and determines that the capacity expansion of the shutdown node is successful under the condition that the node isolation cancellation result is that the isolation cancellation is successful, thereby realizing the capacity expansion of the target container service cluster.
It should be noted that, in order to ensure that the number of actual expansion nodes of the target container service cluster is consistent with the number of nodes to be expanded, after performing expansion operation on each shutdown node, a target container service cluster update instruction may be sent to the redis database, where the instruction carries the number of shutdown nodes completing the expansion operation and a node identifier, so that the redis database updates the available cluster resource in the cluster state value of the target container service cluster according to the number of shutdown nodes completing the expansion operation and the node identifier carried by the instruction.
In the embodiment of the application, if the cluster load resource occupation amount of the target container service cluster is greater than or equal to the load resource occupation amount threshold, the number of nodes to be expanded can be determined according to the node number and the node number threshold of the target container service cluster, and the nodes to be expanded can be determined according to the node attribute determining information and the number of nodes to be expanded, so that the target container service cluster can be expanded based on the nodes to be expanded, a certain idle available resource can be ensured to be always reserved in the target container cluster, and the expansion duration of the container service cluster is shortened.
Fig. 4 is another flow chart of a container service cluster node scheduling method according to an embodiment of the present application. As shown in fig. 4, the method provided in the present application may include the following steps:
s201, acquiring the cluster load resource occupation quantity of the target container service cluster.
Here, the specific implementation of step S201 may refer to the description of step S101 in the corresponding embodiment, which is not repeated here.
S202, judging whether the cluster load occupation amount is larger than or equal to a load resource occupation amount threshold value.
Specifically, if the cluster load occupancy is greater than or equal to the load resource occupancy threshold, step S203 is executed, otherwise step S206 is executed.
Further, in order to avoid frequent capacity shrinking actions of the target container service cluster caused by frequent creation or deletion of instances by the user, the number of times that the cluster load occupation amount is smaller than the load resource occupation amount threshold may be calculated within the preset duration, and if the number of times is equal to the preset number of times threshold, step S206 is executed.
And S203, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the threshold value of the number of nodes.
Here, the specific implementation of step S203 may refer to the description of step S102 in the corresponding embodiment, which is not repeated here. Step S204 is then performed.
S204, acquiring node attribute determining information, and determining the nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded.
Alternatively, the node attribute determining information may include the number of shutdown nodes and capacity expansion node routing information of the target container service cluster.
In some possible embodiments, the node scheduling platform obtains the number of shutdown nodes and the routing information of the expansion nodes of the target container service cluster, obtains K1 scheduling nodes based on the routing information of the expansion nodes if the number of nodes to be expanded is greater than the number of shutdown nodes, and determines the K1 scheduling nodes and all shutdown nodes included in the target container service cluster as the nodes to be expanded, wherein K1 is equal to a difference value between the number of nodes to be expanded and the number of shutdown nodes.
In some possible implementations, the capacity-expanding node routing information may include subnet information.
Here, the specific implementation manner of the node scheduling platform to obtain the number of shutdown nodes of the target container service cluster is referred to step S103 in the embodiment shown in fig. 2, which is not described herein again.
Referring to fig. 5, a flow chart of acquiring K1 scheduling nodes based on subnet information is provided. As shown in fig. 5, the node scheduling platform acquires K1 scheduling nodes based on subnet information, including the steps of:
S2041, the node scheduling platform sends a network identification acquisition request to the cluster management platform.
Specifically, the node scheduling platform sends a network identifier acquisition request to the cluster management platform, wherein the request carries a cluster identifier of the target container service cluster.
S2042, the cluster management platform acquires the network identification of the private network where the target container service cluster is located according to the network identification acquisition request.
Specifically, the cluster management platform acquires a network identifier of a private network where the target container service cluster is located according to the network identifier acquisition request.
S2043, the cluster management platform sends the network identification of the private network where the target container service cluster is located to the node scheduling platform.
S2044, the node scheduling platform sends a subnet information acquiring request to the private network.
Specifically, the node scheduling platform sends a subnet information acquiring request to the private network, wherein the subnet information acquiring request carries a network identifier of the private network where the target container service cluster is located.
And S2045, the private network acquires the subnet information according to the subnet information acquiring request.
And S2046, the private network sends the subnet information to the node scheduling platform.
S2047, the node scheduling platform sends a node configuration information acquisition request to the universal cloud server.
Specifically, the node scheduling platform sends a node configuration information acquisition request to the general cloud server, wherein the request carries subnet information.
S2048, the universal cloud server acquires the scheduling node configuration information according to the node configuration information acquisition request.
Specifically, the universal cloud service receives the request, and obtains scheduling node configuration information according to the available area of the purchasing node indicated by the subnet information carried by the request.
S2049, the universal cloud server sends scheduling node configuration information to the node scheduling platform.
S20410, the node scheduling platform sends a node purchase instruction to the cluster management platform.
Specifically, the node scheduling platform receives the scheduling node configuration information and sends a node purchase instruction to the cluster management platform, wherein the instruction carries the scheduling node configuration information.
S20411, the cluster management platform sends a node purchase instruction to the selling node.
Specifically, the cluster management platform sends a node purchase instruction to K1 selling nodes with configuration information consistent with the configuration information of the scheduling node.
S20412, the vending node performs a purchase operation according to the node purchase instruction.
S20413, the selling node sends the purchase result to the cluster management platform.
S20414, the cluster management platform sends the purchase result to the node scheduling platform.
And S20415, if the purchase result is that the purchase is successful, determining K1 nodes which are successfully purchased as K1 scheduling nodes.
And then, the node scheduling platform takes the K1 scheduling nodes and all shutdown nodes contained in the shutdown node information as nodes to be expanded. In the present application, the cluster management platform may serve (Tencent Kubernetes Engine, TKE) the Tencent cloud container.
In some possible implementations, the capacity-expanding node routing information may include a cluster identification of the container service cluster.
Specifically, the node scheduling platform sends a shutdown node information acquisition request to the redis database, the request carries a cluster identifier of the target container service cluster, and after the redis database receives the request, the node scheduling platform acquires the shutdown node information of the target container service cluster according to the cluster identifier carried by the request and returns the shutdown node information of the target container service cluster. Meanwhile, the node scheduling platform sends a request for acquiring the candidate cluster identifier set to the cluster management platform, wherein the request carries the network identifier of the private network where the target container service cluster is located. After receiving the request, the cluster management platform acquires cluster identifiers of container service clusters, of which the network of the network where the cluster is located is consistent with the network identifiers of the private network, according to the request, generates an alternative cluster identifier set according to the cluster identifiers, and returns the alternative cluster identifier set. The node scheduling platform receives the alternative cluster identification set, selects a cluster identification of a container service cluster from the alternative cluster identification set, and sends a shutdown node information acquisition request to a redis database, wherein the request carries the cluster identification of the container service cluster. After receiving the request, the redis database acquires the shutdown node information of the alternative container service cluster identified by the cluster identification of the container service cluster according to the cluster identification of the container service cluster carried by the request, and returns the shutdown node information of the alternative container service cluster. And then, the node scheduling platform receives the shutdown node information of the target container service cluster and the shutdown node information of the alternative container service cluster returned by the redis database, wherein the shutdown node information of the target container service cluster comprises the number of the shutdown nodes, under the condition that the number of the shutdown nodes is smaller than the number of the nodes to be expanded, the difference K1 between the number of the nodes to be expanded and the number of the shutdown nodes is determined, K1 shutdown nodes are selected from joint nodes contained in the shutdown node information of the alternative container service cluster to serve as scheduling nodes, and all the shutdown nodes contained in the K1 scheduling nodes and the shutdown node information of the target container service cluster serve as the nodes to be expanded.
Step S205 is then performed.
And S205, expanding the capacity of the target container service cluster based on the node to be expanded.
In some possible embodiments, the node scheduling platform sends a first trigger instruction according to all shutdown nodes in the target container service cluster, triggers all shutdown nodes to start and cancel isolation, sends a second trigger instruction to the K1 scheduling nodes according to node identifiers of the K1 scheduling nodes, triggers the K1 scheduling nodes to start and join the target container service cluster, and achieves capacity expansion of the target container service cluster. The scheduling node herein refers to a node obtained by purchasing a node.
Specifically, please refer to fig. 6, which is a flow chart of the expansion of the target container service cluster based on the node to be expanded. As shown in fig. 6, the node scheduling platform performs capacity expansion on the target container service cluster based on the node to be expanded, which includes the following steps:
s2051, the node scheduling platform sends a startup instruction to the shutdown node.
S2052, the shutdown node starts up according to the startup instruction.
S2053, the shutdown node sends a node startup result to the node scheduling platform.
S2054, the node scheduling platform sends a node state query request carrying a node identifier of the shutdown node to the target container service cluster.
S2055, the target container service cluster acquires the node state of the shutdown node according to the node identification of the shutdown node.
S2056, the target container service cluster sends the node state of the shutdown node to the node scheduling platform.
S2057, the node scheduling platform sends a node identification of the shutdown node carried by the isolation canceling instruction to the target container service cluster.
S2058, the target container service cluster de-isolates the shutdown node according to the node identification of the shutdown node.
S2059, the target container service cluster sends a node isolation cancellation result to the node scheduling platform.
S20510, the node scheduling platform determines that the capacity expansion of the shutdown node is successful under the condition that the shutdown node is confirmed to be successfully isolated.
Here, the specific implementation manner of steps S2051-S20510 may refer to steps S1041-S10410 in the embodiment corresponding to fig. 3, which is not described herein again.
S20511, the node scheduling platform sends a startup instruction to the scheduling node.
Specifically, the node scheduling platform sends a startup instruction to the scheduling node according to the node identification of the scheduling node.
S20512, the scheduling node starts up according to the starting-up instruction.
S20513, the scheduling node sends a node startup result to the node scheduling platform.
S20514, the node scheduling platform sends a node state acquisition request to the target container service cluster.
Specifically, the node scheduling platform receives the starting result, and sends a node state acquisition request to the target container service cluster under the condition that the starting result is that the starting is successful, wherein the request carries the node identification of the scheduling node.
S20515, the target container service cluster acquires the node state of the scheduling node according to the node state acquisition request.
Specifically, the target container service cluster receives a node state acquisition request, and acquires the node state of the scheduling node according to the node identifier of the scheduling node carried by the node state acquisition request.
S20516, the target container service cluster sends the node state of the scheduling node to the node scheduling platform.
S20517, if the node state of the scheduling node is successful in joining the cluster, the capacity expansion of the scheduling node is determined to be successful.
Specifically, the node scheduling platform receives the node state of the scheduling node, and if the node state of the scheduling node is successful in joining the cluster, the capacity expansion of the scheduling node is determined to be successful.
In some possible embodiments, the node scheduling platform sends a first trigger instruction according to all shutdown nodes in the target container service cluster, triggers all shutdown nodes to start up and cancel isolation, sends a second trigger instruction to the cluster management platform, triggers K1 scheduling nodes to be released from the alternative container service cluster, joins the target container service cluster and starts up, so as to realize capacity expansion of the target container service cluster. The scheduling node herein refers to a node obtained by scheduling from an alternative container service cluster.
Specifically, please refer to fig. 7, which is another flow chart of the capacity expansion of the target container service cluster based on the node to be expanded provided in the present application. As shown in fig. 7, the node scheduling platform performs capacity expansion on the target container service cluster based on the node to be expanded, which includes the following steps:
s2061, the node scheduling platform sends a startup instruction to the shutdown node.
S2062, the shutdown node is started according to the startup instruction.
S2053, the shutdown node sends a node startup result to the node scheduling platform.
S2064, the node scheduling platform sends a node state query request carrying the node identification of the shutdown node to the target container service cluster.
S2065, the target container service cluster acquires the node state of the shutdown node according to the node identification of the shutdown node.
S2066, the target container service cluster sends the node state of the shutdown node to the node scheduling platform.
S2067, the node scheduling platform sends a node identification of the shutdown node carried by the isolation canceling instruction to the target container service cluster.
S2068, the target container service cluster de-isolates the shutdown node according to the node identification of the shutdown node.
S2069, the target container service cluster sends a node isolation cancellation result to the node scheduling platform.
S20610, the node scheduling platform determines that the capacity expansion of the shutdown node is successful under the condition that the shutdown node is confirmed to be successfully cancelled.
Here, the specific implementation manner of steps S2061 to S20610 may refer to steps S1041 to S10410 in the corresponding embodiment of fig. 3, and will not be described here again.
S20611, the node scheduling platform sends a capacity expansion request to the cluster management platform.
Specifically, the node scheduling platform sends a capacity expansion request to the cluster management platform, wherein the request carries the cluster identifier of the alternative container service cluster, the cluster identifier of the target container service cluster and the node identifiers of K1 scheduling nodes.
S20612, the cluster management platform removes the dispatching node from the alternative container service cluster according to the capacity expansion request, and adds the dispatching node into the target container service cluster.
Specifically, the cluster management platform removes K1 scheduling nodes from the alternative container service cluster according to the capacity expansion request, and adds the K1 scheduling nodes into the target container service cluster.
S20613, the cluster management platform sends the capacity expansion result to the node scheduling platform.
S20614, the node scheduling platform determines that the capacity expansion of the scheduling node is successful under the condition that the capacity expansion result is successful.
S206, obtaining a cluster state value of the target container service cluster, and determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation amount.
Specifically, the node scheduling platform sends a cluster state value acquisition request to a redis database, the request carries a cluster identifier of a target container service cluster, the redis database receives the request, acquires a cluster state value of the target container service cluster according to the cluster identifier of the target container service cluster carried by the request, returns the cluster state value of the target container service cluster, the node scheduling platform receives the cluster state value of the target container service cluster, the cluster state value comprises a cluster resource available amount and a cluster resource to be quantified, calculates a difference value between the cluster resource available amount and the cluster resource to be quantified to obtain a cluster idle resource total amount A, further obtains a to-be-contracted resource total amount A1=A/2, and determines a quotient between the to-be-contracted resource total amount A1 and a node preset resource total amount a as the to-be-contracted node number.
In order to avoid the situation that the target container service cluster is repeatedly scaled in the actual scaling process, the node scheduling platform may send a cluster state value update instruction to the redis database after determining the number of nodes to be scaled, where the instruction carries the number of nodes to be scaled, and the redis database receives the instruction and updates the available cluster resources in the cluster state value of the target container service cluster according to the number of nodes to be scaled carried by the instruction.
Step S207 is then performed.
S207, obtaining the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled.
Specifically, the node scheduling platform sends a node load resource occupation amount acquisition request to the target container service cluster, the target container service cluster receives the node load resource occupation amount acquisition request and returns the node load resource occupation amount of each node in the target container service cluster according to the request, the node scheduling platform receives the node load resource occupation amount of each node in the target container service cluster, and N nodes with the node load resource occupation amount equal to 0 are selected from the target container service cluster according to the node load resource occupation amount of each node to serve as nodes to be contracted.
Step S208 is then performed.
And S208, carrying out capacity reduction on the target container service cluster based on the node to be capacity reduced.
Specifically, please refer to fig. 8, which is a schematic flow chart of the present application for scaling a target container service cluster based on a node to be scaled. As shown in fig. 8, the node scheduling platform performs capacity reduction on the target container service cluster based on the node to be capacity reduced, which includes the following steps:
S2081, the node scheduling platform sends isolation instructions to the target container service cluster.
Specifically, the node scheduling platform sends an isolation instruction to the target container service cluster, wherein the isolation instruction carries a node identifier of the node to be scaled.
S2082, the target container service cluster executes isolation operation on the nodes to be scaled according to the isolation instruction.
Specifically, the target container service cluster receives an isolation instruction, and executes isolation operation on the nodes to be scaled according to the isolation instruction.
S2083, the target container service cluster sends isolation results to the node scheduling platform.
S2084, the node scheduling platform sends a shutdown instruction to the node to be scaled.
Specifically, the node scheduling platform receives the isolation result, and sends a shutdown instruction to the node to be scaled according to the node identification of the node to be scaled under the condition that the isolation result is that the isolation is successful.
S2085, the node to be condensed is turned off according to the turn-off instruction.
Specifically, the node to be scaled receives the shutdown instruction, and executes shutdown operation according to the shutdown instruction.
S2086, the node to be scaled schedules a platform node shutdown result to the node.
S2087, the node scheduling platform confirms that the node to be scaled is successful when the node shutdown result is that the shutdown is successful.
It should be noted that, in order to ensure that the actual number of the nodes to be scaled is consistent with the number of the nodes to be scaled, after each node to be scaled is scaled successfully, a target container service cluster update instruction may be sent to the redis database, where the instruction carries the number of the nodes to be scaled for completing the scaling operation and a node identifier, so that the redis database updates the shutdown node information of the target container service cluster and the cluster resource availability in the cluster state value according to the number of the nodes to be scaled for completing the scaling operation and the node identifier carried by the instruction.
Further, under the condition that the node release triggering condition is met, the node scheduling platform releases the target container service cluster based on the shutdown node.
Specifically, please refer to fig. 9, which is a schematic flow chart of releasing the target container service cluster based on the shutdown node. As shown in fig. 9, the node scheduling platform releasing the target container service cluster based on the shutdown node includes the following steps:
and S2091, the node scheduling platform sends a shutdown node information acquisition request to the database.
Specifically, under the condition that the current time is the preset node release time, the node scheduling platform sends a shutdown node information acquisition request to the redis database, wherein the request carries a cluster identifier of a target container service cluster.
And S2092, the database acquires the shutdown node information of the target container service cluster according to the shutdown node information acquisition request.
Specifically, the redis database receives a shutdown node information acquisition request, and acquires the shutdown node information of the target container service cluster according to the request.
And S2093, the database sends shutdown node information to the node scheduling platform.
And S2094, the node scheduling platform sends a node removing instruction to the cluster management platform.
Specifically, the node scheduling platform receives shutdown node information of the target container service cluster, the shutdown node information comprises node identifiers of shutdown nodes, and a node removing instruction is sent to the cluster management platform, wherein the node removing instruction carries the node identifiers of the shutdown nodes and the cluster identifiers of the target container service cluster.
And S2095, the cluster management platform removes the shutdown node from the target container service cluster according to the node removal instruction.
Specifically, the cluster management platform receives a node removal instruction, and removes the shutdown node from the target container service cluster according to the instruction.
And S2096, the cluster management platform sends a destruction instruction to the shutdown node.
Specifically, after the shutdown node is removed from the target container service cluster by the cluster management platform, a destruction instruction is sent to the shutdown node according to the node identification of the shutdown node.
And S2097, the shutdown node executes the destroying operation according to the destroying instruction.
Specifically, the shutdown node receives a destruction instruction, and executes destruction operation according to the destruction instruction.
And S2098, the shutdown node sends a destruction result to the cluster management platform.
And S2099, the cluster management platform sends a message that the node is removed and destroyed successfully to the node scheduling platform.
Specifically, the cluster management platform receives a destroying result, and sends a message that the node is removed and destroyed successfully to the node scheduling platform when the destroying result is that the destroying is successful.
S2091, the node scheduling platform sends the target container service cluster update instruction to the database.
Specifically, after receiving the message, the node scheduling platform determines that the release to the shutdown node is successful, and sends a target container service cluster update instruction to the redis database, wherein the instruction carries the node identification of the shutdown node which completes the release operation.
And S2091, the database updates the cluster state value of the target container service cluster according to the target container service cluster update instruction.
Specifically, the redis database receives a target container service cluster updating instruction, and updates the total cluster resource amount in the cluster state value of the target container service cluster according to the node identifier of the shutdown node, which is carried by the instruction and completes the release operation.
And S2092, the database sends successful cluster update information to the node scheduling platform.
In addition, under the condition that the self-healing triggering condition (for example, the time is preset self-healing time) is met, the node scheduling platform updates the cluster state value and the shutdown node information of the target container service cluster.
Specifically, please refer to fig. 10, which is a flow chart illustrating self-healing of the target container service cluster according to the present application. As shown in fig. 10, the node scheduling platform self-heals the target container service cluster, including the following steps:
s20101, the node scheduling platform sends a shutdown node information clearing request to the database.
Specifically, under the condition that the current time is the preset self-healing time, the node scheduling platform sends a shutdown node information clearing request to the redis database, wherein the request carries a cluster identifier of a target container service cluster.
S20102, the database empties the shutdown node information of the target container service cluster according to the shutdown node information emptying request.
Specifically, the redis database receives a shutdown node information clearing request, and clears the shutdown node information of the target container service cluster according to the request.
S20103, the database sends the emptying result to the node scheduling platform.
S20104, the node scheduling platform sends a cluster load resource occupation amount acquisition request to the target container service cluster.
Specifically, the node scheduling platform receives the emptying result, and sends a cluster load resource occupation amount acquisition request to the target container service cluster under the condition that the emptying result is successful.
S20105, the target container service cluster acquires the cluster load resource occupation quantity of the target container service cluster.
S20106, the target container service cluster sends the cluster load resource occupation amount of the target container service cluster to the node scheduling platform.
Specifically, after receiving the request, the target container service cluster acquires the cluster load resource occupation amount of the target container service cluster according to the request, and returns the cluster load resource occupation amount of the target container service cluster.
S20107, the node scheduling platform sends a target container service cluster update instruction to the database.
Specifically, the node scheduling platform receives the cluster load resource occupancy of the target container service cluster, and sends a target container service cluster update instruction to the redis database, wherein the instruction carries the cluster load resource occupancy of the target container service cluster.
S20108, the database updates the cluster state value of the target container service cluster according to the target container service cluster updating instruction.
Specifically, the redis database receives a target container service cluster updating instruction, and updates the total cluster resource amount and the cluster resource available amount in the cluster state value of the target container service cluster according to the cluster load resource occupation amount of the target container service cluster carried by the instruction.
And S20109, the database sends the updating result to the node scheduling platform.
S20110, the node scheduling platform sends a node state acquisition request to the target container service cluster.
Specifically, the node scheduling platform receives an update result, and sends a node state acquisition request to the target container service cluster when the update result is that the update is successful.
S20111, the target container service cluster acquires the node state of each node in the target container service cluster according to the node state acquisition request.
Specifically, the target container service cluster receives a node state acquisition request, and acquires the node state of each node in the target container service cluster according to the request.
S20112, the target container service cluster sends the node state of each node in the target container service cluster to the node scheduling platform.
S20113, the node scheduling platform screens out shutdown nodes.
Specifically, the node scheduling platform receives the node state of each node in the target container service cluster, and determines the node with the node state of shutdown as the shutdown node.
And S20114, the node scheduling platform sends a shutdown node information updating instruction to the database.
Specifically, the node scheduling platform sends a shutdown node information updating instruction to the redis database, wherein the instruction carries a node identifier of a shutdown node.
And S20115, updating the shutdown node information by the database according to the shutdown node information updating instruction.
Specifically, the redis database receives a shutdown node information update instruction, and adds a shutdown node to the shutdown node information according to the instruction.
And S20116, the database sends an updating result to the node scheduling platform.
And S20117, the database determines that the self-healing of the target container service cluster is successful under the condition that the updating result is successful.
Specifically, the node scheduling platform receives an update result, and determines that the self-healing of the target container service cluster is successful under the condition that the update result is successful.
In the embodiment of the application, when the cluster load resource occupation amount of the target container service cluster is greater than or equal to the load resource occupation amount threshold, the number of nodes to be expanded can be determined according to the node number and the node number threshold of the target container service cluster, the nodes to be expanded can be determined according to the node attribute determining information and the number of the nodes to be expanded, and then the target container service cluster can be expanded based on the nodes to be expanded; under the condition that the cluster load resource occupation amount of the target container service cluster is smaller than the load resource occupation amount threshold, the number N of nodes to be contracted can be determined according to the cluster load resource occupation amount and the cluster state value of the target container service cluster, N nodes to be contracted are determined from the target container service cluster according to the load resource occupation amount of each node, and then the target container service cluster can be contracted based on the nodes to be contracted, so that certain idle available resources can be reserved in the target container cluster all the time, a small amount of idle available resources can be reserved in idle time, more idle available resources are reserved in busy time, the capacity expansion time of the container service cluster is shortened, and the use experience of users is improved for peak users.
Based on the description of the method embodiment, the application further provides a container service cluster node scheduling device, which can be a node scheduling platform in the method embodiment, and is used for executing corresponding steps in the method provided by the application embodiment. Fig. 11 is a schematic structural diagram of a container service cluster node scheduling apparatus according to an embodiment of the present application. As shown in fig. 11, the container service cluster node scheduling apparatus 11 may include: a load resource acquisition module 111, a capacity expansion amount determination module 112, an acquisition determination module 113, and a capacity expansion module 114.
A load resource obtaining module 111, configured to obtain a cluster load resource occupation amount of a target container service cluster;
the capacity expansion amount determining module 112 is configured to determine the amount of nodes to be expanded according to the amount of nodes and the threshold of the amount of nodes of the target container service cluster if the load resource occupancy of the cluster is greater than or equal to the load resource occupancy threshold;
the acquiring and determining module 113 is configured to acquire node attribute determining information, and determine a node to be expanded according to the node attribute determining information and the number of nodes to be expanded;
And the capacity expansion module 114 is configured to expand the target container service cluster based on the number of nodes to be expanded.
In some possible embodiments, the capacity expansion amount determining module 112 includes:
a first capacity expansion amount determining unit 1121, configured to determine, if the number of nodes is less than or equal to the threshold of the number of nodes, the number of nodes to be expanded based on a capacity expansion multiple of a target node and the number of nodes;
the second capacity expansion amount determining unit 1122 is configured to determine the node amount threshold as the number of nodes to be expanded if the number of nodes is greater than the node amount threshold.
In some possible embodiments, the node attribute determining information includes a shutdown node number and/or a capacity expansion node routing information of the target container service cluster;
the acquisition determining module 113 includes:
a first node to be expanded determining unit 1131, configured to determine M shutdown nodes from among shutdown nodes included in the target container service cluster as nodes to be expanded if the number of the nodes to be expanded is less than or equal to the number of the shutdown nodes, where M is equal to the number of the nodes to be expanded;
The second node to be expanded determining unit 1132 is configured to obtain K1 scheduling nodes based on the routing information of the expansion nodes if the number of the nodes to be expanded is greater than the number of the shutdown nodes, and determine all shutdown nodes included in the K1 scheduling nodes and the target container service cluster as the nodes to be expanded, where K1 is equal to a difference between the number of the nodes to be expanded and the number of the shutdown nodes.
In some possible embodiments, the capacity-expansion node routing information includes subnet information;
the second node to be expanded determining unit 1132 is specifically configured to:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and acquiring scheduling node configuration information from a node configuration information acquisition path indicated by the subnet information, and acquiring K1 scheduling nodes according to the scheduling node configuration information.
In some possible embodiments, the capacity-expanding node routing information includes a cluster identifier of a container service cluster;
the second node to be expanded determining unit 1132 is specifically configured to:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and scheduling K1 shutdown nodes in the alternative container service cluster identified by the cluster identification as scheduling nodes.
In some possible embodiments, the node to be expanded is a shutdown node;
the capacity expansion module 114 includes:
the power-on capacity expansion unit 1141 is configured to send a first trigger instruction to the power-off node according to the node identifier of the power-off node, trigger the power-off node to power on and cancel isolation, so as to implement capacity expansion of the target container service cluster.
In some possible embodiments, the node to be expanded is a scheduling node;
the capacity expansion module 114 includes:
and the scheduling capacity expansion unit 1142 is configured to send a second trigger instruction to the scheduling node according to the node identifier of the scheduling node, trigger the scheduling node to start up and join the target container service cluster, so as to realize capacity expansion of the target container service cluster.
In some possible embodiments, the apparatus further comprises: the capacity reduction module 115.
The capacity reduction module 115 is configured to:
if the cluster load resource occupation amount is smaller than the load resource occupation amount threshold, acquiring a cluster state value of the target container service cluster;
determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation quantity;
Acquiring the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled;
and carrying out capacity reduction on the target container service cluster based on the node to be capacity reduced.
It will be appreciated that the container service cluster node scheduling means 11 is configured to implement the steps performed by the node scheduling platform in the embodiments of fig. 2 and 4. Regarding the specific implementation manner and corresponding beneficial effects of the functional blocks included in the container service cluster node scheduling apparatus 5 of fig. 11, reference may be made to the foregoing specific description of the embodiments of fig. 2 and fig. 4, which are not repeated here.
The container service cluster node scheduling device 11 in the embodiment shown in fig. 11 may be implemented as the server 1200 shown in fig. 12. Fig. 12 is a schematic structural diagram of a server provided in the present application. As shown in fig. 12, the server 1200 may include: one or more processors 1201, memory 1202, and a transceiver 1203. The processor 1201, the memory 1202, and the transceiver 1203 are connected via a bus 1204. Wherein the transceiver 1203 is configured to receive or transmit data, and the memory 1202 is configured to store a computer program, the computer program including program instructions; the processor 1201 is configured to execute program instructions stored in the memory 1202 and perform the following operations:
Acquiring a cluster load resource occupation amount of a target container service cluster;
if the cluster load resource occupation amount is larger than or equal to a load resource occupation amount threshold, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the node number threshold;
acquiring node attribute determining information, and determining nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded;
and expanding the capacity of the target container service cluster based on the node to be expanded.
In some possible embodiments, the processor 1201 determines the number of nodes to be expanded according to the number of nodes and the threshold of the number of nodes of the target container service cluster, and specifically performs the following steps:
if the number of the nodes is smaller than or equal to the threshold value of the number of the nodes, determining the number of the nodes to be expanded based on the expansion multiple of the target node and the number of the nodes;
and if the number of the nodes is larger than the threshold value of the number of the nodes, determining the threshold value of the number of the nodes as the number of the nodes to be expanded.
In some possible embodiments, the node attribute determining information includes a shutdown node number and/or a capacity expansion node routing information of the target container service cluster;
The processor 1201 determines the node to be expanded according to the node attribute determining information and the number of nodes to be expanded, and specifically performs the following steps:
if the number of the nodes to be expanded is smaller than or equal to the number of the shutdown nodes, determining M shutdown nodes from shutdown nodes included in the target container service cluster as nodes to be expanded, wherein M is equal to the number of the nodes to be expanded;
if the number of the nodes to be expanded is greater than the number of the shutdown nodes, K1 scheduling nodes are obtained based on the routing information of the expansion nodes, and the K1 scheduling nodes and all shutdown nodes included in the target container service cluster are determined to be the nodes to be expanded, wherein K1 is equal to the difference value between the number of the nodes to be expanded and the number of the shutdown nodes.
In some possible embodiments, the capacity-expansion node routing information includes subnet information;
the processor 1201 obtains K1 scheduling nodes based on the capacity-expanding node routing information, and specifically performs the following steps:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and acquiring scheduling node configuration information from a node configuration information acquisition path indicated by the subnet information, and acquiring K1 scheduling nodes according to the scheduling node configuration information.
In some possible embodiments, the capacity-expanding node routing information includes a cluster identifier of a container service cluster;
the processor 1201 obtains K1 scheduling nodes based on the capacity-expanding node routing information, and specifically performs the following steps:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and scheduling K1 shutdown nodes in the alternative container service cluster identified by the cluster identification as scheduling nodes.
In some possible embodiments, the node to be expanded is a shutdown node;
the processor 1201 performs capacity expansion on the target container service cluster based on the node to be expanded, and specifically performs the following steps:
and sending a first trigger instruction to the shutdown node according to the node identifier of the shutdown node, triggering the shutdown node to start and cancel isolation so as to realize the capacity expansion of the target container service cluster.
In some possible embodiments, the node to be expanded is a scheduling node;
the processor 1201 performs capacity expansion on the target container service cluster based on the node to be expanded, and specifically performs the following steps:
and sending a second trigger instruction to the dispatching node according to the node identification of the dispatching node, triggering the dispatching node to start and join the target container service cluster so as to realize the capacity expansion of the target container service cluster.
In some possible embodiments, the processor 1201 further performs the following steps:
if the cluster load resource occupation amount is smaller than the load resource occupation amount threshold, acquiring a cluster state value of the target container service cluster;
determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation quantity;
acquiring the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled;
and carrying out capacity reduction on the target container service cluster based on the node to be capacity reduced.
It should be understood that the server 1200 described in the embodiments of the present application may perform the description of the foregoing container service cluster node scheduling method in the embodiments corresponding to fig. 2 and fig. 4, and may also perform the description of the foregoing container service cluster node scheduling device in the embodiments corresponding to fig. 5, which are not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer storage medium, where the aforementioned computer program executed by the container service cluster node scheduling device 5 is stored, and the computer program includes program instructions, when the processor executes the program instructions, the foregoing description of the container service cluster node scheduling method in the corresponding embodiment of fig. 2 or fig. 4 can be executed, and therefore will not be repeated herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer storage medium related to the present application, please refer to the description of the method embodiments of the present application. As an example, program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or, alternatively, across multiple computing devices distributed across multiple sites and interconnected by a communication network, where the multiple computing devices distributed across multiple sites and interconnected by a communication network may constitute a blockchain system.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a computer-readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The methods and related devices provided in the embodiments of the present application are described with reference to the method flowcharts and/or structure diagrams provided in the embodiments of the present application, and each flowchart and/or block of the method flowcharts and/or structure diagrams may be implemented by computer program instructions, and combinations of flowcharts and/or blocks in the flowchart and/or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or structures.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (10)

1. A method for scheduling container service cluster nodes, comprising:
acquiring a cluster load resource occupation amount of a target container service cluster;
if the cluster load resource occupation amount is larger than or equal to a load resource occupation amount threshold, determining the number of nodes to be expanded according to the number of nodes of the target container service cluster and the node number threshold; the node number threshold is determined based on the success rate of purchasing the nodes; when the number of the nodes is larger than the threshold value of the number of the nodes, the number of the nodes to be expanded is the threshold value of the number of the nodes; when the node number is smaller than or equal to the node number threshold, determining the node number to be expanded based on the target node expansion multiple and the node number;
acquiring node attribute determining information, and determining nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded; the node attribute determining information comprises the number of shutdown nodes of the target container service cluster, when the number of nodes to be expanded is larger than the number of shutdown nodes, K1 scheduling nodes are included in the nodes to be expanded, and the K1 scheduling nodes are nodes which are successfully purchased;
And expanding the capacity of the target container service cluster based on the node to be expanded.
2. The method of claim 1, wherein the determining the number of nodes to be expanded according to the number of nodes and the threshold number of nodes of the target container service cluster comprises:
if the node number is smaller than or equal to the node number threshold, determining the node number to be expanded based on the target node expansion multiple and the node number;
and if the number of the nodes is larger than the threshold value of the number of the nodes, determining the threshold value of the number of the nodes as the number of the nodes to be expanded.
3. The method according to claim 1 or 2, wherein the node attribute determination information comprises a number of shutdown nodes and/or capacity expansion node routing information of the target container service cluster;
the determining the node to be expanded according to the node attribute determining information and the node number to be expanded includes:
if the number of the nodes to be expanded is smaller than or equal to the number of the shutdown nodes, determining M shutdown nodes from shutdown nodes included in the target container service cluster as nodes to be expanded, wherein M is equal to the number of the nodes to be expanded;
If the number of the nodes to be expanded is larger than the number of the shutdown nodes, K1 scheduling nodes are obtained based on the routing information of the expansion nodes, and the K1 scheduling nodes and all shutdown nodes included in the target container service cluster are determined to be the nodes to be expanded, wherein K1 is equal to the difference value between the number of the nodes to be expanded and the number of the shutdown nodes.
4. The method of claim 3, wherein the capacity-expanding node routing information comprises subnet information;
the obtaining the K1 scheduling nodes based on the capacity expansion node routing information includes:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
and acquiring scheduling node configuration information from a node configuration information acquisition path indicated by the subnet information, and acquiring K1 scheduling nodes according to the scheduling node configuration information.
5. The method of claim 3, wherein the capacity-expanding node routing information includes a cluster identification of a container service cluster;
the obtaining the K1 scheduling nodes based on the capacity expansion node routing information includes:
determining a difference value K1 between the number of the nodes to be expanded and the number of the shutdown nodes;
And scheduling K1 shutdown nodes in the identified alternative container service cluster from the cluster identification as scheduling nodes.
6. A method according to claim 3, wherein the node to be expanded is a shutdown node;
the expanding the capacity of the target container service cluster based on the node to be expanded comprises the following steps:
and sending a first trigger instruction to the shutdown node according to the node identifier of the shutdown node, triggering the shutdown node to start and cancel isolation so as to realize the capacity expansion of the target container service cluster.
7. The method according to any one of claims 1-2, wherein the method further comprises:
if the cluster load resource occupation amount is smaller than the load resource occupation amount threshold, acquiring a cluster state value of the target container service cluster;
determining the number of nodes to be scaled according to the cluster state value and the cluster load resource occupation quantity;
acquiring the load resource occupation amount of each node in the target container service cluster, and determining N nodes from the target container service cluster as nodes to be scaled according to the load resource occupation amount of each node, wherein N is equal to the number of the nodes to be scaled;
And carrying out capacity reduction on the target container service cluster based on the node to be capacity-reduced.
8. A container service cluster node scheduling apparatus, comprising:
the load resource acquisition module is used for acquiring the cluster load resource occupation amount of the target container service cluster;
the capacity expansion quantity determining module is used for determining the quantity of nodes to be expanded according to the quantity of the nodes of the target container service cluster and the node quantity threshold value if the load resource occupation quantity of the cluster is larger than or equal to the load resource occupation quantity threshold value; the node number threshold is determined based on the success rate of purchasing the nodes; when the number of the nodes is larger than the threshold value of the number of the nodes, the number of the nodes to be expanded is the threshold value of the number of the nodes; when the node number is smaller than or equal to the node number threshold, determining the node number to be expanded based on the target node expansion multiple and the node number;
the acquisition determining module is used for acquiring node attribute determining information and determining nodes to be expanded according to the node attribute determining information and the number of the nodes to be expanded; the node attribute determining information comprises the number of shutdown nodes of the target container service cluster, when the number of nodes to be expanded is larger than the number of shutdown nodes, K1 scheduling nodes are included in the nodes to be expanded, and the K1 scheduling nodes are nodes which are successfully purchased;
And the capacity expansion module is used for expanding the capacity of the target container service cluster based on the number of the nodes to be expanded.
9. A server comprising a processor, a memory and a transceiver, the processor, the memory and the transceiver being interconnected, wherein the transceiver is adapted to receive or transmit data, the memory is adapted to store program code, and the processor is adapted to invoke the program code to perform the method of any of claims 1-7.
10. A computer storage medium, characterized in that it stores a computer program that is executed by a processor to implement the method of any one of claims 1-7.
CN202011073137.1A 2020-10-09 2020-10-09 Container service cluster node scheduling method and device, server and storage medium Active CN112235383B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011073137.1A CN112235383B (en) 2020-10-09 2020-10-09 Container service cluster node scheduling method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011073137.1A CN112235383B (en) 2020-10-09 2020-10-09 Container service cluster node scheduling method and device, server and storage medium

Publications (2)

Publication Number Publication Date
CN112235383A CN112235383A (en) 2021-01-15
CN112235383B true CN112235383B (en) 2024-03-22

Family

ID=74119961

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011073137.1A Active CN112235383B (en) 2020-10-09 2020-10-09 Container service cluster node scheduling method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112235383B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112801797A (en) * 2021-03-30 2021-05-14 支付宝(杭州)信息技术有限公司 Method and apparatus for processing ticket data using a down-link trusted device
CN113311766B (en) * 2021-06-03 2022-09-06 中国工商银行股份有限公司 Distributed system batch node monitoring method, node and system
CN113905449B (en) * 2021-09-30 2024-04-05 杭州阿里云飞天信息技术有限公司 Computing resource scheduling method, system and equipment
CN114153518A (en) * 2021-10-25 2022-03-08 国网江苏省电力有限公司信息通信分公司 Autonomous capacity expansion and reduction method for cloud native MySQL cluster
CN114780232B (en) * 2022-03-25 2023-04-07 阿里巴巴(中国)有限公司 Cloud application scheduling method and device, electronic equipment and storage medium
CN116095083B (en) * 2023-01-16 2023-12-26 之江实验室 Computing method, computing system, computing device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155805A (en) * 2015-04-14 2016-11-23 中兴通讯股份有限公司 Method of adjustment that system internal segment is counted and device
CN107329801A (en) * 2017-06-29 2017-11-07 深信服科技股份有限公司 A kind of node administration method and device, many component servers
CN110096349A (en) * 2019-04-10 2019-08-06 山东科技大学 A kind of job scheduling method based on the prediction of clustered node load condition
CN110677459A (en) * 2019-09-02 2020-01-10 金蝶软件(中国)有限公司 Resource adjusting method and device, computer equipment and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155805A (en) * 2015-04-14 2016-11-23 中兴通讯股份有限公司 Method of adjustment that system internal segment is counted and device
CN107329801A (en) * 2017-06-29 2017-11-07 深信服科技股份有限公司 A kind of node administration method and device, many component servers
CN110096349A (en) * 2019-04-10 2019-08-06 山东科技大学 A kind of job scheduling method based on the prediction of clustered node load condition
CN110677459A (en) * 2019-09-02 2020-01-10 金蝶软件(中国)有限公司 Resource adjusting method and device, computer equipment and computer storage medium

Also Published As

Publication number Publication date
CN112235383A (en) 2021-01-15

Similar Documents

Publication Publication Date Title
CN112235383B (en) Container service cluster node scheduling method and device, server and storage medium
CN112035228B (en) Resource scheduling method and device
CN103841134A (en) API-based method for sending and receiving information, API-based apparatus, and API-based system
CN107066296B (en) Method and device for cleaning mirror image in cluster node
CN108121511B (en) Data processing method, device and equipment in distributed edge storage system
CN106445473B (en) container deployment method and device
CN110413368B (en) Page switching method and device, electronic equipment and machine-readable storage medium
US20160352843A1 (en) Data Processing Method, Device, and ESB System
CN112965817A (en) Resource management method and device and electronic equipment
CN112181677A (en) Service processing method and device, storage medium and electronic device
CN114130035A (en) User matching method, device, equipment and storage medium
CN115168031A (en) Fog calculation system, method, electronic equipment and storage medium
CN110764838B (en) Service model loading method and system, electronic equipment and storage medium
CN116737393B (en) Resource deployment method and device, storage medium and electronic equipment
CN106682198B (en) Method and device for realizing automatic database deployment
CN112906245A (en) Multi-robot simulation method, system, simulation server and terminal
CN111240998B (en) Test case processing method and device
CN107493312B (en) Service calling method and device
CN106550002B (en) paas cloud hosting system and method
CN111124652A (en) Resource pre-scheduling method, equipment and storage medium
CN109840094B (en) Database deployment method and device and storage equipment
CN106775889B (en) Method and system for loading Flash player resources by using object pool
CN115563160A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN112667491B (en) Function test method and device for virtual machine
CN114816713A (en) Function calling method and system

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