Summary of the invention
For solving said system defect, the invention provides the method for load balance scheduling in a kind of cloud computing environment.
System is comprised of resources of virtual machine, control centre's module three parts of load equalizer, capable of dynamic scheduling.Load equalizer is responsible for the scheduling to information service request, with the load of each resource in balance sysmte; The resources of virtual machine of capable of dynamic scheduling is responsible for response message service request, and real service is provided, and is also the object of dynamic dispatching in native system; Control centre's module is responsible for the load of the overall load of system and each resources of virtual machine, physical server resource to monitor in real time, based on monitor message, adopt certain scheduling strategy, dynamic appending or deletion resources of virtual machine, to guarantee system service ability.
Control centre's module real-time monitoring system overall load situation.The service ability that existing virtual machine provides in discovery system is not enough to support more user while asking, control centre's module can be according to the template of current application, create and configure new resources of virtual machine, and notification payload equalizer joins this resources of virtual machine in scheduling queue dynamically.By the more resources of virtual machine of dynamic expansion to meet newly-increased service request.
The service ability that virtual machine provides in control centre's module discovery system is superfluous, the resources of virtual machine after load equalizer dispatching distribution task is for a long time in the situation in low load, control centre's meeting notification payload equalizer, when dispatching algorithm is distributed request, select the lightest virtual machine of present load, so that this virtual machine is after handling the request having distributed, in zero load condition.Now, control centre's module is deleted notification payload equalizer by this resources of virtual machine, no longer classify scheduler object as.Now, due to the minimizing of virtual machine, to the load of physical server, also can reduce accordingly.If physical server load by the management of other scheduling strategies, is concentrated virtual machine, the physical server freeing out completely can be carried out administration of energy conservation, to avoid the waste of the system resource that SiteServer LBS causes.
When physical server needs the machine of delaying for a certain reason, safeguard that Shi, control centre module can select the virtual machine on this server to carry out dynamic migration, so that this server does not have actual loading, the machine of can delaying is safeguarded.And the resources of virtual machine of being responsible for response user request can continue normal operation, can not interrupt providing for user the ability of service.
Embodiment
Below in conjunction with the drawings and specific embodiments, method of the present invention is described.
System is comprised of resources of virtual machine, control centre's module three parts of load equalizer, capable of dynamic scheduling
Load equalizer is responsible for the scheduling to information service request, with the load of each resource in balance sysmte.Load equalizer can distributing user request except to the virtual machine configuring, also defined following system interface ,Gong control centre module and called:
Add virtual machine interface
Private?boolean?addVM();
Control centre's module adds new resources of virtual machine by this interface in load equalizer, to increase system service ability.
Delete virtual machine interface
Private?boolean?removeVM();
Control centre's module is deleted temporary transient unwanted virtual machine in load equalizer by this interface.
The resources of virtual machine of capable of dynamic scheduling is responsible for response message service request, and real service is provided, and is also the object of dynamic dispatching in native system.These virtual machines are to generate based on a template configuring, so they can provide identical service in SiteServer LBS.When if the resources of virtual machine in current system is not enough, only need to generates new virtual machine and add in load equalizer based on template.Control centre's module is responsible for the load of these virtual machines to monitor.
Control centre's module is responsible for the load of the overall load of system and each resources of virtual machine, physical server resource to monitor in real time, based on monitor message, adopt certain scheduling strategy, dynamic appending or deletion resources of virtual machine, to guarantee system service ability.
Control centre's module has defined respectively with lower interface, to realize the function of system resource dynamic management:
Information gathering,
private?Map?collectVMInfo();
Be responsible for each virtual machine to monitor, collect virtual machine real-time status data.
Information processing,
private?Map?dealVMInfo();
Load equalizer notice, according to information processing result, calls addVM or removeVM interface.
Virtual machine (vm) migration,
private?boolean?migrateVM();
When system maintenance, select as required dynamic migration virtual machine.
Create virtual machine,
private?boolean?createVM();
The virtual machine new according to template establishment.
Control centre's module real-time monitoring system overall load situation.The service ability that existing virtual machine provides in discovery system is not enough to support more user while asking, control centre's module can be according to the template of current application, call createVM () interface, create and configure new resources of virtual machine, and notification payload equalizer addVM () interface joins this resources of virtual machine in scheduling queue dynamically.By the more resources of virtual machine of dynamic expansion to meet newly-increased service request.
The service ability that virtual machine provides in control centre's module discovery system is superfluous, the resources of virtual machine after load equalizer dispatching distribution task is for a long time in the situation in low load, control centre's meeting notification payload equalizer, when dispatching algorithm is distributed request, select the lightest virtual machine of present load, so that this virtual machine is after handling the request having distributed, in zero load condition.Now, control centre's module is called removeVM () interface by notification payload equalizer this resources of virtual machine is deleted, and no longer classifies scheduler object as.Now, due to the minimizing of virtual machine, to the load of physical server, also can reduce accordingly.If physical server load by the management of other scheduling strategies, is concentrated virtual machine, the physical server freeing out completely can be carried out administration of energy conservation, to avoid the waste of the system resource that SiteServer LBS causes.Here the migration of virtual machine is realized by interface migrateVM ().
When physical server needs the machine of delaying for a certain reason, safeguard that Shi, control centre module can select the virtual machine on this server to carry out dynamic migration, so that this server does not have actual loading, the machine of can delaying is safeguarded.And the resources of virtual machine of being responsible for response user request can continue normal operation, can not interrupt providing for user the ability of service.