CN114356558A - Capacity reduction processing method and device based on cluster - Google Patents

Capacity reduction processing method and device based on cluster Download PDF

Info

Publication number
CN114356558A
CN114356558A CN202111574571.2A CN202111574571A CN114356558A CN 114356558 A CN114356558 A CN 114356558A CN 202111574571 A CN202111574571 A CN 202111574571A CN 114356558 A CN114356558 A CN 114356558A
Authority
CN
China
Prior art keywords
capacity reduction
preset
cluster
threshold
service instances
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.)
Granted
Application number
CN202111574571.2A
Other languages
Chinese (zh)
Other versions
CN114356558B (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.)
Beijing Chuanyang Technology Co ltd
Original Assignee
Beijing Chuanyang Technology 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 Beijing Chuanyang Technology Co ltd filed Critical Beijing Chuanyang Technology Co ltd
Priority to CN202111574571.2A priority Critical patent/CN114356558B/en
Priority to JP2022010108A priority patent/JP7103705B1/en
Publication of CN114356558A publication Critical patent/CN114356558A/en
Application granted granted Critical
Publication of CN114356558B publication Critical patent/CN114356558B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a capacity reduction processing method and a device based on a cluster, which are used for obtaining the current resource request ratio and/or the number of allowed operation service instances of a target cluster, judging whether the current resource request ratio and/or the number of allowed operation service instances are larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold, obtaining the duration of the current resource request ratio larger than or equal to the resource ratio threshold and/or the number of allowed operation service instances larger than or equal to the service instance threshold and the capacity reduction interval between the current time and the capacity reduction time, calculating the comprehensive grade of each node in the target cluster according to a preset capacity reduction factor under the condition that the duration is larger than a preset duration threshold and the capacity reduction interval is larger than a preset interval threshold, carrying out capacity reduction processing on the cluster based on the comprehensive grade, and accurately judging whether the cluster needs capacity reduction or not, and the capacity reduction processing is carried out based on the related capacity reduction strategy, so that the cost is saved while the resource requirement of the service is met.

Description

