Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the invention provides a configuration system of a cluster server, which comprises the following components: target server identification list a= { a1 ,A2 ,……,Ai ,……,Am A processor and a memory storing a computer program, wherein Ai For the i-th target server identifier, i=1, 2 … … m, m is the number of target servers, the target server identifier is the unique identity of the target server, and when the computer program is executed by the processor, the following steps are implemented, as shown in fig. 1:
s100, acquiring a first historical starting time list B= { B corresponding to A1 ,B2 ,……,Bi ,……,Bm },Bi ={Bi1 ,Bi2 ,……,Bij ,……,Bin },Bij Is Ai A corresponding jth first historical activation time period,j=1, 2 … … n, n is the number of first historical starting time periods, where the first historical starting time period is the time period when the target server completes the deployment and then starts in the first historical time slice.
Specifically, the ending time point of the first historical time slice is the current time point t0 。
Further, the starting time point of the first historical time slice is t1 Wherein t is1 =t0 Δt, Δt being a preset first historical time slice length.
Further, Δt has a value ranging from [30, 60], and those skilled in the art know that the first historical time slice length is set according to actual requirements.
Further, the first historical time slice length units are: and (3) days.
Specifically, the step S100 includes the steps of:
s101, acquiring a first key starting time length list F= { F corresponding to A1 ,F2 ,……,Fi ,……,Fm },Fi ={Fi1 ,Fi2 ,……,Fij ,……,Fin },Fij For a first historical time slice Ai The corresponding jth first key starting time length is the basic time when the target server completes the post-deployment starting, and the skilled person knows that any method for obtaining the basic time when the server completes the post-deployment starting in the prior art belongs to the protection scope of the invention.
Specifically, the unit of the first key start-up duration is: millisecond.
S103, acquiring a second key starting time length list G= { G corresponding to the A1 ,G2 ,……,Gi ,……,Gm },Gi ={Gi1 ,Gi2 ,……,Gij ,……,Gin },Gij For a first historical time slice Ai A corresponding j-th second critical activation time period, wherein the second critical activation time period is the lowest time consumption of activation after the target server completes deployment, and the person skilled in the artThe personnel know that in the prior art, any method for obtaining the minimum time consumption of starting after the server completes deployment belongs to the protection scope of the present invention, and is not described herein.
Specifically, the unit of the second key start-up duration is: millisecond.
S105, acquiring a first preset weight list H= { H corresponding to G1 ,H2 ,……,Hi ,……,Hm },Hi ={Hi1 ,Hi2 ,……,Hij ,……,Hin },Hij Is Gij The corresponding first preset weight is a weight capable of enabling the starting time consumption of the target server after deployment to reach the lowest time consumption, and the first preset weight is set by a person skilled in the art according to actual requirements as known by the person skilled in the art.
Specifically, the unit of the first preset weight is: and (5) luxury core.
S107 according to Fij 、Gij And Hij Acquisition of Bij Wherein B isij Meets the following conditions:
Bij =Fij +(Gij -Fij )/(min(Rij ,Hij )/Hij ),Rij is Ai The corresponding jth second preset weight is used for adjusting the first historical starting duration according to the server resource configuration of the target server, and the person skilled in the art knows that the second preset weight is set by the person skilled in the art according to the actual requirement.
Specifically, the unit of the second preset weight is: and (5) luxury core.
According to the method, the first accurate historical starting time list can be obtained according to the first key starting time, the second key starting time and the first preset weight in the first historical time slice, further, the first intermediate starting time is obtained, the configuration time of starting after the target server is deployed is determined by comparing the first intermediate starting time and the second intermediate starting time, the most reasonable configuration time can be obtained, resource waste is avoided, and the operation efficiency of the system is improved.
Specifically, the step S107 is preceded by the steps of:
s1, acquiring a preset resource allocation list U= { U corresponding to A1 ,U2 ,……,Ui ,……,Um },Ui ={Ui1 ,Ui2 ,Ui3 },Ui1 Is Ai Corresponding to the preset CPU data processing amount, Ui2 Is Ai Corresponding preset GPU data processing amount, Ui3 Is Ai The corresponding preset memory data processing amount, wherein, the preset CPU data processing amount, the preset GPU data processing amount and the preset memory data processing amount are known to those skilled in the art, and are set by those skilled in the art according to actual requirements.
S2, acquiring a first intermediate resource configuration list V= { V corresponding to A1 ,V2 ,……,Vi ,……,Vm },Vi ={Vi1 ,Vi2 ,Vi3 },Vi1 Is Ai Corresponding first intermediate CPU data processing amount, Vi2 Is Ai Corresponding first intermediate GPU data processing amount, Vi3 Is Ai The corresponding first intermediate memory data processing amount, wherein the first intermediate CPU data processing amount is an actual CPU data processing amount required by the operation of the target server, the first intermediate GPU data processing amount is an actual GPU data processing amount required by the operation of the target server, and the first intermediate memory data processing amount is an actual memory data processing amount required by the operation of the target server, which is known to those skilled in the art, any method for obtaining the CPU data processing amount, the GPU data processing amount and the memory data processing amount required by the operation of the server in the prior art belongs to the protection scope of the present invention, and is not repeated herein.
S3, according to U and V, acquiring a first resource duty ratio list Z= { Z corresponding to A1 ,Z2 ,……,Zi ,……,Zm },Zi Is Ai A corresponding first resource duty cycle, wherein Zi Meets the following conditions:
Zi =(α1 (Vi1 /Ui1 )+α2 (Vi2 /Ui2 )+α3 (Vi3 /Ui3 ))/(α1 +α2 +α3 ) Wherein alpha is1 For a first preset resource duty weight for adjusting the resource duty ratio, alpha2 For a second preset resource duty weight for adjusting the resource duty, α3 For the third preset resource duty weight for adjusting the resource duty ratio, those skilled in the art know that the first preset resource duty weight, the second preset resource duty weight and the third preset resource duty weight are set by those skilled in the art according to actual demands.
S4, obtaining a second resource duty ratio ZY according to Z, wherein ZY meets the following conditions:
ZY=Σmi=1 (Zi )/m。
s5, when Zi When not less than ZY, determining Ui1 Is Ai Corresponding target CPU data processing amount, Ui2 Is Ai Corresponding target GPU data processing amount, Ui3 Is Ai Corresponding target memory data processing capacity.
S6, when Zi When < ZY, according to Ui Determination of Ai The corresponding target CPU data processing amount, target GPU data processing amount and target memory data processing amount.
Specifically, the step S6 includes the steps of:
s61 according to Ui Obtaining Ai Corresponding second intermediate resource configuration list SJi ={SJi1 ,SJi2 ,SJi3 },SJi1 Is Ai Corresponding second intermediate CPU data processing amount, SJi2 Is Ai Corresponding second intermediate GPU data processing amount, SJi3 Is Ai Corresponding second intermediate memory data processing capacity, wherein SJi1 、SJi2 、SJi3 Meets the following conditions:
SJi1 =α1 ×(1-β)×Ui1 /(α1 +α2 +α3 ) Where β is a preset weight for adjusting the data throughput, and those skilled in the art will knowIt is known that the preset weight for adjusting the data throughput is set by those skilled in the art according to actual demands;
SJi2 =α2 ×(1-β)×Ui2 /(α1 +α2 +α3 );
SJi3 =α3 ×(1-β)×Ui3 /(α1 +α2 +α3 )。
s63, obtaining Ai And the corresponding first operation identifier is an identifier which is generated to represent whether the target server can successfully operate or not when the server resource of the target server is configured as the second intermediate resource configuration.
S65, when the first operation identifier is the identifier of 0 and beta2 At > 0.01, let β=β+β2 And performs step S61, wherein β2 The preset adjustment threshold value for the preset weight is known to those skilled in the art, and is set according to actual requirements.
Specifically, the designation "0" is characterized by: the operation is successful.
S67, when the first operation identifier is 0 and beta2 When the temperature is less than or equal to 0.01, determining SJi1 Is Ai Corresponding target CPU data processing amount, SJi2 Is Ai Corresponding target GPU data processing amount, SJi3 Is Ai Corresponding target memory data processing capacity.
S69, when the first operation identifier is "1", let β=β - β2 ,β2 =β2 /2, and performs S61.
Specifically, the identification "1" is characterized by: the operation failed.
The method comprises the steps of obtaining a first resource duty ratio list through presetting a preset resource allocation list and a first intermediate resource allocation list, automatically adjusting the resource allocation of a server according to the first resource duty ratio list, wherein the resource allocation can affect the allocation time consumption of the server, so that a first historical starting time length list and a second historical starting time length list are obtained according to the resource allocation of the server and the historical allocation time consumption, further, obtaining a first intermediate starting time length and a second intermediate starting time length, comparing the first intermediate starting time length with the second intermediate starting time length, determining the allocation time length started after the target server is allocated, obtaining the most reasonable allocation time length, avoiding resource waste and being beneficial to improving the running efficiency of a system.
S200, acquiring a second historical starting time length list C= { C corresponding to the A1 ,C2 ,……,Ci ,……,Cm },Ci ={Ci1 ,Ci2 ,……,Cir ,……,Cis },Cir Is Ai And r=1, 2 … … s, s are the number of second historical starting time periods, wherein the second historical starting time period is the time period of starting the target server after completing deployment in the second historical time slice, and the method for acquiring the second historical starting time period is known to those skilled in the art and is not repeated herein, referring to the method for acquiring the first historical starting time period.
Specifically, the ending time point of the second history time slice is t0 。
Further, the second historical time slice has a start time of t2 ,t2 The point in time when the deployment is first completed for the target server.
S300, acquiring a first intermediate starting duration D corresponding to the B according to the B, wherein the D meets the following conditions:
D=∑mi=1 ((∑nj=1 (Bij )-max(Bij )-min(Bij ) (n-2))/m, where max () is a function of obtaining a maximum value and min () is a function of obtaining a minimum value.
S400, acquiring a second intermediate starting duration E corresponding to C according to the C, wherein E meets the following conditions:
E=∑mi=1 ((∑sr=1 (Cir )-max(Cir )-min(Cir ))/(s-2))/m。
s500, when the I D-E I is not less than T0 When E is determined to be the configuration duration T, T started after the target server completes deployment0 In order to set the time difference to be a preset value,the person skilled in the art knows, among others, that the person skilled in the art sets the preset time difference according to the actual requirements.
S600 when the absolute value of D-E is smaller than T0 And when the method is used, determining the D as the configuration duration T started after the target server completes deployment.
Above-mentioned, automatic adjustment server's resource allocation, according to server's resource allocation and history deployment consuming time obtain first history start-up duration list and second history start-up duration list, further, obtain first middle start-up duration and second middle start-up duration, compare and confirm the configuration duration that the target server was launched after accomplishing the deployment to first middle start-up duration and second middle start-up duration, can obtain the most reasonable configuration duration, avoid causing the wasting of resources and be favorable to improving the operating efficiency of system.
The invention also provides another embodiment.
Specifically, the step S600 is followed by the steps of:
s700, obtaining Ai Corresponding deployment installation package identification Li 。
Specifically, the deployment installation package identifier is a unique identity of the deployment installation package.
Specifically, the step S700 includes the steps of obtaining a deployment installation package:
s701, acquiring a target character string, where the target character string may be understood as: codes, among which those skilled in the art know, set target strings according to actual demands.
S702, obtaining a first CPU architecture type and a second CPU architecture type corresponding to a target server, which are known to those skilled in the art, any method capable of obtaining the CPU architecture type in the prior art belongs to the protection scope of the present invention, and is not described herein.
Specifically, the CPU architecture corresponding to the first CPU architecture type is an ARM architecture.
Specifically, the CPU architecture corresponding to the second CPU architecture type is an X86 architecture.
S703, acquiring a first architecture type installation package according to the target character string, wherein the first architecture type installation package can be understood as an ARM version installation package, and any method for compiling codes to generate the installation package in the prior art is known to those skilled in the art, and is not described herein.
S704, acquiring a second architecture type installation package according to the target character string, wherein the second architecture type installation package can be understood as an X86 version installation package, and a person skilled in the art knows that a method for acquiring the second architecture type installation package refers to a method for acquiring the first architecture type installation package, which is not described herein.
S705, when Ai When the CPU architecture of the (1) is the CPU architecture corresponding to the first CPU architecture type, determining that the first architecture type installation package is Li Corresponding deployment installation packages.
S706, when Ai When the CPU architecture of the (1) is the CPU architecture corresponding to the second CPU architecture type, determining that the second architecture type installation package is Li Corresponding deployment installation packages.
According to the method, the deployment installation package corresponding to the target server is determined according to the CPU architecture corresponding to the target server, and the target server is deployed according to the deployment installation package, so that server deployment can be accurately and rapidly completed, and the operation efficiency of the system is improved.
S800 according to Li Corresponding deployment installation package pair Ai Corresponding target servers are deployed to obtain Ai Corresponding intermediate server Pi 。
S900, obtaining Pi Start-up duration Q of (2)i 。
S1000, obtain Pi Corresponding feedback character string Wi The feedback string can be understood as: and generating error reporting information after the server is started.
S1100, when Qi > T or Wi When not NULL, determine ai The corresponding target server is Ai A corresponding intermediate server.
When the time length of starting the server is not less than the configuration time length of starting the target server after completing deployment or when the error reporting occurs after starting the target server, the error occurs in deployment is indicated, and at the moment, the state of the target server is restored to the state before undeployment, so that the problem that the server cannot normally operate can be avoided.
The invention provides a configuration system of a cluster server, which comprises: the target server identification list, the processor and the memory storing the computer program, when the computer program is executed by the processor, the following steps are implemented: acquiring a first historical starting time length list corresponding to a target server identification list; acquiring a second historical starting time length list corresponding to the target server identification list; acquiring a first intermediate starting time length; acquiring a second intermediate starting time length; and acquiring configuration time length started after the target server finishes deployment according to the first intermediate starting time length and the second intermediate starting time length. According to the method and the device for automatically adjusting the resource configuration of the server, the first historical starting time list and the second historical starting time list are obtained according to the resource configuration of the server and the historical deployment time, further, the first middle starting time and the second middle starting time are obtained, the configuration time of the target server started after the deployment is determined by comparing the first middle starting time and the second middle starting time, the most reasonable configuration time can be obtained, resource waste is avoided, and the operation efficiency of the system is improved.
While certain specific embodiments of the invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the invention. Those skilled in the art will also appreciate that many modifications may be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.