Summary of the invention
The invention provides a kind of application management method based on application container and system, it is possible to solve existingInefficient problems based on container application deployment in technology.
First aspect provides a kind of application management method based on application container, and described method is applied to applicationContainer scheduler in management system, described AMS includes that cloud controls platform, described container is adjustedDegree device and the cluster including at least one host, described method includes:
Container scheduler receives cloud and controls the application establishment instruction that platform sends;
Described application is created the target host that instruction pushes in described cluster, so that described target placeMain frame creates instruction according to described application and obtains target image file, and using described target image file is instituteState intended application corresponding to target image file and create intended application container.
In the design that some are possible, after having disposed intended application container, container scheduler can also be rightThe container resource of intended application container is managed, such as, delete container, increase container, be increased or decreasedThe hardware resource of container, and re-create container etc..Wherein, described container resource at least includes as followsOne of: distribute to the application container number of described intended application, the number of described intended application container,Or the hardware resource that described intended application container is required when running.Illustrate individually below:
1, the container resource management that container scheduler controls platform transmission according to cloud instructs indicated content pipeReason container resource
A, application deployment personnel control platform management container resource at cloud as required.
B, application deployment personnel manage container resource according to the running status of the intended application container obtained.
Then, application deployment personnel can indicate the information of management container resource to be sent to container scheduling by being used forDevice so that container scheduler instructs the appearance managing described intended application container according to described container resource managementDevice resource.
2, container scheduler manages container resource automatically according to the running status of the intended application container obtained
Particularly as follows: guard the module described intended application container of acquisition by operating in the host on hostRunning status;
When determining that described running status meets default management condition, according to described running status and pre-establishingPut the container resource of intended application container described in regulation management.
Optionally, described running status includes soft load and duty.In the 2nd kind of situation, according toDescribed running status and preset configuration rule manage the container resource of described intended application container, including followingOne of:
When described duty is failure state, uses described target image file to re-create and comprise instituteState the first application container of intended application;
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation;
When described soft load is less than three threshold values, by described intended application container closure and delete.
Container resource is adjusted dynamically, it is achieved load balancing by the soft load according to application container.It addition,By dynamic management container resource so that host in the cluster lost efficacy or application container lost efficacy and closedWhen closing, container scheduler can re-create new application container immediately on former host, improves application clothesThe reliability of business.
Optionally, in management container resource process, it is also possible to judge whether that needs alert, in order toNotify that operation and maintenance personnel safeguards the container Resource allocation and smoothing of whole system in time, determining that described target shouldWhen meeting default alarm conditions by the running status of container, will be used for indicating described intended application container to meetThe warning information of described default alarm conditions sends and controls platform to described cloud, such as, can manage controlPlatform presents with sound and light alarm in interface, simultaneously can also pass through note, the wechat account etc. of binding pushes awaySend warning information, be not construed as limiting the most herein.
In the design that some are possible, for improving stability when application container is run further, it is also possible toWhen described intended application container lost efficacy or ran the first host inefficacy of described intended application container, openWith the back-up application container of described intended application container, or in the cluster belonging to the first host inThe copy of described intended application container is created on arbitrary host.
In the design that some are possible, after having disposed intended application container, it is also possible to according to demand to meshMark application container is updated, specific as follows:
1, realize intended application is updated by amendment target image file.
Container scheduler receives described cloud and controls the application amendment instruction that platform sends, and described application amendment refers toOrder is for indicating the amendment to described target image file;
And update described target image file according to described application amendment instruction, and affix one's name to described cluster internalDescribed intended application container push amendment information so that described target host according to update after described inTarget mirror is as the new intended application container of document creation.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Container scheduler receives described cloud and controls the application renewal instruction that platform sends, and described application updates and refers toOrder is for indicating the renewal of the application file to described intended application container;
And update, according to described application, the described intended application container that instruction affixes one's name to described cluster internal and push moreNew information, so that described intended application container obtains described renewal file, updates answering of intended application containerUse file.
Above first aspect from the angle of container scheduler to a kind of application management method based on application containerIllustrating, second aspect controls the angle of platform to a kind of application management side based on application container from cloudMethod is described, and the cloud that described method is applied in AMS controls platform, described application managementSystem includes that described cloud controls platform, container scheduler and includes the cluster of at least one host, describedMethod includes:
Obtain target image file;
The intended application that described target image file is corresponding is carried out application service configuration, particularly as follows: configurationThe application parameter of intended application, the environmental variable of intended application and the port mapping of intended application;
Send application and create instruction extremely described container scheduler, so that described container scheduler is by described applicationCreate the target host that instruction pushes in described cluster, so that described target host is answered according to describedObtaining target image file with creating instruction, using described target image file is described target image fileCorresponding intended application creates intended application container.
In the design that some are possible, after having disposed intended application container, cloud controls platform can also be rightContainer resource is managed, such as, delete container, increase container, the hardware resource of container is increased or decreased,And re-create container etc..Wherein, described container resource at least includes one of following item: distribute to instituteState the application container number of intended application, the number of described intended application container, or described intended application is heldThe hardware resource that device is required when running.
Container resource management, after being managed container resource, is instructed transmission to the most described by cloud control platformContainer scheduler, so that the instruction content pipe that described container scheduler instructs according to described container resource managementManage the container resource of described intended application container.
Optionally, application deployment personnel can control to manage the most voluntarily on platform container resource at cloud,Can also is that the running status management container resource according to intended application container, therefore cloud controls platform and will holdBefore device resource management instructs transmission extremely described container scheduler, described method also includes:
Cloud controls platform and obtains the running status of described intended application container;
When determining that described running status meets default management condition, cloud controls platform according to described operation shapeState manages the container resource of described intended application container, and described container resource at least includes one of following item:Distribute to the application container number of described intended application, the number of described intended application container, or described meshThe hardware resource that mark application container is required when running;
Described container resource management instruction is one of including at least following item: re-create comprise described target shouldThe first application container, close and delete described intended application container, distribute to described intended applicationApplication container number, the number of described intended application container, or required when described intended application container runsHardware resource.
Optionally, described running status includes soft load and duty, and described cloud controls platform according to instituteState running status and manage the container resource of described intended application container, including one below:
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation.
Container resource is adjusted dynamically, it is achieved load balancing by the soft load according to application container.It addition,By dynamic management container resource, and it is indicated to container scheduler host in the cluster was lost efficacyOr application container lost efficacy when being closed, container scheduler can re-create new answering immediately on former hostWith container, improve the reliability of application service.
Optionally, in management container resource process, it is also possible to judge whether that needs alert, in order toNotify that operation and maintenance personnel safeguards the container Resource allocation and smoothing of whole system in time, determining that described target shouldWhen meeting default alarm conditions by the running status of container, will be used for indicating described intended application container to meetThe warning information of described default alarm conditions sends and controls platform to described cloud, such as, can manage controlPlatform presents with sound and light alarm in interface, simultaneously can also pass through note, the wechat account etc. of binding pushes awaySend warning information, be not construed as limiting the most herein.
In the design that some are possible, after having disposed intended application container, it is also possible to according to demand to meshMark application container is updated, specific as follows:
1, realize intended application is updated by amendment target image file.
Cloud controls platform and obtains described target image file;
Described target image file is modified;
By amended described target mirror as files passe is to the file system storing described target image fileUnite, and application amendment instruction is sent to described container scheduler, so that described container scheduler is according to answeringUpdate described target image file with amendment instruction, and the described intended application affixed one's name to described cluster internal is heldDevice push amendment information so that described target host according to update after described target mirror as document creationNew intended application container.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Cloud controls the renewal file that platform obtains the application file of described intended application container;
The intended application indicated according to the application identities in described renewal file, by described renewal files passeTo the file system storing described target image file;
And application is updated instruction transmission extremely described container scheduler, so that described container scheduler is to describedThe described intended application container of cluster internal administration pushes more new information, so that described intended application container obtainsDescribed renewal file, updates the application file of intended application container.
When updating intended application container, it is not necessary to the intended application in intended application container is exited.SeparatelyOutward, escalation target application needs to update intended application container, it is only necessary to will update files passe to file systemSystem, is then pushed to each intended application container by container scheduler by more new demand, subsequently, and intended applicationThe infrastructure service from exploitation in container obtains the application renewal file uploaded of deployment personnel automatically, and dynamicallyUpdate the file specified in intended application container, thus avoid prior art needing travel frequently over peaceFull shell SSH or remote desktop log in Linux password or the leakage of other passwords that application server is caused,And minimizing potential safety hazard.
Third aspect present invention provides one to control assembly, and having realization provides corresponding to above-mentioned first aspectThe function of application management method based on application container.Described function can be realized by hardware, it is possible toTo perform the realization of corresponding software by hardware.Hardware or software include one or more with above-mentioned functions phaseCorresponding module, described module can be software and/or hardware.
In a kind of possible design, described control assembly includes:
Acquisition module, controls, for receiving cloud, the application establishment instruction that platform sends;
Sending module, for described application is created the target host that instruction pushes in described cluster,So that described target host creates instruction according to described application obtains target image file, and use describedTarget image file is that the intended application that described target image file is corresponding creates intended application container.
In a kind of possible design, described control assembly includes:
Interconnective processor, memorizer, receptor and emitter;
Wherein, described memorizer is used for storing program code, and described processor is used for calling described memorizerIn program code perform following operation:
Utilize described receptor to receive cloud and control the application establishment instruction that platform sends;
Utilize described emitter that described application is created the target host that instruction pushes in described cluster,So that described target host creates instruction according to described application obtains target image file, use described meshMark image file is that the intended application that described target image file is corresponding creates intended application container.
Fourth aspect present invention provides a kind of cloud to control platform, has realization and carries corresponding to above-mentioned second aspectThe function of the application management method based on application container of confession.Described function can be realized by hardware, alsoCorresponding software can be performed by hardware to realize.Hardware or software include one or more and above-mentioned functionsCorresponding module, described module can be software and/or hardware.
In a kind of possible design, described cloud controls platform and includes:
Acquisition module, is used for obtaining target image file;
Processing module, for carrying out application service configuration to the intended application that described target image file is corresponding;
Sending module, is used for sending application and creates instruction extremely described container scheduler, so that described container is adjustedDescribed application is created the target host that instruction pushes in described cluster by degree device, so that described target placeMain frame creates instruction according to described application and obtains target image file, and uses the described target image file to beThe intended application that described target image file is corresponding creates intended application container.
In a kind of possible design, described cloud controls platform and includes:
Interconnective processor, memorizer, receptor and emitter;
Wherein, described memorizer is used for storing program code, and described processor is used for calling described memorizerIn program code perform following operation:
Described receptor is utilized to obtain target image file;
And the intended application that described target image file is corresponding is carried out application service configuration;
Utilize described emitter to send application and create instruction extremely described container scheduler, so that described container is adjustedDescribed application is created the target host that instruction pushes in described cluster by degree device, so that described target placeMain frame creates instruction according to described application and obtains target image file, and using described target image file is instituteState intended application corresponding to target image file and create intended application container.
Fifth aspect present invention provides a kind of AMS, have realize above-mentioned based on application containerThe function of application management method.Described function can be realized by hardware, it is also possible to performs phase by hardwareThe software answered realizes.Hardware or software include one or more module corresponding with above-mentioned functions, describedModule can be software and/or hardware.
In a kind of possible design, described AMS includes:
Control assembly as described in the third aspect, the cloud as described in fourth aspect control platform, and includeThe cluster of at least one host.
Compared to prior art, in the scheme that the present invention provides, container scheduler receives cloud control platform and sends outThe application sent creates instruction, creates instruction according to described application and obtains target image file, container schedulerUse described target mirror as document creation intended application container, it is not necessary to install on every host in advanceSupport programs and running environment, container scheduler can affix one's name to intended application container, certain journey at cluster internalReduce application deployment operation on degree and improve the efficiency that application is disposed.
Term " first " in description and claims of this specification and above-mentioned accompanying drawing, " second " etc. are to useIn the object that difference is similar, without being used for describing specific order or precedence.Should be appreciated that soThe data used can be exchanged in the appropriate case, in order to the embodiments described herein can be with except at thisIn order beyond the content that illustrates or describe implement.Additionally, term " includes " and " having " and theyAny deformation, it is intended that cover non-exclusive comprising, such as, contains series of steps or moduleProcess, method, system, product or equipment are not necessarily limited to those steps or the module clearly listed, andBe can include the most clearly listing or for intrinsic other of these processes, method, product or equipmentStep or module, the division of the module appeared in this paper, a kind of division in logic, actualCan have other dividing mode when realizing in application, the most multiple modules can be combined into or be integrated in separatelyIn one system, or some features can be ignored, or does not performs, it addition, phase that is shown or that discussCoupling between Hu or direct-coupling or communication connection can be by some interfaces, indirect between moduleCoupling or communication connection the most all can be not construed as limiting to be electrical or other similar forms.Further,The module illustrated as separating component or submodule can be to may not be separation physically, Ke YishiMay not be physical module, or can divide less than in multiple circuit modules, can be according to actual needSelect part or all of module therein to realize the purpose of embodiment of the present invention scheme.
Embodiments provide a kind of application management method based on application container and system, for cloudTechnical field, it is possible to increase efficiency based on container application deployment.Below it is described in detail.
As it is shown in figure 1, AMS herein includes that cloud controls platform and group system.
Wherein, cloud controls platform and is used for realizing cluster management, application management, and application is issued, application serviceDispose, application service start and stop, dilatation, the function such as application state monitoring, for application deployment personnel or managementMember provides the interactive interface that application is disposed, and application deployment personnel or manager are without being concerned about group system bottomRealization, can directly interactive interface complete application dispose sequence of operations.
Cloud controls platform and includes:
Host management module, is used for managing multiple cluster or regional cluster, such as Beijing machine room cluster,Shanghai machine room cluster, Shenzhen machine room cluster, company-data is saved in data base.Appointment can also be shownAll host lists under cluster and details, data can pass through application programming interfaces (English full name:English abbreviation: API) i.e. control assembly from the backstage of group system and read.Current Docker can also be shownImage file list in mirror image warehouse, and can be that image file arranges icon, environmental variable, port reflectPenetrate, the information such as version.Foundation image is the basic environment that application runs, and image file is saved in control groupIn the mirror image warehouse of part.Application deployment personnel or manager can also control platform by cloud and check that user is closeCode amendment, System Operation Log and the warning information etc. of application container.
Application service management module, for managing the application message of user, application message includes the base of applicationPort numbers, application load balancing that this information, required foundation image, environmental variable, needs are derived setPut, apply physical examination that function etc. is set.Image file or the upgrade file of different editions can also be responsible forUpload, the management such as renewal.Can also be after the image file of application be uploaded, it is achieved the deployment of application,Such as after clicking on " application deployment " menu, the configuration wizard shown according to interactive interface, the money to applicationSource, parameter, container node number configure, and then can click in interactive interface " startup " or " stopping "Button carries out the start stop operation applied.
Application container monitoring interface, is obtained from the monitoring information acquisition module controlling assembly by API for periodicallyTake monitoring data, and graphically change interface display at browser end.
Group system includes controlling assembly, at least one cluster, and each cluster includes at least one host,Wherein, control assembly and include container scheduler, mirror image for the host controlling in cluster, control assemblyWarehouse, monitoring information acquisition module and caching, container scheduler is for managing the application of cluster internal administrationContainer, such as, create application container, delete application container, increase application container and the pipe of container resourceReasons etc., can arrange at least one container scheduler in group system, each cluster can arrange at least oneIndividual container scheduler (includes primary tank scheduler, from container scheduler or backup container scheduler), clusterBetween the management of container resource be isolated from each other, arranging of concrete container scheduler is not construed as limiting herein.MirrorThe information such as the running environment of memory image file, application container it are used for as warehouse;Monitoring information acquisition moduleIn the host in cluster, gather the running status of each application container run on host, runState includes: the processor of host, internal memory, disk space and network input and output (English full name:Input/Output, English abbreviation: I/O) each application container of running in information, and each hostProcessor, internal memory, network I/O information etc.;Each application container that caching runs on reservoir host's machineRunning status.
Application container includes running environment and the application of application, runs a base from exploitation in application containerPlinth services, and this infrastructure service can report the network address of application container, healthy shape to network insertion serviceThe information such as condition.Network insertion service provides service access inlet function for application.Application container can also claimFor container.
Can dispose at least one application container on every host, these application container can be to provide sameThe container of one application service, it is also possible to be to provide the container of different application services, do not limit.WhenWhen needing to run the application specified, the Docker container engine in host automatically pull from mirror image warehouseCreate image file required for application container in host.
Optionally, described group system can also include network access module, accesses host for userApplication in the application container of upper deployment.
For solving the technical problem in current mechanism, the embodiment of the present invention mainly provides techniques below scheme:
1, application deployment personnel control in platform establishment application message, and the image file that will get at cloudReach mirror image warehouse.
Specifically, application deployment personnel can use existing application masterplate directly to control platform wound at cloudBuild the image file of application, it is also possible to be to obtain the mirror image literary composition created from channels such as network data basesPart, then controls platform at cloud and creates relevant application message.
2, control platform at cloud and the application service configuration of application corresponding to this image file of operation is set, thenThe instruction of instruction application service configuration is sent to container scheduler so that container scheduler is according in instructionApplication service configuration create automatically the application container of the running environment comprising this application, this application, andThis application container is disposed on host in cluster.
In such scheme, when application deployment container, application deployment personnel have only to control platform by cloudInteractive interface on predefined wizard-like operation, for application carry out application service configuration and enable this application,The complex operations such as installation and configuration, the installation of application and the configuration that can participate in concrete running environment,Follow-up all of application container maps out the work and is all automatically performed by group system, thus improves application deployment and holdThe efficiency of device.
Refer to Fig. 2, the present invention provides a kind of application management method based on application container lift belowExample illustrates, application deployment personnel log in cloud and control platform, sets up host cluster information, configuration system ginsengNumber (such as: user profile, application class information, foundation image information etc.), creates the basic letter of applicationBreath (such as: application is introduced, and application icon, port, environmental variable are arranged), then arranges the operation of applicationEnvironment mirror and the version information of running environment mirror image, upload application version file (permissible in interactive interfaceIt is compressed file format), after completing application version files passe, affix one's name to the concrete of application container at cluster internalProcess is as follows:
101, cloud controls platform acquisition target image file, should to the target that described target image file is correspondingWith carrying out application service configuration.
Wherein, target image file can be disposed the establishment of librarian use existing application masterplate by application, alsoCan be to obtain the target image file created, the most directly from network data base or other channelsThe mode of copy, the concrete mode obtaining target image file is not construed as limiting herein.
Application service configuration specifically includes that the configuration application parameter of intended application, the environment of intended application becomesAmount and the port mapping of intended application.Wherein, configuration intended application application parameter include Apply Names,Application version, service name, host cluster, resource distribution, container node number, cloud disk space andMode of loading;The environmental variable of intended application includes admin name and administrator's password;Intended applicationPort mapping includes the network port, the domain name of binding and public network access rights.
102, cloud controls platform transmission application establishment instruction to described container scheduler.
Application creates the service that instruction is used for indicating container scheduler to enable intended application, creates for intended applicationBuild corresponding intended application container.
103, container scheduler receives the application establishment instruction that cloud control platform sends, according to scheduling of resource planSlightly described application is created the target host that instruction pushes in cluster, with real presently described cluster internalAffix one's name to described intended application container.
Wherein, target host includes the host of intended application the to be disposed container of at least in cluster,Target host select by container scheduler according to pre-configured resource dispatching strategy calculate to.
104, target host receives and obtains target image file after application creates instruction, and uses describedTarget image file is that the intended application that described target image file is corresponding creates intended application container.
Wherein, affix one's name to described intended application container at described cluster internal to include: container scheduler passes through resourceDispatching algorithm selects the target host of intended application container to be disposed, and then application is created instruction and pushesTo these target hosts, to realize disposing intended application on the host of intended application container to be disposedContainer.At least one intended application container can also be disposed as required, specifically on same hostIt is not construed as limiting.If it addition, above-mentioned intended application is more complicated, it is also possible to intended application is split as multipleDistributed component, and the most each distributed component one application container of establishment, then setting up these shouldWith the communication between container, it is achieved load balancing.
In the embodiment of the present invention, it is that intended application carries out application service configuration that cloud controls platform, and will enableIntended application and create corresponding intended application container application create instruction be sent to container scheduler,Container scheduler selects target host, and target host obtains target image file, and uses described meshIndex glass is as document creation intended application container, it is achieved need not install support in advance on every host softPart and running environment, container scheduler can affix one's name to intended application container at cluster internal, to a certain degree automaticallyThe efficiency that upper minimizing deployment operation and raising application are disposed, decreases traditional injunctive artificial deploymentFaulty operation probability.
Optionally, in some inventive embodiments, after having disposed intended application container, cloud controls platformOr the container resource of intended application container can also be managed by container scheduler, such as delete container,Increase container, the hardware resource of container is increased or decreased, and re-create container etc..Wherein, describedContainer resource at least includes one of following item: distribute to the application container number of described intended application, describedThe number of intended application container, or hardware resource required when described intended application container runs.Hereinafter divideDo not illustrate:
1, the container resource management that container scheduler controls platform transmission according to cloud instructs indicated content pipeReason container resource.
A, application deployment personnel control platform management container resource at cloud as required.
B, application deployment personnel manage container resource according to the running status of the intended application container obtained.
Then, application deployment personnel can will be used for indicating the container resource management of the information of management container resourceInstruction is sent to container scheduler so that container scheduler instructs management institute according to described container resource managementState the container resource of intended application container.
It should be noted that for cloud controls platform, the relevant parameter only for container resource entersRow is arranged, and finally the configuration to container resource is performed by container scheduler.
Described running status includes soft load and duty, and described cloud controls platform according to described operation shapeState manages the container resource of described intended application container, including one below:
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation.
Container resource is adjusted dynamically, it is achieved load balancing by the soft load according to application container.It addition,By dynamic management container resource, and it is indicated to container scheduler host in the cluster was lost efficacyOr application container lost efficacy when being closed, container scheduler can re-create new answering immediately on former hostWith container, improve the reliability of application service.
Optionally, in management container resource process, cloud controls platform and can also determine whether that needs are carried outAlarm, in order to notify that operation and maintenance personnel safeguards the container Resource allocation and smoothing of whole system in time, determiningWhen the running status of described intended application container meets default alarm conditions, will be used for indicating described target to answerThe warning information meeting described default alarm conditions with container sends to described cloud control platform, the most permissibleManagement control station interface presents with sound and light alarm, can also pass through simultaneously note, binding micro-Letter account etc. pushes warning information, is not construed as limiting the most herein.
2, container scheduler manages container resource automatically according to the running status of the intended application container obtained.
Particularly as follows: guard the module described intended application container of acquisition by operating in the host on hostRunning status;
When determining that described running status meets default management condition, according to described running status and pre-establishingPut the container resource of intended application container described in regulation management.
Wherein, described container resource management instruction is including at least one of following item: re-create described in comprisingFirst application container of intended application, close and delete described intended application container, distribute to described targetThe application container number of application, the number of described intended application container, or the operation of described intended application containerThe hardware resource of Shi Suoxu.
Optionally, described running status includes soft load and duty, for container scheduler,When automatically managing application container according to running status, in the 2nd kind of situation, container scheduler is according to describedThe container resource of intended application container described in running status management and preset configuration rule, including one below:
When described duty is failure state, uses described target image file to re-create and comprise instituteState the first application container of intended application;
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation;
When described soft load is less than three threshold values, by described intended application container closure and delete.
Container resource is adjusted dynamically, it is achieved load balancing by the soft load according to application container.It addition,By dynamic management container resource so that host in the cluster lost efficacy or application container lost efficacy and closedWhen closing, container scheduler can re-create new application container immediately on former host, improves application clothesThe reliability of business.It is understood that above-mentioned first threshold, Second Threshold and the 3rd threshold value are from left to right,By arranging from small to large.
Optionally, in management container resource process, it is also possible to judge whether that needs alert, in order toNotify that operation and maintenance personnel safeguards the container Resource allocation and smoothing of whole system in time, determining that described target shouldWhen meeting default alarm conditions by the running status of container, will be used for indicating described intended application container to meetThe warning information of described default alarm conditions sends and controls platform to described cloud, such as, can manage controlPlatform presents with sound and light alarm in interface, simultaneously can also pass through note, the wechat account etc. of binding pushes awaySend warning information, be not construed as limiting the most herein.
Optionally, in some inventive embodiments, after having disposed intended application container, container schedulerAccording to demand intended application container can also be updated, specific as follows:
One, for cloud control platform:
1, realize intended application is updated by amendment target image file.
Concrete, cloud controls platform and obtains described target image file;
Described target image file is modified;
By amended described target mirror as files passe is to the file system storing described target image fileUnite, and application amendment instruction is sent to described container scheduler, so that described container scheduler is according to answeringUpdate described target image file with amendment instruction, and the described intended application affixed one's name to described cluster internal is heldDevice push amendment information so that described target host according to update after described target mirror as document creationNew intended application container.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Concrete, cloud controls the renewal file that platform obtains the application file of described intended application container;
The intended application indicated according to the application identities in described renewal file, by described renewal files passeTo the file system storing described target image file;
And application is updated instruction transmission extremely described container scheduler, so that described container scheduler is to describedThe described intended application container of cluster internal administration pushes more new information, so that described intended application container obtainsDescribed renewal file, updates the application file of intended application container.
Two, for container scheduler:
1, realize intended application is updated by amendment target image file.
Concrete, container scheduler receives described cloud and controls the application amendment instruction that platform sends, described shouldWith amendment instruction for indicating the amendment to described target image file;
Instruct according to described application amendment and update described target image file, and affix one's name to described cluster internalDescribed intended application container pushes amendment information, so that described target host is according to the described mesh after updatingIndex glass is as the new intended application container of document creation.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Concrete, container scheduler receives described cloud and controls the application that platform sends and update instruction, described shouldWith updating instruction for indicating the renewal of the application file to described intended application container;
The described intended application container propelling movement renewal that instruction is affixed one's name to is updated to described cluster internal according to described applicationMessage, so that described intended application container obtains the renewal file of described application file, updates intended applicationThe application file of container, i.e. pulls this renewal file from file system, and updates in intended application containerApplication volume file system in.
In above one, 2 two kind of situation, when updating target image file, it is not necessary to intended application is heldIntended application in device exits, and does not i.e. interfere with the properly functioning of intended application.It addition, escalation target shouldIntended application container is updated, it is only necessary to by renewal files passe to file system, then by container with needsApplication renewal instruction is pushed to each intended application container by scheduler, subsequently, in intended application container fromThe infrastructure service of exploitation obtains the renewal file that application deployment personnel upload automatically, and dynamically updates to targetThe file specified in application container, thus avoid prior art needing travel frequently over Secure Shell (EnglishLiterary composition full name: Secure Shell, English abbreviation: SSH) or remote desktop log in application server and causedLinux password or other passwords are revealed, and reduce potential safety hazard to a certain extent.
Optionally, in some inventive embodiments, application visitor can also be come by network access moduleAccessing the application service in application container, network access module intercepts network request, please when receiving accessAfter asking, according to the network port in access request, temporary file (cookie) or URL (EnglishLiterary composition full name: Uniform Resource Locator, English abbreviation: URL) etc. path inquire about in internal memoryApplication container A joined, is then forwarded to access request in this application container A.If internal memory failing look intoAsk the application container of coupling, then from caching, search the application container of coupling, then access request is forwardedTo this application container.
For ease of understanding the embodiment of the present invention, refer to the stream that the application shown in Fig. 3, Fig. 4 and Fig. 5 is disposedCheng Tu.
Wherein, Fig. 3 is for being configured on host dispose application container, delete application appearance from application serviceDevice, the flow chart of renewal application container file.
Fig. 4 is to carry out one of application service configuration to be embodied as figure, as shown in Figure 4, selects to disposeApply Names is Z-FMS list process management system, and application version is 1.0, and mainframe cluster is Shenzhen electricityLetter 1, is central processing unit (English full name:, English abbreviation: CPU) * 2 for the resource of this application configurationCore and internal memory 512 Mbytes (English full name: MegaByte, English abbreviation: MB), container node numberBeing 10, shared cloud disk space is 1 GB (English full name: Gigabyte, English abbreviation: GB),Environmental variable configuration and port mapping configuration content can self-defining, be not construed as limiting herein, Fig. 4 be onlyThe specific embodiment that the present invention enumerates, not as a limitation of the invention.
Fig. 5 is the inside interaction diagrams of whole AMS, and the application access point in Fig. 5 isNetwork access module.In Fig. 5, manager can by log in cloud control platform management cluster, foundation image,Resource managements etc., application deployment personnel can control platform by login cloud and carry out applying the relevant of deployment to answerBy service configuration, then the instruction starting application is controlled platform by cloud and be sent to container scheduler, makeObtain container scheduler in cluster, create application container.Application visitor can be accessed by reserved applicationPoint accesses the application in certain application container.
Above application management method based on application container a kind of in the present invention is illustrated, individually belowTo performing the control assembly 60 of above-mentioned application container management, cloud control platform 70 and AMS 80It is described.
One, with reference to Fig. 6, illustrating controlling assembly 60, described control assembly 60 is applied to application pipeReason system, described AMS 80 includes that cloud controls platform 70, described control assembly 60 and includesThe cluster of at least one host, controls assembly 60 and includes:
Acquisition module 601, controls, for receiving cloud, the application establishment instruction that platform 70 sends;
Processing module 602, described in receiving according to resource dispatching strategy and described acquisition module 601Application creates instruction and selects the target host of intended application container to be disposed in described cluster;
Sending module 603, for creating, by described application, the target host that instruction pushes in described clusterMachine, so that described target host creates instruction according to described application obtains target image file, uses instituteStating target image file is that the intended application that described target image file is corresponding creates intended application container.
In the embodiment of the present invention, processing module 602 creates instruction according to the application received and selects target placeMain frame, and application establishment instruction is pushed to target host, so that target host obtains target mirror pictureFile, uses described target mirror as document creation intended application container, it is not necessary in advance at every hostUpper installation support programs and running environment, container scheduler can cluster internal affix one's name to intended application container,Reduce deployment operation to a certain extent and improve the efficiency that application is disposed.
Optionally, described processing module 602 is additionally operable to:
The container resource management being received control platform 70 transmission of described cloud by described acquisition module 601 is referred toOrder;
And the container resource managing described intended application container is instructed according to described container resource management, describedContainer resource at least includes one of following item: distribute to the application container number of described intended application, describedThe number of intended application container, or hardware resource required when described intended application container runs.
Optionally, described processing module 602 is additionally operable to:
The running status of described intended application container is obtained by described acquisition module 601;
When determining that described running status meets default management condition, according to described running status and pre-establishingPut the container resource of intended application container described in regulation management, described container resource at least include following item itOne: distribute to the application container number of described intended application, the number of described intended application container, or instituteState hardware resource required when intended application container runs.
Optionally, described running status includes soft load and duty, and described processing module 602 is concreteExecution one below:
When described duty is failure state, uses described target image file to re-create and comprise instituteState the first application container of intended application;
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation;
When described soft load is less than three threshold values, by described intended application container closure and delete.
Optionally, described processing module 602 is additionally operable to:
Lost efficacy at described intended application container or ran the first host inefficacy of described intended application containerTime, enable the back-up application container of described intended application container, or at the cluster belonging to the first hostThe copy of described intended application container is created on arbitrary host in Nei.
Two, with reference to Fig. 7, cloud being controlled platform 70 and illustrates, described cloud controls platform 70 and is applied toBy management system 80, described AMS 80 includes that described cloud controls platform 70, container schedulerWith include the cluster of at least one host, cloud controls platform 70 and includes:
Acquisition module 701, is used for obtaining target image file;
Processing module 702, corresponding for the described target image file that described acquisition module 701 is gotIntended application carry out application service configuration;
Sending module 703, is used for sending application and creates instruction extremely described container scheduler, so that described containerScheduler creates instruction according to described application and selects the target host of intended application container to be disposed in clusterMachine, and application establishment instruction is pushed to target host, so that described target host is according to application woundBuilding instruction and obtain target image file, using described target image file is that described target image file is correspondingIntended application create intended application container.
In the embodiment of the present invention, processing module 702 carries out application service configuration for intended application, and passes throughSending module 703 by enable intended application and create corresponding intended application container application create refer toOrder is sent to container scheduler, and container scheduler obtains target image file, and uses described target mirror pictureDocument creation intended application container, it is achieved need not install on every host in advance support programs and fortuneRow environment, container scheduler automatically can be affixed one's name to intended application container at cluster internal, be reduced to a certain extentThe efficiency that deployment operation and raising application are disposed, decreases the mistake behaviour of traditional injunctive artificial deploymentMake probability.
Optionally, described processing module 702 specifically for:
The configuration application parameter of intended application, the environmental variable of intended application and the port mapping of intended application.
Optionally, described processing module 702 specifically for:
When using described target image file to affix one's name to described intended application container at described cluster internal, according toCluster identity in described target image file selects the target group type of described cluster identity instruction.
Optionally, described processing module 702 is additionally operable to:
By described sending module 703, container resource management is instructed transmission extremely described container scheduler, withMake intended application described in the instruction Content Management that described container scheduler instructs according to described container resource managementThe container resource of container, described container resource at least includes one of following item: distribute to described intended applicationApplication container number, the number of described intended application container, or described intended application container run time instituteThe hardware resource needed.
Optionally, container resource management is being referred to by described processing module 702 by described sending module 703Order sent before described container scheduler, was additionally operable to:
The running status of described intended application container is obtained by described acquisition module 701;
When determining that described running status meets default management condition, according to the management of described running statusThe container resource of intended application container, described container resource at least includes one of following item: distribute to describedThe application container number of intended application, the number of described intended application container, or described intended application containerHardware resource required during operation;
Described container resource management instruction is one of including at least following item: re-create comprise described target shouldThe first application container, close and delete described intended application container, distribute to described intended applicationApplication container number, the number of described intended application container, or required when described intended application container runsHardware resource.
Optionally, described running status includes soft load and duty, and described processing module 702 is concreteExecution one below:
When described soft load exceedes first threshold, at least one during execution is following: increase and distribute to instituteState the number of the application container of intended application, the intended application in described intended application container is migrated toTwo application container, or increase the hardware resource needed for described intended application is run;
When described soft load is less than Second Threshold, at least one during execution is following: reduce and distribute to instituteState the quantity of the application container of intended application, reduce the number of described intended application container, or reduce describedHardware resource needed for intended application operation.
Three, with reference to Fig. 8, described AMS 80 includes:
Control assembly 60 as described in Figure 6;
Cloud as described in Figure 7 controls platform 70;
Cluster including at least one host.
Wherein, control assembly 60 and include container scheduler 601.
Described cloud controls platform 70, is used for obtaining target image file, and gets described acquisition moduleIntended application corresponding to described target image file carry out application service configuration, and send application and createInstruction is to described container scheduler 601;
Described container scheduler 601, for controlling, according to described cloud, the described application establishment that platform 70 sendsInstruction selects the target host of intended application container to be disposed in cluster, and application establishment instruction is pushed awayDeliver to target host, so that described target host creates instruction according to application obtains target image file,Using described target image file is that the intended application that described target image file is corresponding creates intended application appearanceDevice.
Wherein, when using described target image file to affix one's name to described intended application container at described cluster internal,Described cloud control platform 70 specifically for:
The target cluster of described cluster identity instruction is selected according to the cluster identity in described target image fileType.
Optionally, in some inventive embodiments, after having disposed intended application container, cloud controls platform70 or container scheduler 601 the container resource of intended application container can also be managed, such as deleteContainer, increase container, the hardware resource of container is increased or decreased, and re-create container etc..Wherein,Described container resource at least includes one of following item: distribute to described intended application application container number,The number of described intended application container, or hardware resource required when described intended application container runs.WithLower illustrate respectively:
1, the container resource management that container scheduler 601 controls platform 70 transmission according to cloud instructs indicatedContent Management container resource.
A, application deployment personnel control platform 70 at cloud as required and manage container resource.
B, application deployment personnel manage container resource according to the running status of the intended application container obtained.
Then, application deployment personnel can will be used for indicating the container resource management of the information of management container resourceInstruction is sent to container scheduler 601 so that container scheduler instructs management according to described container resource managementThe container resource of described intended application container.
It should be noted that for cloud controls platform, the relevant parameter only for container resource entersRow is arranged, and finally the configuration to container resource is performed by container scheduler.
Control platform 70 particularly with regard to cloud and manage the related description of container resource according to running status, andJudge whether that needs alert, be all referred to the mode embodiment corresponding to above-mentioned Fig. 2, the most notRepeat again.
2, container scheduler 601 manages container money automatically according to the running status of the intended application container obtainedSource.
Particularly as follows: guard the module described intended application container of acquisition by operating in the host on hostRunning status;
When determining that described running status meets default management condition, according to described running status and pre-establishingPut the container resource of intended application container described in regulation management.
Wherein, described container resource management instruction is including at least one of following item: re-create described in comprisingFirst application container of intended application, close and delete described intended application container, distribute to described targetThe application container number of application, the number of described intended application container, or the operation of described intended application containerThe hardware resource of Shi Suoxu.
Automatically manage the related description of container resource according to running status particularly with regard to container scheduler 601,And judge whether that needs alert, all it is referred to the mode embodiment corresponding to above-mentioned Fig. 2, thisPlace repeats no more.
Optionally, in some inventive embodiments, after having disposed intended application container, container schedulerIntended application container can also be modified or upgrade by 601 according to demand, specific as follows:
One, for cloud control platform 70:
1, realize intended application is updated by amendment target image file.
Concrete, cloud controls platform and obtains described target image file;
Described target image file is modified;
By amended described target mirror as files passe is to the file system storing described target image fileSystem, and application amendment instruction is sent to described container scheduler, so that described container scheduler 601Update described target image file according to application amendment instruction, and the described target affixed one's name to described cluster internal is answeredAmendment information is pushed, so that described target host is according to the described target image file after updating with containerCreate new intended application container.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Concrete, cloud controls the renewal file that platform obtains the application file of described intended application container;
The intended application indicated according to the application identities in described renewal file, by described renewal files passeTo the file system storing described target image file;
And application is updated instruction transmission extremely described container scheduler 601, so that described container scheduler 601The described intended application container affixed one's name to described cluster internal pushes more new information, so that described intended application is heldDevice obtains described renewal file, updates the application file of intended application container.
Two, for container scheduler 601:
1, realize intended application is updated by amendment target image file.
Concrete, container scheduler 601 receives described cloud and controls the application amendment instruction that platform sends, instituteState application amendment instruction for indicating the amendment to described target image file;
And update described target image file according to described application amendment instruction, and affix one's name to described cluster internalDescribed intended application container push amendment information so that described target host according to update after described inTarget mirror is as the new intended application container of document creation.
2, realize the application file of intended application container is updated by uploading the file bag of renewal.
Concrete, container scheduler 601 receives described cloud and controls the application renewal instruction that platform sends, instituteState application and update instruction for indicating the renewal of the application file to described intended application container;
And update, according to described application, the described intended application container that instruction affixes one's name to described cluster internal and push moreNew information, so that described intended application container obtains the renewal file of described application file, more fresh target shouldWith the application file of container.
In above one, 2 two kind of situation, when updating intended application container, it is not necessary to intended application is heldIntended application in device exits, it addition, escalation target application needs to update intended application container, it is only necessary toBy renewal files passe to file system, then by container scheduler 601, application renewal instruction is pushed toEach intended application container, subsequently, the infrastructure service from exploitation in intended application container obtains application automaticallyThe renewal file that deployment personnel upload, and dynamically update the file specified in intended application container, fromAnd avoid prior art needs to travel frequently over SSH or remote desktop logs in what application server was causedLinux password or other passwords are revealed, and reduce potential safety hazard to a certain extent.
It should be noted that in various embodiments of the present invention (including each embodiment shown in Fig. 6 and Fig. 7)In entity device corresponding to all of acquisition module can be to meet s to receive device, the reality that all of sending module is correspondingBody equipment can be emitter, and entity device corresponding to all of processing module can be processor.Fig. 6And each device shown in Fig. 7 all can have structure as shown in Figure 9, when one of which device hasDuring structure as shown in Figure 9, processor, emitter and the receptor in Fig. 9 realizes aforementioned to fillingThe same or analogous function of processing module, sending module and acquisition module that the device embodiment put provides,Memorizer storage processor in Fig. 9 performs to need during above-mentioned application management method based on application container to adjustProgram code.
The present invention also provides for a kind of computer-readable storage medium, and this media storage has program, when this program performsIncluding the some or all of step in above-mentioned application management method based on application container.
The present invention also provides for a kind of computer-readable storage medium, and this media storage has program, when this program performsControl platform including above-mentioned control assembly or cloud or AMS perform above-mentioned based on application container shouldBy the some or all of step in management method.
Such as, the structure controlling assembly herein includes processor, receptor and emitter, describedProcessor is configured to support that controlling assembly performs corresponding function in said method.Described receptor and instituteState emitter for supporting that controlling assembly and cloud controls the communication between platform, control platform to cloud and sendState information involved in method or instruction.Described control assembly can also include memorizer, described in depositReservoir is for coupling with processor, and it preserves the necessary program code of carrier server and data.Cloud controlPlatform processed is similar to, and repeats no more.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not has in certain embodimentThe part described in detail, may refer to the associated description of other embodiments.
Those skilled in the art is it can be understood that arrive, and for convenience and simplicity of description, above-mentioned retouchesThe specific works process of the system stated, device and unit, is referred to the correspondence in preceding method embodimentProcess, does not repeats them here.
In several embodiments provided herein, it should be understood that disclosed system, device andMethod, can realize by another way.Such as, device embodiment described above is only shownMeaning property, such as, the division of described unit, be only a kind of logic function and divide, actual can when realizingThere to be other dividing mode, the most multiple unit or assembly can in conjunction with or be desirably integrated into anotherSystem, or some features can ignore, or do not perform.Another point, shown or discussed each otherCoupling direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, device or unitOr communication connection, can be electrical, machinery or other form.
The described unit illustrated as separating component can be or may not be physically separate, makeesThe parts shown for unit can be or may not be physical location, i.e. may be located at a place,Or can also be distributed on multiple NE.Can select according to the actual needs part therein orThe whole unit of person realizes the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit,Can also be that unit is individually physically present, it is also possible to two or more unit are integrated in a listIn unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ software function listThe form of unit realizes.
If described integrated unit realizes and as independent production marketing using the form of SFU software functional unitOr when using, can be stored in a computer read/write memory medium.Based on such understanding, thisThe part that the most in other words prior art contributed of technical scheme of invention or this technical schemeCompletely or partially can embody with the form of software product, this computer software product is stored in oneIn storage medium, including some instructions with so that computer equipment (can be personal computer,Server, or the network equipment etc.) perform completely or partially walking of method described in each embodiment of the present inventionSuddenly.And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disc or CDEtc. the various media that can store program code.
Above technical scheme provided by the present invention is described in detail, used herein the most individualPrinciple and the embodiment of the present invention are set forth by example, and the explanation of above example is only intended to helpUnderstand method and the core concept thereof of the present invention;Simultaneously for one of ordinary skill in the art, foundationThe thought of the present invention, the most all will change, in sum,This specification content should not be construed as limitation of the present invention.