Capacity reduction processing method and device based on cluster
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a reduced volume based on a cluster.
Background
At present, cluster resource capacity reduction is a method for avoiding resource waste and reducing other costs.
In the related art, whether the capacity reduction requirement is met or not is judged according to the current memory utilization rate of the cluster, so that the situations such as capacity reduction delay and the like are caused, and when node capacity reduction is carried out, the mode of selecting the node is simpler, for example, when any machine is directly selected for capacity reduction, a core service runs on the capacity reduction machine, so that the service stability is possibly damaged, and the immeasurable loss is caused.
Disclosure of Invention
In order to solve the technical problem, the present disclosure provides a method and an apparatus for processing a reduced volume based on a cluster.
In a first aspect, an embodiment of the present disclosure provides a method for processing a reduced volume based on a cluster, including:
acquiring the current resource request ratio and/or the number of allowed operation service instances of a target cluster;
judging whether the current resource request ratio and/or the number of the allowed operation service instances is larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold;
acquiring the duration of the current resource request ratio value which is more than or equal to the resource ratio threshold value and/or the number of the allowed operation service instances which is more than or equal to the service instance threshold value, and the capacity reduction interval between the current time and the last capacity reduction time;
and under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, calculating the comprehensive score of each node in the target cluster according to a preset capacity reduction factor, and carrying out capacity reduction treatment on the cluster based on the comprehensive score.
In a second aspect, an embodiment of the present disclosure provides a capacity reduction processing apparatus based on a cluster, including:
the first acquisition device is used for acquiring the current resource request ratio and/or the number of allowed operation service instances of the target cluster;
the judging device is used for judging whether the current resource request ratio and/or the number of the allowed operation service instances are larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold;
the second acquisition device is used for acquiring the duration that the current resource request ratio is greater than or equal to the resource ratio threshold and/or the number of the allowed operation service instances is greater than or equal to the service instance threshold, and the capacity reduction interval between the current time and the last capacity reduction time;
and the first processing device is used for calculating the comprehensive score of each node in the target cluster according to the preset capacity reduction factor under the condition that the duration is greater than the preset duration threshold and the capacity reduction interval is greater than the preset interval threshold, and performing capacity reduction processing on the cluster based on the comprehensive score.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
in the embodiment of the disclosure, a current resource request ratio and/or a number of allowed service instances of a target cluster are obtained, whether the current resource request ratio and/or the number of allowed service instances are greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold is judged, a duration of the current resource request ratio greater than or equal to the resource ratio threshold and/or the number of allowed service instances greater than or equal to the service instance threshold and a capacity reduction interval between a current time and a last capacity reduction time are obtained, a comprehensive score of each node in the target cluster is calculated according to a preset capacity reduction factor under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, and the cluster is subjected to capacity reduction processing based on the comprehensive score, so that whether the cluster needs to be subjected to capacity reduction can be accurately judged, and carrying out capacity reduction processing based on the relevant capacity reduction strategy, so that the cost is saved while the resource requirement of the service is met.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a method for processing a reduced volume based on a cluster according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another cluster-based capacity reduction processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of another method for processing a reduced volume based on a cluster according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a capacity reduction processing apparatus based on a cluster according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
At present, the related flexible capacity reduction rules are all judged whether to meet the capacity reduction requirements through the utilization rate of a Central Processing Unit (CPU) and the utilization rate of a cluster memory, and when node capacity reduction is performed, the mode of selecting a node strategy is simple and cannot cover most scenes, for example, when any machine is directly selected for capacity reduction, the capacity reduction machine has core service to operate, so that the service stability is damaged and inestimable loss is caused.
The utility model discloses an automatic capacity reduction method of cluster, obtain resource request ratio and/or the business instance quantity of permitting to operate through the algorithm, judge according to the threshold value that sets up or the threshold value of program self-adaptation, the cluster capacity reduction can be triggered when the result that resource request ratio and/or business instance quantity of permitting to operate that actually calculate surpass the threshold value that sets up or the threshold value of program self-adaptation, the cluster capacity reduction can be according to application priority, application stability, available area balance, the comprehensive grade of minimum number of copies obtains the cluster capacity reduction result.
Fig. 1 is a schematic flow chart of a capacity reduction processing method based on a cluster according to an embodiment of the present disclosure, where the method includes:
step 101, obtaining a current resource request ratio and/or a number of allowed service instances of a target cluster.
Wherein, the target cluster refers to a group of mutually independent computers interconnected through a high-speed network, which constitute a group and are managed in a single system mode.
Specifically, there are various ways to obtain the current resource request ratio of the target cluster, and in a specific embodiment, all resource amounts and requested resource amounts corresponding to the target cluster are obtained, and the ratio of the requested resource amounts and all resource amounts is calculated to obtain the current resource request ratio; in a specific embodiment, the total number of the allowed operation service instances and the number of the operated service instances of the target cluster are obtained, and the difference between the total number of the allowed operation service instances and the number of the operated service instances is calculated to obtain the number of the allowed operation service instances.
And 102, judging whether the current resource request ratio and/or the number of the allowed operation service instances are larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold.
The preset resource ratio threshold and/or the preset service instance threshold can be set as required, or current operation information corresponding to the target cluster is acquired for analysis, and the preset resource ratio threshold and/or the preset service instance threshold which accord with the target cluster environment is automatically set.
Specifically, a preset resource ratio threshold is set as a, a preset service instance threshold is set as B, and in some embodiments, if the current resource request ratio is greater than or equal to a, a preset capacity reduction condition is met, and capacity reduction is triggered; in other embodiments, if the number of the service instances allowed to run is greater than or equal to B, a preset capacity reduction condition is met, and capacity reduction is triggered; in still other embodiments, if the current resource request ratio is greater than or equal to a and the number of allowed service instances is greater than or equal to B, a preset capacity reduction condition is met, and capacity reduction is triggered.
Step 103, obtaining the duration of the current resource request ratio value greater than or equal to the resource ratio threshold value and/or the number of the allowed operation service instances greater than or equal to the service instance threshold value, and the capacity reduction interval between the current time and the last capacity reduction time.
In the embodiment of the present disclosure, when the current resource request ratio and/or the number of allowed service instances is greater than or equal to the preset resource ratio threshold and/or the preset service instance threshold, the duration starts to be calculated, for example, the preset service instance threshold is set to 1, when the number of allowed service instances is greater than or equal to 1, the duration starts to be calculated, and when the number of allowed service instances is less than 1, the duration stops to be calculated, so as to obtain the duration; for example, when the current resource request ratio is greater than or equal to thirty percent, the calculation of the duration is started, and when the current resource request ratio is less than thirty percent, the calculation of the duration is stopped, so as to obtain the duration; for example, the preset service instance threshold is 1 and the preset resource ratio threshold is thirty percent, when the number of the allowed service instances is greater than or equal to 1 and the current resource request ratio is greater than or equal to thirty percent, the duration is started to be calculated, and when the number of the allowed service instances is less than 1 and/or the current resource request ratio is less than thirty percent, the duration is stopped to be calculated, so as to obtain the duration, for example, the duration is calculated from the time 12/7/8/2021 year to the time 30 minutes from the time 12/7/8/2021 year, and then the duration is determined to be 30 minutes.
In order to further improve the accuracy of the capacity reduction opportunity, the embodiment of the disclosure further determines whether to perform capacity reduction processing according to the duration, the capacity reduction interval between the current time and the last capacity reduction time.
And 104, under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, calculating a comprehensive score of each node in the target cluster according to a preset capacity reduction factor, and performing capacity reduction processing on the cluster based on the comprehensive score.
The preset duration threshold may be set according to the application scenario needs, or may be automatically set based on the cluster environment, and it may be understood that the duration thresholds corresponding to different clusters may be different; the capacity reduction interval refers to the length of the time interval between the current capacity reduction action and the last capacity reduction action.
Specifically, under the condition that the duration is greater than a preset duration threshold and the capacity reduction time interval is greater than a preset interval threshold, the duration is greater than the duration threshold and the time interval is greater than the interval threshold, a comprehensive score of each node in the target cluster is calculated according to a preset capacity reduction factor, and capacity reduction processing is performed on the cluster based on the comprehensive score.
As an example, when the current resource request ratio is greater than or equal to the preset resource ratio threshold and the number of allowed service instances is greater than or equal to the preset service instance threshold, the cluster capacity reduction will be triggered when the duration is greater than the preset duration threshold and the capacity reduction time interval between the current time and the last capacity reduction time is greater than the preset interval threshold. For example: setting a preset resource ratio threshold value as twenty percent, a preset service instance threshold value as 30, a duration threshold value as 10 minutes and an interval threshold value as 15 minutes, and when the current resource request ratio value is greater than or equal to twenty percent and the number of allowed service instances is greater than or equal to 30, the duration is greater than 10 minutes and the size reduction interval between the current time and the last size reduction time is greater than 15 minutes, triggering size reduction.
Wherein the preset capacity reduction factor comprises one or more of application priority, application stability, available area balance and minimum copy number.
In the embodiment of the disclosure, the comprehensive score of each node in the cluster is calculated according to the preset capacity reduction factor, and there are various ways of capacity reduction processing on the cluster based on the comprehensive score, in a specific embodiment, the application priority, the application stability, the available area balance and the minimum copy number corresponding to each node are obtained, a calculation is performed based on a first score value corresponding to the application priority, a second score value corresponding to the application stability, a third score value corresponding to the available area balance and a fourth score value corresponding to the minimum copy number of each node to obtain a comprehensive score corresponding to each node, and sequencing each node from large to small according to the numerical value corresponding to the comprehensive score, acquiring the nodes of the target number before sequencing as the machine to be reduced, transferring all applications in the machine to be reduced to other machines, and setting the machine to be reduced to be in an unavailable state.
The capacity reduction processing scheme based on the cluster provided by the embodiment of the disclosure obtains the current resource request ratio and/or the number of the service instances allowed to operate of the target cluster, judges whether the current resource request ratio and/or the number of the service instances allowed to operate are greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold, obtains the duration of the current resource request ratio greater than or equal to the resource ratio threshold and/or the number of the service instances allowed to operate greater than or equal to the service instance threshold and the capacity reduction interval between the current time and the last capacity reduction time, calculates the comprehensive score of each node in the target cluster according to a preset capacity reduction factor under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, performs capacity reduction processing on the cluster based on the comprehensive score, and adopts the technical scheme, the cluster capacity reduction method and the cluster capacity reduction system can accurately know the use condition of cluster resources, the current resource request ratio and/or the number of the allowed operation service instances of the cluster, and automatically trigger the cluster capacity reduction by setting capacity reduction threshold values and actions on the indexes.
Fig. 2 is a schematic flow chart of another method for processing a reduced volume based on a cluster according to an embodiment of the present disclosure, which includes:
step 201, obtaining all resource amounts and requested resource amounts corresponding to the target cluster, calculating a ratio of the requested resource amounts and all resource amounts to obtain a current resource request ratio, obtaining the total number of the service instances allowed to operate of the target cluster and the number of the service instances already operated, calculating a difference value between the total number of the service instances allowed to operate and the number of the service instances already operated, and obtaining the number of the service instances allowed to operate.
The requested resource amount refers to the size values of the memory and the CPU corresponding to the target cluster, and the requested resource amount refers to the size values of the memory and the CPU receiving the request, and is not an actual usage amount but only the resource amount of the received request, and the target cluster has reserved the requested resource in advance.
The total number of the service instances allowed to run refers to the total numerical value of the service instances allowed to run corresponding to the target cluster, and the number of the run service instances refers to the numerical value of the service instances which are running or have run corresponding to the target cluster.
In order to more clearly illustrate the current resource request ratio and/or the number of service instances allowed to run, in the embodiment of the present disclosure, if all the acquired resource amounts of the cluster are 4, the requested resource amount is 1, and twenty-five percent of the ratio of the requested resource amount to all the resource amounts is obtained as the current resource request ratio; if the total number of the obtained cluster operation-allowed service instances is 5 and the number of the operation-allowed service instances is 2, obtaining a difference value 3 between the total number of the operation-allowed service instances and the number of the operation-allowed service instances, namely the number of the operation-allowed service instances.
Step 202, determining whether the current resource request ratio and/or the number of allowed service instances is greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold.
Step 203, obtaining the duration of the current resource request ratio value greater than or equal to the resource ratio threshold value and/or the number of the allowed operation service instances greater than or equal to the service instance threshold value, and the capacity reduction interval between the current time and the last capacity reduction time.
It should be noted that the steps 202-203 are the same as the steps 102-103, and refer to the description of the steps 102-103, which is not described in detail here.
And 204, acquiring the application priority, the application stability, the available area balance and the minimum number of copies corresponding to each node, and grading and sequencing the application priority, the application stability, the available area balance and the minimum number of copies.
In the embodiment of the present disclosure, if the first score value of the application priority corresponding to the node a is 1 score, the second score value of the application stability corresponding to the node B is 2 score, the third score value of the available partition balance corresponding to the node a is 1 score, the fourth score value of the least number of copies corresponding to the node B is 2 score, the first score value of the application priority corresponding to the node B is 2 score, the second score value of the application stability corresponding to the node B is 3 score, the third score value of the available partition balance corresponding to the node a is 2 score, the fourth score value of the least number of copies corresponding to the node B is 1 score, the first score value of the application priority corresponding to the node C is 1 score, the second score value of the application stability corresponding to the node B is 1 score, the third score value of the available partition balance corresponding to the node B is 3 score, and the fourth score value of the least number of copies corresponding to the node B is 2 score, then the node A, B, C is sorted according to the scores, and the highest score of the node B is used as a machine to be contracted, and migrate all of its applications to other machines while setting the node B to an unavailable state.
It should be noted that, if some nodes in the cluster are ranked consistently, the nodes are sorted according to characters.
And step 205, obtaining weights corresponding to the application priority, the application stability, the available area balance and the minimum copy number, and calculating based on the score value and the weights to obtain a comprehensive score corresponding to each node.
In this embodiment of the present disclosure, if the first weight corresponding to the application priority of the node W is 20%, the second weight corresponding to the application stability is 30%, the third weight corresponding to the available region balance is 10%, and the fourth weight corresponding to the minimum copy number is 40%, where the sum of the first weight, the second weight, the third weight, and the fourth weight is 1, and then the sum is multiplied by the first score value E of the application priority, the second score value F corresponding to the application stability, the third score value G corresponding to the available region balance, and the fourth score value H corresponding to the minimum copy number, respectively, and then the sum is performed, so that the comprehensive score of the node W is: 20% E + 30% F + 10% G + 40% H.
And step 206, receiving the set capacity reduction time, detecting that the current time is the capacity reduction time, calculating a comprehensive score of each node in the cluster according to a preset capacity reduction factor, and carrying out capacity reduction processing on the cluster based on the comprehensive score.
In the embodiment of the disclosure, the cluster can be scaled regularly according to the scaling time required to be set by the application scene, in some embodiments, the set scaling time is 7 am every day, and then when the current time is detected to be 7 am, the machine to be scaled performs scaling processing according to the comprehensive score at 7 am every day.
And step 207, generating the capacity reduction notification information, and sending the capacity reduction notification information to the target equipment.
Specifically, after the machine to be reduced finishes reducing the volume, a reduction notification message may be generated, and the content of the message may be "12/7/2021, and the system has finished reducing the volume of 5 machines to be reduced", optionally, the message may also be sent to the target device by means of voice, telephone, or the like.
And step 208, receiving a capacity reduction stopping instruction, and stopping capacity reduction processing on the target cluster based on the capacity reduction stopping instruction.
Specifically, if an instruction of stopping capacity reduction is received, the capacity reduction processing of the target cluster is stopped, optionally, the cluster capacity reduction can also be set to be closed at a fixed time, and if the time for closing the capacity reduction at the fixed time is set to 18 points per day, the cluster stops the capacity reduction when 18 points per day are detected.
And step 209, acquiring the capacity reduction state, the capacity reduction time and the capacity reduction reason, and storing the capacity reduction state, the capacity reduction time and the capacity reduction reason in a target position.
Optionally, the capacity reduction state, the capacity reduction time, and the capacity reduction reason may be used as conditions for triggering the capacity reduction next time.
The target location may be understood as any storage location of the cluster management server, and may be selected according to the application scenario requirement.
The capacity reduction processing scheme based on the cluster provided by the embodiment of the disclosure adopts the technical scheme to obtain all resource amounts and requested resource amounts corresponding to a target cluster, calculate the ratio of the requested resource amounts and all resource amounts to obtain the current resource request ratio, obtain the total number of the allowed operation service instances and the number of the operated service instances of the target cluster, calculate the difference value between the total number of the allowed operation service instances and the number of the operated service instances to obtain the number of the allowed operation service instances, judge whether the current resource request ratio and/or the number of the allowed operation service instances are greater than or equal to the preset resource ratio threshold and/or the preset service instance threshold, obtain the duration of the current resource request ratio greater than or equal to the resource ratio threshold and/or the number of the allowed operation service instances greater than or equal to the service instance threshold, and obtain the duration of the current resource request ratio greater than or equal to the resource ratio threshold and/or the number of the allowed operation service instances greater than or equal to the service instance threshold, And a capacity reduction interval between the current time and the last capacity reduction time, acquiring application priority, application stability, available area balance and the minimum copy number corresponding to each node, grading and sequencing the application priority, the application stability, the available area balance and the weight corresponding to the minimum copy number, calculating based on the score value and the weight to acquire a comprehensive score corresponding to each node, receiving set capacity reduction time, detecting that the current time is the capacity reduction time, calculating the comprehensive score of each node in the cluster according to a preset capacity reduction factor, carrying out capacity reduction processing on the cluster based on the comprehensive score to generate capacity reduction notification information, sending the capacity reduction notification information to target equipment, receiving a capacity reduction termination instruction, stopping carrying out the capacity reduction processing on the cluster based on the capacity reduction termination instruction, acquiring the capacity reduction state, the capacity reduction time and the capacity reduction reason, and recording the capacity reduction state, The capacity reduction time and the capacity reduction reason are stored in the target position, a plurality of capacity reduction indexes can be supported to jointly trigger the capacity reduction, when a plurality of indexes are configured, any one of the capacity reduction indexes meets the condition to trigger the capacity reduction, and the capacity reduction can be carried out according to the requirement, so that the target cluster can be ensured to timely reduce the capacity to ensure the normal operation of the service.
Fig. 3 is a schematic flow chart of another capacity reduction processing method based on a cluster according to an embodiment of the present disclosure, which includes first calculating a current resource request ratio and/or a number of service instances allowed to run, then determining whether the current resource request ratio is greater than or equal to a preset resource ratio threshold and/or the number of service instances allowed to run is greater than or equal to a preset service instance threshold, where capacity reduction can be triggered when the current resource request ratio and the number of service instances allowed to run meet one of the conditions, and further determining whether to perform capacity reduction processing according to whether a duration is greater than a user-preset duration threshold and whether a capacity reduction interval between the current time and a last capacity reduction time is greater than an interval threshold, and finally selecting a most suitable machine to be capacity reduced according to a capacity reduction policy, and migrating all applications in the machine to be capacity reduced to other machines, and sets the machine to be downsized to an unusable state while removing the machine.
Fig. 4 is a schematic structural diagram of a capacity reduction processing apparatus based on a cluster according to an embodiment of the present disclosure, where the apparatus includes: a first obtaining module 401, a judging module 402, a second obtaining module 403, and a first processing module 404, wherein,
a first obtaining module 401, configured to obtain a current resource request ratio and/or a number of service instances allowed to run of a target cluster;
a determining module 402, configured to determine whether a current resource request ratio and/or a number of allowed service instances are greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold;
a second obtaining module 403, configured to obtain a duration that a current resource request ratio is greater than or equal to a resource ratio threshold and/or a number of allowed service instances is greater than or equal to a service instance threshold, and a capacity reduction interval between a current time and a last capacity reduction time;
a first processing module 404, configured to calculate, according to a preset capacity reduction factor, a composite score of each node in the target cluster when the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, and perform capacity reduction processing on the cluster based on the composite score.
Optionally, the first obtaining module 401 is specifically configured to:
acquiring all resource quantities and requested resource quantities corresponding to a target cluster;
and calculating the ratio of the requested resource quantity to all the resource quantities to obtain the current resource request ratio.
Acquiring the total number of the allowed operation service instances and the number of the operated service instances of the target cluster;
and calculating the difference value between the total number of the operation-allowed service instances and the number of the operated service instances to obtain the number of the operation-allowed service instances.
Optionally, the first processing module 404 is specifically configured to include:
acquiring application priority, application stability, available area balance and minimum copy number corresponding to each node;
calculating based on a first score value corresponding to the application priority of each node, a second score value corresponding to the application stability, a third score value corresponding to the available area balance and a fourth score value corresponding to the minimum copy number to obtain a comprehensive score corresponding to each node;
and sequencing each node from large to small according to the numerical value corresponding to the comprehensive score, acquiring the nodes of the target number before sequencing as the machine to be reduced, transferring all applications in the machine to be reduced to other machines, and setting the machine to be reduced to be in an unavailable state.
Optionally, the apparatus further comprises:
the third acquisition module is used for acquiring a first weight corresponding to the application priority, a second weight corresponding to the application stability, a third weight corresponding to the available area balance and a fourth weight corresponding to the minimum number of copies; wherein the sum of the first weight, the second weight, the third weight and the fourth weight is 1;
the calculation module is configured to calculate based on a first score value corresponding to the application priority of each node, a second score value corresponding to the application stability, a third score value corresponding to the available area balance, and a fourth score value corresponding to the minimum copy number, and obtain a comprehensive score corresponding to each node, including: and calculating based on the first score value and the first weight corresponding to the application priority, the second score value and the second weight corresponding to the application stability, the third score value and the third weight corresponding to the available region balance and the fourth score value and the fourth weight corresponding to the minimum copy number to obtain a comprehensive score corresponding to each node.
Optionally, the apparatus further comprises:
the first receiving module is used for receiving the set capacity reduction time;
and the second processing module is used for detecting that the current moment is the capacity reduction time, calculating the comprehensive score of each node in the cluster according to the preset capacity reduction factor, and carrying out capacity reduction processing on the cluster based on the comprehensive score.
Optionally, the apparatus further comprises:
the generating module is used for generating the capacity reduction notification information;
and the sending module is used for sending the abbreviated content notification message to the target equipment.
Optionally, the apparatus further comprises:
the second receiving module receives a capacity reduction termination instruction;
and the stopping module is used for stopping the capacity reduction processing of the target cluster based on the capacity reduction stopping instruction.
Optionally, the apparatus further comprises:
the fourth acquisition module is used for acquiring the capacity reduction state, the capacity reduction time and the capacity reduction reason;
and the storage module is used for storing the capacity reduction state, the capacity reduction time and the capacity reduction reason in the target position.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for processing a reduced capacity based on a cluster is characterized by comprising the following steps:
acquiring the current resource request ratio and/or the number of allowed operation service instances of a target cluster;
judging whether the current resource request ratio and/or the number of the allowed operation service instances is larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold;
acquiring the duration of the current resource request ratio value which is more than or equal to the resource ratio threshold value and/or the number of the allowed operation service instances which is more than or equal to the service instance threshold value, and the capacity reduction interval between the current time and the last capacity reduction time;
and under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, calculating a comprehensive score of each node in the target cluster according to a preset capacity reduction factor, and performing capacity reduction processing on the cluster based on the comprehensive score.
2. The method according to claim 1, wherein the obtaining the current resource request ratio of the target cluster comprises:
acquiring all resource quantities and requested resource quantities corresponding to the target cluster;
and calculating the ratio of the requested resource quantity to all the resource quantities to obtain the current resource request ratio.
3. The method according to claim 1, wherein the obtaining the number of service instances allowed to run by the target cluster comprises:
acquiring the total number of the allowed operation service instances and the number of the operated service instances of the target cluster;
and calculating the difference value between the total number of the operation-allowed service instances and the number of the operated service instances to obtain the number of the operation-allowed service instances.
4. The method according to claim 1, wherein the calculating a composite score of each node in the target cluster according to a preset capacity reduction factor, and performing capacity reduction on the cluster based on the composite score includes:
acquiring application priority, application stability, available area balance and minimum copy number corresponding to each node;
calculating based on a first score value corresponding to the application priority of each node, a second score value corresponding to application stability, a third score value corresponding to available area balance and a fourth score value corresponding to the minimum copy number to obtain a comprehensive score corresponding to each node;
and sequencing each node according to the numerical value corresponding to the comprehensive score from large to small, acquiring nodes with the target number before sequencing as a machine to be reduced, migrating all applications in the machine to be reduced to other machines, and setting the machine to be reduced to be in an unavailable state.
5. The method of claim 4, further comprising:
acquiring a first weight corresponding to the application priority, a second weight corresponding to the application stability, a third weight corresponding to the available area balance and a fourth weight corresponding to the minimum number of copies; wherein a sum of the first weight, the second weight, the third weight, and the fourth weight is 1;
calculating based on a first score value corresponding to the application priority of each node, a second score value corresponding to application stability, a third score value corresponding to available area balance and a fourth score value corresponding to the minimum copy number to obtain a comprehensive score corresponding to each node, including:
and calculating based on the first score value and the first weight corresponding to the application priority, the second score value and the second weight corresponding to the application stability, the third score value and the third weight corresponding to the available area balance, and the fourth score value and the fourth weight corresponding to the minimum copy number to obtain the comprehensive score corresponding to each node.
6. The method of claim 1, further comprising:
receiving the set capacity reduction time;
and detecting that the current moment is the capacity reduction time, calculating a comprehensive score of each node in the cluster according to a preset capacity reduction factor, and carrying out capacity reduction processing on the cluster based on the comprehensive score.
7. The method of claim 1, further comprising:
generating a capacity reduction notification message;
and sending the capacity reduction notification message to a target device.
8. The method of claim 1, further comprising:
receiving a capacity reduction stopping instruction;
and stopping carrying out capacity reduction processing on the target cluster based on the capacity reduction stopping instruction.
9. The method according to claim 1, further comprising, after the performing the capacity reduction processing on the cluster according to the preset capacity reduction policy:
acquiring a capacity reduction state, capacity reduction time and a capacity reduction reason;
and storing the capacity reduction state, the capacity reduction time and the capacity reduction reason in a target position.
10. A cluster-based capacity reduction processing apparatus, comprising:
the first acquisition module is used for acquiring the current resource request ratio and/or the number of allowed operation service instances of the target cluster;
the judging module is used for judging whether the current resource request ratio and/or the number of the allowed operation service instances is larger than or equal to a preset resource ratio threshold and/or a preset service instance threshold;
a second obtaining module, configured to obtain a duration that the current resource request ratio is greater than or equal to the resource ratio threshold and/or the number of service instances allowed to run is greater than or equal to the service instance threshold, and a capacity reduction interval between a current time and a last capacity reduction time;
and the first processing module is used for calculating a comprehensive score of each node in the target cluster according to a preset capacity reduction factor under the condition that the duration is greater than a preset duration threshold and the capacity reduction interval is greater than a preset interval threshold, and performing capacity reduction processing on the cluster based on the comprehensive score.
CN202111574571.2A 2021-12-21 2021-12-21 Capacity reduction processing method and device based on cluster Active CN114356558B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111574571.2A CN114356558B (en) 2021-12-21 2021-12-21 Capacity reduction processing method and device based on cluster
JP2022010108A JP7103705B1 (en) 2021-12-21 2022-01-26 Cluster-based capacity reduction processing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111574571.2A CN114356558B (en) 2021-12-21 2021-12-21 Capacity reduction processing method and device based on cluster

