CN114356558B - 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
CN114356558B
CN114356558B CN202111574571.2A CN202111574571A CN114356558B CN 114356558 B CN114356558 B CN 114356558B CN 202111574571 A CN202111574571 A CN 202111574571A CN 114356558 B CN114356558 B CN 114356558B
Authority
CN
China
Prior art keywords
capacity reduction
cluster
preset
service instances
threshold
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
CN202111574571.2A
Other languages
Chinese (zh)
Other versions
CN114356558A (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 device based on a cluster, which comprises the steps of obtaining the current resource request ratio and/or the number of service instances allowed to operate of a target cluster, judging whether the current resource request ratio and/or the number of the service instances allowed to operate 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 the service instances allowed to operate larger than or equal to the service instance threshold and the capacity reduction interval between the current moment and the last capacity reduction moment, calculating the comprehensive score 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, and carrying out capacity reduction processing on the cluster based on the comprehensive score, thereby accurately judging whether the cluster needs capacity reduction and carrying out the capacity reduction processing based on a related capacity reduction strategy, ensuring that the resource demand of services is solved and saving cost is simultaneously.

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 are 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 value 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 and/or the number of allowed service instances is greater than or equal to the resource ratio threshold and/or the number of allowed service instances is greater than or equal to the service instance threshold is obtained, and a capacity reduction interval between the current time and a last capacity reduction time is obtained, 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, a comprehensive score of each node in the target cluster is calculated according to a preset capacity reduction factor, and the cluster is subjected to capacity reduction processing based on the comprehensive score, so that whether the cluster needs to perform capacity reduction can be accurately judged, and the capacity reduction processing is performed based on a relevant capacity reduction strategy, thereby ensuring that resource requirements of services are met and cost is saved.
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 flowchart 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 flowchart of another method for processing a reduced volume based on a cluster 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.
Step 102, judging whether the current resource request ratio and/or the number of allowed operation service instances is 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 satisfied, and capacity reduction is triggered.
103, obtaining the duration of the current resource request ratio value which is greater than or equal to the resource ratio threshold value and/or the number of the allowed operation service instances which is 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 judges whether to perform capacity reduction processing according to the duration and 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 contraction interval refers to the length of the time interval between the current contraction action and the last contraction 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, a comprehensive score of each node in a cluster is calculated according to a 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, an application priority, an application stability, an available region balance and a minimum number of copies corresponding to each node are obtained, a first fractional value corresponding to the application priority, a second fractional value corresponding to the application stability, a third fractional value corresponding to the available region balance and a fourth fractional value corresponding to the minimum number of copies of each node are obtained, a comprehensive score corresponding to each node is obtained, each node is ranked from the largest to the smallest according to a numerical value corresponding to the comprehensive score, a target number of nodes before ranking is obtained as a machine to be capacity reduced, all applications in the machine to be capacity reduced are migrated to other machines, and the machine to be capacity reduced is set to be in an unavailable state.
The capacity reduction processing scheme based on the cluster provided by the embodiment of the disclosure obtains a current resource request ratio and/or a number of service instances allowed to run of a target cluster, judges whether the current resource request ratio and/or the number of the service instances allowed to run are greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold, obtains a duration time that the current resource request ratio is greater than or equal to the resource ratio threshold and/or the number of the service instances allowed to run is greater than or equal to the service instance threshold, and a capacity reduction interval between the current time and the capacity reduction time, calculates a comprehensive score of each node in the target cluster according to a preset capacity reduction factor under the condition that the duration time is greater than the preset duration threshold and the capacity reduction interval is greater than the preset interval threshold, performs capacity reduction processing on the cluster based on the comprehensive score, can accurately know the use condition of cluster resources, the current resource request ratio and/or the number of the service instances allowed to run of the cluster, automatically triggers the cluster capacity reduction by setting the capacity reduction threshold and actions on the indexes, judges whether the required stability of the comprehensive resource request ratio and/or the number of the service instances required to be processed is reduced, and whether the stability of the required to be solved, and the required stability of the service instances can be further accurately combined with the required to be solved.
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 number of the service instances allowed to run refers to all numerical values of the service instances allowed to run corresponding to the target cluster, and the number of the service instances already run refers to the numerical values of the service instances already running or already running 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, judging whether the current resource request ratio and/or the number of allowed operation service instances is larger 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 steps 202-203 are the same as steps 102-103 described above, and refer to the description of steps 102-103, which will not be 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 this embodiment of the present disclosure, if the first application priority score value corresponding to the node a is 1 score, the second application priority score value corresponding to the application stability is 2 scores, the third application priority score value corresponding to the available partition balance is 1 score, the fourth score value corresponding to the least duplicate number is 2 scores, the first application priority score value corresponding to the node B is 2 scores, the second application stability score value corresponding to the application stability is 3 scores, the third application score value corresponding to the available partition balance is 2 scores, the fourth score value corresponding to the least duplicate number is 1 score, the first application priority score value corresponding to the node C is 1 score, the second application priority score value corresponding to the application stability is 1 score, the third application score value corresponding to the available partition balance is 3 scores, and the fourth score value corresponding to the least duplicate number is 2 scores, then the nodes a, B, and C are sorted according to the scores, the score of the node B is the highest, the node B is used as a machine to be scaled, all the applications of the node B are migrated to other machines, and the node B is set 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 above technical scheme to obtain all resource amounts and requested resource amounts corresponding to a target cluster, calculate a ratio of the requested resource amounts and all resource amounts to obtain a current resource request ratio, obtain the total number of allowed operation service instances and the number of operated service instances of the target cluster, calculate a difference value between the total number of allowed operation service instances and the number of operated service instances to obtain the number of allowed operation service instances, judge whether the current resource request ratio and/or the number of allowed operation service instances are greater than or equal to a preset resource ratio threshold and/or a preset service instance threshold, obtain a duration of the current resource request ratio greater than or equal to the resource ratio threshold and/or the number of allowed operation service instances greater than or equal to the service instance threshold, and obtain 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, scoring and sequencing the application priority, acquiring weights corresponding to the application priority, the application stability, the available area balance and the minimum copy number, calculating based on the score values and the weights to obtain a comprehensive score corresponding to each node, receiving set capacity reduction time, detecting that the current moment is the capacity reduction time, calculating the comprehensive score of each node in a cluster according to preset capacity reduction factors, 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, and acquiring a capacity reduction state, the capacity reduction time and a capacity reduction reason, the capacity reduction state, the capacity reduction time and the capacity reduction reason are stored in a target position, a plurality of capacity reduction indexes can be supported to jointly trigger capacity reduction, when a plurality of indexes are configured, any one capacity reduction index can trigger capacity reduction when meeting conditions, and capacity reduction can be carried out according to requirements, so that the target cluster can be ensured to timely reduce capacity to ensure normal operation of services.
Fig. 3 is a flowchart of another capacity reduction processing method based on a cluster according to an embodiment of the present disclosure, which includes calculating a current resource request ratio and/or a number of service instances allowed to run, 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 may 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 the 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, migrating all applications in the machine to be capacity reduced to other machines, and setting the machine to be capacity reduced to an unavailable state and removing machines at the same time.
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 the current resource request ratio is greater than or equal to the resource ratio threshold and/or the number of allowed service instances is greater than or equal to the service instance threshold, and a capacity reduction interval between the current time and the 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 service instances allowed to operate and the number of the operated service instances to obtain the number of the service instances allowed to operate.
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 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 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 application stability, a third score value corresponding to available area balance, and a fourth score value corresponding to the minimum copy number, so as to obtain a comprehensive score corresponding to each node, and the calculation module includes: 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, are 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like 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 (6)

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 the number of allowed operation service instances of a target cluster; wherein the obtaining of the number of allowed service instances of 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; 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; the obtaining of the current resource request ratio of the target cluster includes: acquiring all resource quantities and requested resource quantities corresponding to the target cluster; calculating the ratio of the requested resource quantity to all the resource quantities to obtain the current resource request ratio; the requested resource amount refers to the size values of the memory and the CPU which receive the request, is not the actual usage amount, but only the received requested resource amount, and the target cluster reserves the requested resource in advance;
judging whether the current resource request ratio is greater than or equal to a preset resource ratio threshold and whether the number of the allowed operation service instances is greater than or equal to 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 the number of the service instances allowed to run 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;
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 carrying out capacity reduction processing on the cluster based on the comprehensive score;
the method for calculating the comprehensive score of each node in the target cluster according to the preset capacity reduction factor and carrying out capacity reduction processing on the cluster based on the comprehensive score comprises the following steps:
acquiring application priority, application stability, available area balance and the minimum number of copies 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;
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;
after the capacity reduction processing is performed on the cluster according to the preset capacity reduction strategy, the method further includes:
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.
2. The method of claim 1, 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 composite 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.
3. 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.
4. The method of claim 1, further comprising:
generating a capacity reduction notification message;
and sending the capacity reduction notification message to the target equipment.
5. The method of claim 1, further comprising:
receiving a capacity reduction stopping instruction;
and stopping the capacity reduction processing of the target cluster based on the capacity reduction stopping instruction.
6. A cluster-based capacity reduction processing apparatus, comprising:
the first acquisition module is used for acquiring the current resource request ratio and the number of the allowed operation service instances of the target cluster; the obtaining of the number of the allowed service instances of the target cluster includes: acquiring the total number of the allowed operation service instances and the number of the operated service instances of the target cluster; 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; the obtaining of the current resource request ratio of the target cluster includes: acquiring all resource quantities and requested resource quantities corresponding to the target cluster; calculating the ratio of the requested resource quantity to all the resource quantities to obtain the current resource request ratio; the requested resource amount refers to the size values of the memory and the CPU which receive the request, is not the actual usage amount, but only the resource amount of the received request, and the target cluster reserves the requested resource in advance;
the judging module is used for judging whether the current resource request ratio is greater than or equal to a preset resource ratio threshold and whether the number of the allowed operation service instances is greater than or equal to 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 the number of allowed service instances is greater than or equal to the service instance threshold, and a capacity reduction interval between the current time and the last capacity reduction time;
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;
the method for calculating the comprehensive score of each node in the target cluster according to the preset capacity reduction factor and carrying out capacity reduction processing on the cluster based on the comprehensive score comprises the following steps:
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;
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;
after the capacity reduction processing is performed on the cluster according to the preset capacity reduction strategy, the method further includes:
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.
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 CN114356558A (en) 2022-04-15
CN114356558B true 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)

