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, by
Distribute to resource reclaim manager and resource provides manager and performs resource adjustment behavior;The load point provided using each cluster
With 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 every
Individual cluster instance selects a suitable destination server, on the premise of system operation constraint is ensured, by these cluster instances
Move in destination server, originally idle server closing or into holding state, if the server environment of system makes
Built, 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 work
Make the quantity of server, the cluster instance in n platform servers is re-assigned in m platform servers, wherein n is physical server
Number, and m is less than n;During Server Consolidation, by cluster instance from a server migration to another server
Before, first start identical cluster instance in destination server, start successfully and then by the cluster instance in current server
Close, the load distribution server of cluster is modified to its forwarding list, forwarded requests in new clustered node, realizes collection
The migration of group node;
The result of integration is predicted during Server Consolidation, prevents the destination server after integrating from occurring
Carry, the server set of idle condition is in lookup system, and carry out descending arrangement, by the cluster instance on each server
Move in server forward after sorting, minimize cluster instance migration number;It is currently used to count all cluster instances
Total resources, and minimum number of servers serversize is searched in server list, exceed in the total amount of every kind of resource
In the case that all cluster instances take 1.5 times of total resources, all cluster instances are all moved to above-mentioned
In the server of serversize quantity, S is migratediIn all cluster instances into preceding serversize platforms server, wherein
serversize<I≤n, the desired stock number after destination server migration is calculated before migrating cluster instance, and selective value is most
Small server, cluster instance is migrated.
Preferably, the division Overloaded Servers further comprise:Selection needs to migrate from the server of overload
The part cluster instance gone out, and these cluster instances are re-deployed in other servers of system, eliminate server
Overload;
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 can
To 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 migrate
Server 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 Si
The 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 invention
State.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 right
Claim limits, and the present invention covers many replacements, modification and equivalent.Illustrate in the following description many details with
Thorough understanding of the present invention is just provided.These details are provided for exemplary purposes, and without in these details
Some 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 cluster
Architecture 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 invention
The middleware distributed computing method flow chart of embodiment.
In logical layer, system includes multiple server clusters, the corresponding application of each cluster, each server cluster
Including a load distribution server and one or more stateless server instance, and apply correlation behavior generally use
Distributed caching is safeguarded that server instance failure does not interfere with application availability.When server instance needs migration, only
Need to start new process in destination server, original process is closed in current server, while change cluster load distribution service
The 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 operation
The mode of system process is operated in these servers;Can run on the same server one or more come from it is multiple
The 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 section
The periodic status that point is used to receive branch server node is reported, and planning of implemening resource integration;Multiple branch server sections
Point 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 joint
System order.Therefore, the resource adjustment operation of cluster is calculated by primary server joint, and control command is sent into branch
Server node performs, and reaches the effect of adjustment finally by the forwarding list change of load distribution server.In order to disperse wind
Nearly 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 requirements
At one.
The resource consolidation of system is periodic behavior, realizes the adaptive offer of resource.Branch server monitoring nodes
The resource service condition of server and cluster instance, and obtained information is shipped regularly to primary server joint.Master server
Determination methods below node use, the server in Idle state and in overload state is searched, and consider the overall situation
Resource and load distribution situation, formulate a series of resource comprising adjustment behaviors and strategy is provided;Resource management component will be adjusted and gone
Manager is provided and performed to distribute to resource reclaim manager and resource;Finally rely on the load distribution service that each cluster provides
Device, load is redistributed.
What server resource was integrated aim at ensure in group system each application can normal operation while, reduce
The 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 time
The 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 above
Individual suitable destination server, on the premise of system operation constraint is ensured, these cluster instances are moved into destination server
In, originally idle server can close or into the power save mode such as standby.If the server environment of system uses virtual
Change 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 out
Example, and these cluster instances are re-deployed in other servers of system, so as to eliminate the overload shape of these servers
State, 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 fortune
Capable server instance quantity, SijRepresent in SiJ-th of cluster instance of upper operation.KSiRepresent the current money of i-th of server
Source usage amount, KSijRepresent SiJ-th of cluster instance Current resource usage amount, TKSiRepresent the current money of i-th of server
Source 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/write
Sum again.
Server and cluster instance state are simply judged, suitable resource consolidation is selected further according to judged result
Method.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, server
Overload 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 possible
The 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 another
Device.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, will
Request 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 integrating
Business 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 rearward
Cluster instance on the server of position is moved in server on the front, is minimized cluster instance migration number, is reduced system
System change, keep the stabilization of each application cluster and system.The currently used total resources of all cluster instances is counted, is being serviced
The 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 instances
1.5 times of total resources, then it can try one's best and all move to all cluster instances in this serversize server.Migration
Si(serversize<I≤n) in all cluster instances into preceding serversize platforms server.Migration cluster instance it
Desired stock number after preceding calculating destination server migration, and the server that selective value is minimum, cluster instance is migrated, and
Overloaded 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 others
Run 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 out
nodes[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 platform
It is engaged in device.
Branch server node S is reduced as far as possibleiThe cluster instance set cluster_nodes [S divided awayi], to reduce
The cost of cluster instance migration, therefore it is required that cluster_nodes [Si] in each cluster instance there is higher resource
Usage amount, undertake more load.But for loading higher clustered node, born due to needing to shift substantial amounts of user
Carry so that migration cost is higher, in transition process, can produce certain influence to the service quality of application, therefore require again
Migration loads relatively low clustered node.Integrate, pay the utmost attention to migrate the quantity of clustered node, secondly consider migration low-load
Node.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 unrestrained
Take 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 step
Computing system realize that they can be concentrated in single computing system, or be distributed in multiple computing systems and formed
Network on, alternatively, they can be realized with the program code that computing system can perform, it is thus possible to they are stored
Performed 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's
Principle, without being construed as limiting the invention.Therefore, that is done without departing from the spirit and scope of the present invention is any
Modification, equivalent substitution, improvement etc., should be included in the scope of the protection.In addition, appended claims purport of the present invention
Covering the whole changes fallen into scope and border or this scope and the equivalents on border and repairing
Change example.