Publications (2)

Publication Number Publication Date
CN114356558A true CN114356558A (en) 2022-04-15
CN114356558B CN114356558B (en) 2022-11-18

Family

ID=81100925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111574571.2A Active CN114356558B (en) 2021-12-21 2021-12-21 Capacity reduction processing method and device based on cluster

Country Status (2)

Country Link
JP (1) JP7103705B1 (en)
CN (1) CN114356558B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129484A (en) * 2022-09-02 2022-09-30 浙江大华技术股份有限公司 Cluster capacity expansion and contraction method and device, storage medium and electronic device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932231B (en) * 2023-09-18 2023-12-22 北京睿企信息科技有限公司 Expansion and contraction system of distributed cluster
CN116932290B (en) * 2023-09-18 2023-12-08 北京睿企信息科技有限公司 Data processing system for obtaining target model
CN117112236B (en) * 2023-10-23 2024-02-20 山东曙光照信息技术股份有限公司 Jurisdictional server configuration method and system based on data inrush current and volatility prediction

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180109610A1 (en) * 2015-05-01 2018-04-19 Amazon Technologies, Inc. Automatic scaling of resource instance groups within compute clusters
US20180219792A1 (en) * 2012-11-05 2018-08-02 Sea Street Technologies, Inc. Systems and methods for provisioning and managing an elastic computing infrastructure
CN108429631A (en) * 2017-02-15 2018-08-21 华为技术有限公司 A kind of method and device of network service instantiation
CN109412874A (en) * 2018-12-21 2019-03-01 腾讯科技(深圳)有限公司 Configuration method, device, server and the storage medium of device resource
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109766175A (en) * 2018-12-28 2019-05-17 深圳晶泰科技有限公司 Resource elastic telescopic system and its dispatching method towards high-performance calculation on cloud
CN111324596A (en) * 2020-03-06 2020-06-23 腾讯科技(深圳)有限公司 Data migration method and device for database cluster and electronic equipment
CN111464616A (en) * 2020-03-30 2020-07-28 招商局金融科技有限公司 Method, server and storage medium for automatically adjusting number of application load services
CN112181649A (en) * 2020-09-22 2021-01-05 广州品唯软件有限公司 Container resource adjusting method and device, computer equipment and storage medium
CN113190343A (en) * 2020-01-14 2021-07-30 阿里巴巴集团控股有限公司 Application instance control method, device, equipment and system
CN113806010A (en) * 2021-08-13 2021-12-17 济南浪潮数据技术有限公司 Dynamic adjustment method, device and medium for service personalized configuration

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010146420A (en) * 2008-12-22 2010-07-01 Hitachi Ltd Surplus resource management system, management method thereof, and server device
JP5378946B2 (en) * 2009-10-26 2013-12-25 株式会社日立製作所 Server management apparatus and server management method
JP5843459B2 (en) * 2011-03-30 2016-01-13 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Information processing system, information processing apparatus, scaling method, program, and recording medium
JP6248560B2 (en) * 2013-11-13 2017-12-20 富士通株式会社 Management program, management method, and management apparatus
WO2020103440A1 (en) * 2018-11-20 2020-05-28 Huawei Technologies Co., Ltd. Distributed resource management by improving cluster diversity

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180219792A1 (en) * 2012-11-05 2018-08-02 Sea Street Technologies, Inc. Systems and methods for provisioning and managing an elastic computing infrastructure
US20180109610A1 (en) * 2015-05-01 2018-04-19 Amazon Technologies, Inc. Automatic scaling of resource instance groups within compute clusters
CN108429631A (en) * 2017-02-15 2018-08-21 华为技术有限公司 A kind of method and device of network service instantiation
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109412874A (en) * 2018-12-21 2019-03-01 腾讯科技(深圳)有限公司 Configuration method, device, server and the storage medium of device resource
CN109766175A (en) * 2018-12-28 2019-05-17 深圳晶泰科技有限公司 Resource elastic telescopic system and its dispatching method towards high-performance calculation on cloud
CN113190343A (en) * 2020-01-14 2021-07-30 阿里巴巴集团控股有限公司 Application instance control method, device, equipment and system
CN111324596A (en) * 2020-03-06 2020-06-23 腾讯科技(深圳)有限公司 Data migration method and device for database cluster and electronic equipment
CN111464616A (en) * 2020-03-30 2020-07-28 招商局金融科技有限公司 Method, server and storage medium for automatically adjusting number of application load services
CN112181649A (en) * 2020-09-22 2021-01-05 广州品唯软件有限公司 Container resource adjusting method and device, computer equipment and storage medium
CN113806010A (en) * 2021-08-13 2021-12-17 济南浪潮数据技术有限公司 Dynamic adjustment method, device and medium for service personalized configuration

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SHUANGCHENG NIU 等: "Building Semi-Elastic Virtual Clusters for Cost-Effective HPC Cloud Resource Provisioning", 《IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS》 *
倪海峰: "基于Kubernetes的云平台HPA算法的优化与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
李斌吉: "云平台应用性能监控与资源扩容机制研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
肖荣生: "集群管理系统自动弹性伸缩服务与约束调度研究 ——以WebGIS应用为例", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129484A (en) * 2022-09-02 2022-09-30 浙江大华技术股份有限公司 Cluster capacity expansion and contraction method and device, storage medium and electronic device