Families Citing this family (4)

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

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113190343A (en) * 2020-01-14 2021-07-30 阿里巴巴集团控股有限公司 Application instance control method, device, equipment and system

Family Cites Families (13)

* 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
EP2915044B1 (en) * 2012-11-05 2023-06-07 Sea Street Technologies Inc. System and method for provisioning and managing an elastic computing infrastructure
JP6248560B2 (en) * 2013-11-13 2017-12-20 富士通株式会社 Management program, management method, and management apparatus
US9848041B2 (en) * 2015-05-01 2017-12-19 Amazon Technologies, Inc. Automatic scaling of resource instance groups within compute clusters
WO2020103440A1 (en) * 2018-11-20 2020-05-28 Huawei Technologies Co., Ltd. Distributed resource management by improving cluster diversity
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
CN111324596B (en) * 2020-03-06 2021-06-11 腾讯科技(深圳)有限公司 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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113190343A (en) * 2020-01-14 2021-07-30 阿里巴巴集团控股有限公司 Application instance control method, device, equipment and system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Building Semi-Elastic Virtual Clusters for Cost-Effective HPC Cloud Resource Provisioning;Shuangcheng Niu 等;《IEEE Transactions on Parallel and Distributed Systems》;20160701;第27卷(第7期);1915-1928 *
云平台应用性能监控与资源扩容机制研究;李斌吉;《中国优秀硕士学位论文全文数据库 信息科技辑》;20171215(第12期);I139-202 *
基于Kubernetes的云平台HPA算法的优化与实现;倪海峰;《中国优秀硕士学位论文全文数据库 信息科技辑》;20200615(第6期);I139-102 *
集群管理***自动弹性伸缩服务与约束调度研究 ——以WebGIS应用为例;肖荣生;《中国优秀硕士学位论文全文数据库 信息科技辑》;20190515(第5期);I138-664 *

