The content of the invention
To solve the problems of above-mentioned prior art, the present invention proposes a kind of middleware distributed computing method,Including:
It is determined that in Idle state and in overload state server, according to the overall situation resource and load distribution situation, byDistribute to resource reclaim manager and resource provides manager and performs resource adjustment behavior;The load point provided using each clusterWith server, load is redistributed, the adjustment behavior includes integrating idle server and division Overloaded Servers.
Preferably, the integration idle server further comprises:First server set idle in lookup system, is everyIndividual cluster instance selects a suitable destination server, on the premise of system operation constraint is ensured, by these cluster instancesMove in destination server, originally idle server closing or into holding state, if the server environment of system makesBuilt, then directly withdrawn virtual machine with virtualization technology;
If i-th of server SiCurrent resource usage amount KSiThe Current resource total amount TKS of/i-th serveri<0.3, the i.e. low utilization of resources 30%, then server free, possesses the condition of Server Consolidation, is integrated so as to reduce workMake the quantity of server, the cluster instance in n platform servers is re-assigned in m platform servers, wherein n is physical serverNumber, and m is less than n;During Server Consolidation, by cluster instance from a server migration to another serverBefore, first start identical cluster instance in destination server, start successfully and then by the cluster instance in current serverClose, the load distribution server of cluster is modified to its forwarding list, forwarded requests in new clustered node, realizes collectionThe migration of group node;
The result of integration is predicted during Server Consolidation, prevents the destination server after integrating from occurringCarry, the server set of idle condition is in lookup system, and carry out descending arrangement, by the cluster instance on each serverMove in server forward after sorting, minimize cluster instance migration number;It is currently used to count all cluster instancesTotal resources, and minimum number of servers serversize is searched in server list, exceed in the total amount of every kind of resourceIn the case that all cluster instances take 1.5 times of total resources, all cluster instances are all moved to above-mentionedIn the server of serversize quantity, S is migratediIn all cluster instances into preceding serversize platforms server, whereinserversize<I≤n, the desired stock number after destination server migration is calculated before migrating cluster instance, and selective value is mostSmall server, cluster instance is migrated.
Preferably, the division Overloaded Servers further comprise:Selection needs to migrate from the server of overloadThe part cluster instance gone out, and these cluster instances are re-deployed in other servers of system, eliminate serverOverload;
If if i-th of server SiCurrent resource usage amount KSiThe Current resource total amount TKS of/i-th serveri>0.8, i.e. resource utilization is more than 80%, then server resource overload occurs, it is necessary to carry out server division;Partition process canTo be divided into following steps:
(1) search division in need server set full_servers;(2) for any Si∈full_Servers, search the cluster instance set cluster_nodes [S for needing to migrate outi] so that these cluster instances migrateServer is at busy and non-overloaded level after going out;(3) to each in SiJ-th of cluster instance S of upper operationij∈cluster_nodes[Si], by cluster instance SijIt is placed into other servers of platform;Reduce branch server node SiThe cluster instance set cluster_nodes [S divided awayi]。
The present invention compared with prior art, has advantages below:
The present invention be used for cluster distributed environment under charter resource-sharing, prevent server resource waste and overload,Increase operation rate.
Embodiment
Retouching in detail to one or more embodiment of the invention is hereafter provided together with the accompanying drawing for illustrating the principle of the inventionState.The present invention is described with reference to such embodiment, but the invention is not restricted to any embodiment.The scope of the present invention is only by rightClaim limits, and the present invention covers many replacements, modification and equivalent.Illustrate in the following description many details withThorough understanding of the present invention is just provided.These details are provided for exemplary purposes, and without in these detailsSome or all details can also realize the present invention according to claims.
The present invention realizes the server cluster system towards PaaS.And from two layers of logical construction and physical arrangement to clusterArchitecture is introduced.An aspect of of the present present invention provides a kind of middleware distributed computing method.Fig. 1 is according to the present inventionThe middleware distributed computing method flow chart of embodiment.
In logical layer, system includes multiple server clusters, the corresponding application of each cluster, each server clusterIncluding a load distribution server and one or more stateless server instance, and apply correlation behavior generally useDistributed caching is safeguarded that server instance failure does not interfere with application availability.When server instance needs migration, onlyNeed to start new process in destination server, original process is closed in current server, while change cluster load distribution serviceThe forwarding list of device.Compared to virtual machine (vm) migration, such moving method is very small to application performance impact.
In physical layer, system includes multiple servers, and as the running environment of cluster, each server instance is with operationThe mode of system process is operated in these servers;Can run on the same server one or more come from it is multipleThe server instance of cluster, these examples can share service and the resource that same operating system provides, and in global scope,All application clusters share identical server environment.
Within the physical layer, including two class server nodes:Primary server joint and branch server node.Master server sectionThe periodic status that point is used to receive branch server node is reported, and planning of implemening resource integration;Multiple branch server sectionsPoint is used to monitor and report the various performance datas of the server instance of operation, while receives and perform the control of primary server jointSystem order.Therefore, the resource adjustment operation of cluster is calculated by primary server joint, and control command is sent into branchServer node performs, and reaches the effect of adjustment finally by the forwarding list change of load distribution server.In order to disperse windNearly and the wasting of resources is avoided, can only be deposited in same server using the server instance of the deployment same cluster of constraint requirementsAt one.
The resource consolidation of system is periodic behavior, realizes the adaptive offer of resource.Branch server monitoring nodesThe resource service condition of server and cluster instance, and obtained information is shipped regularly to primary server joint.Master serverDetermination methods below node use, the server in Idle state and in overload state is searched, and consider the overall situationResource and load distribution situation, formulate a series of resource comprising adjustment behaviors and strategy is provided;Resource management component will be adjusted and goneManager is provided and performed to distribute to resource reclaim manager and resource;Finally rely on the load distribution service that each cluster providesDevice, load is redistributed.
What server resource was integrated aim at ensure in group system each application can normal operation while, reduceThe usage quantity of server in host environment, energy resource consumption is reduced, reduce the operation cost of data center.It mainly passes through the free timeThe integration of server and the division of Overloaded Servers are realized.
Server Consolidation needs server set idle in first lookup system, for each cluster instance selection one aboveIndividual suitable destination server, on the premise of system operation constraint is ensured, these cluster instances are moved into destination serverIn, originally idle server can close or into the power save mode such as standby.If the server environment of system uses virtualChange technique construction, then directly withdraw these virtual machines.
Server is divided for handling the server in overload, and therefrom selection needs the part cluster migrated outExample, and these cluster instances are re-deployed in other servers of system, so as to eliminate the overload shape of these serversState, the resource contention between cluster instance in the server is reduced, performance isolation is realized with this.
Hereafter with S1、S2、…SnRepresent n physical server in group system, ssize (Si) representative server SiUpper fortuneCapable server instance quantity, SijRepresent in SiJ-th of cluster instance of upper operation.KSiRepresent the current money of i-th of serverSource usage amount, KSijRepresent SiJ-th of cluster instance Current resource usage amount, TKSiRepresent the current money of i-th of serverSource total amount.Resource herein can refer to the power of one or several kinds of data of the indexs such as CPU, internal memory, network read/write, disk read/writeSum again.
Server and cluster instance state are simply judged, suitable resource consolidation is selected further according to judged resultMethod.Judged result is described using symbol full and idle herein:
If KSi/TKSi>0.8, i.e. resource utilization is more than 80%, then full (SiThere is resource in)=true, serverOverload is, it is necessary to carry out server division.If KSi/TKSi<0.3, the i.e. low utilization of resources 30%, then idle (Si)=True, server free, possesses the condition of Server Consolidation.
The object of Server Consolidation is all servers in idle condition, and they are integrated into less server,So as to reduce the quantity of workspace server, the cluster instance in n platform servers is re-assigned in m platform servers, subtracted as far as possibleThe size of few m values, and ensure that this m platform server is not in overload.
During Server Consolidation, some of which cluster instance is serviced from a server migration to anotherDevice.Because clustered node is stateless, it is possible to first start identical cluster instance in destination server, after success,The cluster instance in current server is closed again.The load distribution server of cluster can modify to its forwarding list, willRequest is forwarded in new clustered node, realizes the migration of clustered node.
When carrying out Server Consolidation, consider the cost brought due to cluster instance migration, reduce the movement of cluster instance.Avoid same cluster instance migration multiple, while need to be predicted the result of integration, prevent the purpose clothes after integratingBusiness device overloads.Performance parameter, such as CPU, network, response time.
Integration process first looks for being in the server set of idle condition in system, and carries out descending arrangement.Will rearwardCluster instance on the server of position is moved in server on the front, is minimized cluster instance migration number, is reduced systemSystem change, keep the stabilization of each application cluster and system.The currently used total resources of all cluster instances is counted, is being servicedThe number of servers serversize of minimum is searched in device list, ensures that the total amount of every kind of resource takes more than all cluster instances1.5 times of total resources, then it can try one's best and all move to all cluster instances in this serversize server.MigrationSi(serversize<I≤n) in all cluster instances into preceding serversize platforms server.Migration cluster instance itDesired stock number after preceding calculating destination server migration, and the server that selective value is minimum, cluster instance is migrated, andOverloaded after preventing migration.
The object of server division is the server for having occurred overload, it is therefore an objective to which part cluster instance is divided into othersRun in server, eliminate the overload of the server, improve overall operational efficiency.
Partition process can be divided into following steps:
(1) search division in need server set full_servers.
(2) for any Si∈ full_servers, search the cluster instance set cluster_ for needing to migrate outnodes[Si] so that these cluster instances migrate out rear server and are at busy and non-overloaded level.
(3) to each clustered node Sij∈cluster_nodes[Si], by cluster instance SijIt is placed into other clothes of platformIt is engaged in device.
Branch server node S is reduced as far as possibleiThe cluster instance set cluster_nodes [S divided awayi], to reduceThe cost of cluster instance migration, therefore it is required that cluster_nodes [Si] in each cluster instance there is higher resourceUsage amount, undertake more load.But for loading higher clustered node, born due to needing to shift substantial amounts of userCarry so that migration cost is higher, in transition process, can produce certain influence to the service quality of application, therefore require againMigration loads relatively low clustered node.Integrate, pay the utmost attention to migrate the quantity of clustered node, secondly consider migration low-loadNode.Assuming that N=ssize (Si), then total time complexity is O (N2)。
In summary, the present invention be used under cluster distributed environment charter resource-sharing, prevent that server resource is unrestrainedTake and overload, increase operation rate.
Obviously, can be with general it should be appreciated by those skilled in the art, above-mentioned each module of the invention or each stepComputing system realize that they can be concentrated in single computing system, or be distributed in multiple computing systems and formedNetwork on, alternatively, they can be realized with the program code that computing system can perform, it is thus possible to they are storedPerformed within the storage system by computing system.So, the present invention is not restricted to any specific hardware and software combination.
It should be appreciated that the above-mentioned embodiment of the present invention is used only for exemplary illustration or explains the present invention'sPrinciple, without being construed as limiting the invention.Therefore, that is done without departing from the spirit and scope of the present invention is anyModification, equivalent substitution, improvement etc., should be included in the scope of the protection.In addition, appended claims purport of the present inventionCovering the whole changes fallen into scope and border or this scope and the equivalents on border and repairingChange example.