Also Published As

Publication number Publication date
JP7103705B1 (en) 2022-07-20
CN114356558B (en) 2022-11-18
JP2023092413A (en) 2023-07-03

Similar Documents

Publication Publication Date Title
CN114356558B (en) Capacity reduction processing method and device based on cluster
CN106933650B (en) Load management method and system of cloud application system
CN109586952B (en) Server capacity expansion method and device
CN110221915B (en) Node scheduling method and device
CN108768877B (en) Distribution method and device of burst traffic and proxy server
CN114356557B (en) Cluster capacity expansion method and device
CN109218408B (en) Method, medium, computer device and blockchain system for implementing consensus mechanism of blockchain system
CN110659123B (en) Distributed task distribution scheduling method and device based on message
CN110582064B (en) Short message distribution method, device, equipment and medium
CN114296867A (en) Container operation method and system of cloud platform and related device
CN111381928B (en) Virtual machine migration method, cloud computing management platform and storage medium
CN111010303A (en) Server control method and device
CN117112701B (en) Node switching method in distributed database, computer equipment and storage medium
CN114490078A (en) Dynamic capacity reduction and expansion method, device and equipment for micro-service
CN114443212A (en) Thermal migration management method, device, equipment and storage medium
CN112163734B (en) Cloud platform-based setting computing resource dynamic scheduling method and device
CN105868002B (en) Method and device for processing retransmission request in distributed computing
CN111143073B (en) Virtualized resource management method, device and storage medium
CN110851286B (en) Thread management method and device, electronic equipment and storage medium
CN109471703B (en) Cloud environment-based virtual machine secure migration method and device
CN112350894A (en) Performance test method, device, equipment and storage medium of service node
CN113867926A (en) Cloud environment management method, cloud environment management platform and storage medium
CN115640109B (en) Task scheduling method, system and client
CN113407192B (en) Model deployment method and device
CN116996517B (en) Load balancing method, device, electronic equipment and medium

Legal Events

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