Also Published As

Publication number Publication date
JP7103705B1 (en) 2022-07-20
CN114356558A (en) 2022-04-15
JP2023092413A (en) 2023-07-03

Similar Documents

Publication Publication Date Title
CN114356558B (en) Capacity reduction processing method and device based on cluster
CN108829494B (en) Container cloud platform intelligent resource optimization method based on load prediction
CN109586952B (en) Server capacity expansion method and device
CN106375420B (en) Server cluster intelligent monitoring system and method based on load balancing
CN106933650B (en) Load management method and system of cloud application system
CN108768877B (en) Distribution method and device of burst traffic and proxy server
CN110221915B (en) Node scheduling method and device
CN110417591B (en) Voting node configuration method and system
CN102904955B (en) The self-adapting stretching control system of Web application in cloud computing platform and method thereof
CN114356557B (en) Cluster capacity expansion method and device
CN111381928B (en) Virtual machine migration method, cloud computing management platform and storage medium
CN110096472A (en) The selection of management node in node cluster
CN105871983A (en) Method and device for selecting servers
CN114490078A (en) Dynamic capacity reduction and expansion method, device and equipment for micro-service
CN114780244A (en) Container cloud resource elastic allocation method and device, computer equipment and medium
CN117112701B (en) Node switching method in distributed database, computer equipment and storage medium
CN114443212A (en) Thermal migration management method, device, equipment and storage medium
CN114296868A (en) Virtual machine automatic migration decision method based on user experience in multi-cloud environment
CN112163734B (en) Cloud platform-based setting computing resource dynamic scheduling method and device
CN116382855A (en) Virtual machine migration method, electronic equipment and computer storage medium
CN111143073B (en) Virtualized resource management method, device and storage medium
CN109471703B (en) Cloud environment-based virtual machine secure migration method and device
CN107368355A (en) The dynamic dispatching method and device of virtual machine
CN112350894A (en) Performance test method, device, equipment and storage medium of service node
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