CN110275776A - Capacity reduction method, device, computer equipment and the storage medium of container application - Google Patents

Capacity reduction method, device, computer equipment and the storage medium of container application Download PDF

Info

Publication number
CN110275776A
CN110275776A CN201910413906.9A CN201910413906A CN110275776A CN 110275776 A CN110275776 A CN 110275776A CN 201910413906 A CN201910413906 A CN 201910413906A CN 110275776 A CN110275776 A CN 110275776A
Authority
CN
China
Prior art keywords
container
capacity reducing
application
target
load balancing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910413906.9A
Other languages
Chinese (zh)
Inventor
黄桂钦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910413906.9A priority Critical patent/CN110275776A/en
Publication of CN110275776A publication Critical patent/CN110275776A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application provides capacity reduction method, device, computer equipment and the storage medium of a kind of container application, is related to field of cloud computer technology, can be applied in PaaS platform.The described method includes: determining that the container to capacity reducing is applied and container is using target container example, the capacity reducing mode of target container example to capacity reducing;According to capacity reducing mode capacity reducing target container example;The information applied according to container described in the target container example modifications database of institute's capacity reducing;Judge whether container application creates load balancing application;If creating load balancing application, according to the configuration file of the type modification load balancing application of load balancing application, to delete the information of the target container example of institute's capacity reducing in configuration file.The embodiment of the present application, which is realized, carries out capacity reducing to the container instance that container is applied, and cost is reduced while proof load equilibrium provides service, and specific capacity reducing process carries out automatically, improves the efficiency of capacity reducing.

Description

Capacity reduction method, device, computer equipment and the storage medium of container application
Technical field
Capacity reduction method, device, the computer applied this application involves field of cloud computer technology more particularly to a kind of container are set Standby and storage medium.
Background technique
In cloud platform, such as in PaaS (Platform-as-a-Service, platform service) platform, when container is answered After the completion of creation, container application will come into operation.As long as the container instance of container application comes into operation, expense will be generated With.However during container application provides service, if customer flow is reduced, current container application has not needed more Container instance, then excessive container instance will cause cost waste.
Summary of the invention
The embodiment of the present application provides capacity reduction method, device, computer equipment and the storage medium of a kind of container application, can contract Hold the container in container application, improves the speed and efficiency of the container in the application of capacity reducing container, reduce the waste of cost.
In a first aspect, the embodiment of the present application provides a kind of capacity reduction method of container application, comprising:
Determine that target container example, the target container example to capacity reducing are applied in container application and the container to capacity reducing Capacity reducing mode;According to target container example described in the capacity reducing mode capacity reducing;According to the target container example modifications of institute's capacity reducing The information of the application of container described in database;Judge whether the container application creates load balancing application;If the container Using load balancing application is created, the configuration text of the load balancing application is modified according to the type that the load balancing is applied Part, to delete the information of the target container example of institute's capacity reducing in the configuration file.
Second aspect, the embodiment of the invention provides a kind of capacity reducing device of container application, the capacity reducing dresses of container application It sets including for executing the corresponding unit of method described in above-mentioned first aspect.
The third aspect, the embodiment of the invention provides a kind of computer equipment, the computer equipment includes memory, with And the processor being connected with the memory;
The memory is for storing computer program, and the processor is for running the calculating stored in the memory Machine program, to execute method described in above-mentioned first aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, when the computer program is executed by processor, realizes method described in above-mentioned first aspect.
The embodiment of the present application can realize that the container instance to container application carries out capacity reducing according to capacity reducing mode, improves container The speed and efficiency of the container instance capacity reducing of application reduce cost while guaranteeing that container application can provide service.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of the capacity reduction method of container application provided by the embodiments of the present application;
Fig. 2 is the sub-process schematic diagram of the capacity reduction method of container application provided by the embodiments of the present application;
Fig. 3 is the sub-process schematic diagram of the capacity reduction method of container application provided by the embodiments of the present application;
Fig. 4 is the sub-process schematic diagram of the capacity reduction method of container application provided by the embodiments of the present application;
Fig. 5 is the schematic block diagram of the capacity reducing device of container application provided by the embodiments of the present application;
Fig. 6 is the schematic block diagram of capacity reducing unit provided by the embodiments of the present application;
Fig. 7 is the schematic block diagram of load updating unit provided by the embodiments of the present application;
Fig. 8 is the schematic block diagram of computer equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on this Shen Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall in the protection scope of this application.
It should be noted that the meaning for the container instance that the container of container application mentioned below and container are applied is identical.
Fig. 1 is the flow diagram of the capacity reduction method of container application provided by the embodiments of the present application.As shown in Figure 1, the party Method includes S101-S105.
S101 determines that the container application and the container to capacity reducing apply the target container example to capacity reducing, target to hold The capacity reducing mode of device example.
It can determine that container application and the container to capacity reducing apply the target container to capacity reducing real in several ways Example, the capacity reducing mode of target container example.
In one embodiment, step S101, comprising: if receiving capacity reducing setting instruction, obtain the capacity reducing setting instruction In container application identities, and call capacity reducing be arranged interface, with receive by the capacity reducing be arranged interface be arranged container instance And the capacity reducing mode of container instance;The container application is obtained by the container application identities in capacity reducing setting instruction Information, and the container application is determined as target application, set container instance is determined as target container example, by institute The capacity reducing mode of the container instance of setting is determined as the capacity reducing mode of target container example.
Capacity reducing setting instruction can be triggered by various ways, such as touched by user or clicked associated button or image touches Hair clicks some container using corresponding capacity reducing button, triggers the contracting of container application such as in the list of container application It is installed with and sets instruction;Also it can receive the voice capacity reducing information of user to trigger capacity reducing setting instruction etc..In the present embodiment, container The mode of the capacity reducing setting instruction triggers of application is with no restrictions.It include the identification information of container application in capacity reducing setting instruction, Specifically where the identification information of container application can determine for the title of container application or the number etc. of container application The information of one container application.
Interface, which is arranged, in capacity reducing is developed by developer, can be existed in the form of a set interface.Pass through capacity reducing Interface, which is arranged, can be set information, the capacity reducing mode of target container example of the target container example that the container is applied to capacity reducing. Wherein, capacity reducing mode includes parallel mode and serial mode.Parallel mode means what multiple target container examples can be parallel Capacity reducing, serial mode mean that the carry out capacity reducing of multiple target container examples one by one, a target container example capacity reducing are complete Finish and then next target container example and carries out capacity reducing.As in one embodiment, setting corresponding to interface is set in capacity reducing The information of all container instances of container application and the information of all capacity reducing modes are shown on interface, so that user is from showing The target container example to capacity reducing is inputted/selected in all container instances shown, the target from selecting in all capacity reducing modes The capacity reducing mode of container instance;Or default display is real to the container of capacity reducing in the set interface corresponding to capacity reducing setting interface Example and container instance capacity reducing mode, by default display to the container instance of capacity reducing and the capacity reducing mode of container instance As target container example and the capacity reducing mode of target container example.
In the embodiment, the quantity of target container example and target container example is inputted or is selected by user, Either default.
In one embodiment, step S101, comprising: determine the container application to capacity reducing;According to total access of active user User's amount of access that amount and each container instance of container application can undertake, the container are using total container instance Quantity calculates the container instance quantity to capacity reducing;Determine that the target container to capacity reducing is real according to the container instance quantity to capacity reducing Example;Determine the capacity reducing mode of the target container example to capacity reducing.
Wherein it is determined that can directly pass through order to the container application of capacity reducing and the capacity reducing mode of target container example Mode realizes ,/selection/input container application can also be received set by user in set interface.
It is visited according to the user that each container instance that total amount of access of active user and the container are applied can undertake The target container example quantity that the amount of asking, the container are calculated using total container instance quantity to capacity reducing specifically calculates The target container example quantity to capacity reducing=container application total total amount of access of container instance quantity-active user/ User's amount of access that each container instance can undertake.In this embodiment, to the target container example quantity of capacity reducing according to Family amount of access is calculated, and is to automatically compute.
In one embodiment, it calculates after the target container example quantity of capacity reducing, detects whether to receive user to institute The modification information of the calculated target container example quantity to capacity reducing;If receive user to the calculated mesh to capacity reducing The modification information for marking container instance quantity, by modified target container example quantity be determined as container application to capacity reducing Target container example quantity;If do not receive user to the calculated target container example quantity to capacity reducing modification believe The calculated target container example quantity to capacity reducing is determined as the container using the target container instance number to capacity reducing by breath Amount.In one embodiment, the calculated target container example quantity to capacity reducing is used as default, can receive user setting The target container example quantity to capacity reducing, can also directly use default value as the target container example quantity to capacity reducing.
The target container example to capacity reducing is determined according to the container instance quantity to capacity reducing, comprising: according to the appearance to capacity reducing Device example quantity, according to the sequence of the multiple containers example creation of container application, the multiple containers applied from the container Example determines the target container example of identical quantity;Or according to the container instance quantity to capacity reducing, according to the container application Multiple containers example where host on resource service condition determine the target container example of identical quantity, such as host The residue of machine is fewer using resource, then with regard to the container instance on the capacity reducing host.Wherein, it is applied from the container multiple Container instance determines the target container example of identical quantity, such as determines the IP address of the target container example of identical quantity.At this In embodiment, determine that the target container example to capacity reducing carries out automatically.
In one embodiment, detect whether to receive user to the modification information of identified target container example, if connecing User is received to the modification information of identified target container example, modified target container example is determined as the container and is answered Target container example to capacity reducing;If not receiving user to the modification information of identified target container example, it incite somebody to action oneself The target container example quantity for moving determination, which is determined as the container application, needs the target container example of capacity reducing.
S102, according to target container example described in the capacity reducing mode capacity reducing.
If capacity reducing mode is parallel mode, according to target container example described in parallel mode capacity reducing;If capacity reducing mode is Serial mode, then the target container example according to serial mode capacity reducing.
In one embodiment, as shown in Fig. 2, step S102 includes the following steps S1021-1024.
S1021, obtains the IP of the current container example, and deactivates the IP of the current container example.
It can be according to the information of the target container example for the identification information, the set container application to capacity reducing that container is applied It inquires the information of target container example in the database to obtain the IP of target container example, is arranged the IP's of target container example Use state is identified as dead status, to deactivate the IP of the target container example.
S1022 determines the host of the current container example according to the information of the current container example.
It can be according to the information of the target container example for the identification information, the set container application to capacity reducing that container is applied The information for inquiring target container example in the database is answered to obtain the host where target container example, or according to container It is real that the information for the target container example that identification information, the set container to capacity reducing are applied can obtain the target container The IP of example, the host where the target container example is determined according to the IP of target container example.
S1023 destroys the target container example on the host.
As issued host corresponding to destruction instruction to target container example by container programming facility, instruction is destroyed such as Docker stop instruction, destroys corresponding target container example on corresponding host.It is real to destroy target container Example will destroy environmental information corresponding to target container example, close file iostream, closing and the connection of database, Recorded data information etc. is deleted to discharge the occupied all resources of the target container example, such as includes monitoring resource, CPU Resource, memory source, I/O resource etc..Wherein, container programming facility can be marathon programming facility, be also possible to other Container programming facility.
It should be noted that the IP for deactivating target container example first destroys target container example again, rather than first destroy Target container example deactivates the IP of target container example again, is and the target container in order to which the IP to prevent target container example is effective Example is invalid, and user access request is assigned to the target container example, and the actually target container example is invalid, that It will lead to the failure of user access request.
S1024 recycles all resources of the target container example and the IP of the target container example.
All resources of target container example, including monitoring resource, cpu resource, memory source, I/O resource etc..By target All resources of container instance are recycled, and the money of the target container example of recycling can be used directly in subsequent creation container instance Source.
Wherein, the IP for recycling target container example, as shown in figure 3, including the following steps S1024a-S1024c:
S1024a judges whether the IP of target container example is predistribution IP.
Wherein, predistribution IP be container application create when, or creation after, need to be increased newly for the container application in advance The IP of container instance distribution, predistribution IP are assigned to newly created later in the container instance of creation container application later Container instance is directly that newly created container instance distributed IP later by pre-allocating IP, container instance distribution IP can be improved Speed, predistribution IP has the identification information of corresponding predistribution, determines whether the IP is pre- by the identification information of the IP Distribute IP.
The IP of target container example is recycled to predistribution IP if the IP of target container example is predistribution IP by S1024b Address pool.
The IP of target container example is recycled to common IP if the IP of target container example is not predistribution IP by S1024c Address pool.
Plain IP address pond is that the container applies pre-assigned IP address pond under corresponding application environment and region, with The IP address that can be used for the container how living using container application every other under corresponding application environment and region Pond.
It should be noted that including above-mentioned steps S1021-S1024 to the capacity reducing of each container instance.If capacity reducing mode For parallel mode, then according to each container instance of parallel mode capacity reducing, multiple containers example executes parallel, improves the speed of capacity reducing Degree and efficiency;If capacity reducing mode is serial mode, according to serial mode capacity reducing container instance, multiple containers example is one by one Carry out capacity reducing.Specific capacity reducing automated execution, further improves the speed and efficiency of capacity reducing.On the other hand, it provides a variety of Capacity reducing mode is determined for user carries out capacity reducing in a manner of which kind of capacity reducing, improves the experience of user.
S103, the information applied according to container described in the target container example modifications database of institute's capacity reducing.
Wherein, the information for modifying container application in database includes: to modify the container instance information of container application, such as will Information deletions such as IP, host of container instance of institute's capacity reducing etc. in container application in database;Modify container application The quantity of container instance, specifically, the total container for modifying container application according to the target container example quantity of institute's capacity reducing are real Number of cases amount, modified container instance quantity are that the former container instance quantity of container application subtracts target container example quantity.
S104, judges whether the container application creates load balancing application.
The information whether container application creates load balancing application is preserved in the database, inquires the letter in database Breath is to determine whether container application creates load balancing application.If the container application creates load balancing application, Execute step S105;If the container application does not create load balancing application, terminate.
S105 is modified if the container application creates load balancing application according to the type of load balancing application The configuration file of the load balancing application, to delete the information of the target container example of institute's capacity reducing in the configuration file.
The information of the container instance of container application is had recorded in the configuration file of the load balancing application of container application.Contracting After holding container application, if thinking, the container instance of the container application of institute's capacity reducing no longer provides service, needs the load applied in container The container instance of institute's capacity reducing is deleted in the configuration file of equilibrium application, so that load balancing is applied in distributing user request User will not be requested to be assigned on the container instance of the container application of institute's capacity reducing, to avoid cannot respond to user's request.
It includes the application of F5, LVS (liunx Virtual Server) load balancing, Haproxy load that load balancing, which is applied, Equilibrium application, the application of Nginx load balancing etc..It wherein, is specific because F5 load balancing application is hard load balancing application F5 equipment on create, and the application of LVS (liunx Virtual Server) load balancing, the application of Haproxy load balancing, Nginx load balancing application etc. is soft load balancing application, and therefore, the type of load balancing application includes F5 and non-F5, wherein Non- F5 includes the application of LVS load balancing, the application of Haproxy load balancing, the application of Nginx load balancing etc..
In one embodiment, as shown in figure 4, step S105 includes the following steps S1051-S1056.
S1051 judges whether the type of the load balancing application of the container application is F5.
S1052 determines that F5 is negative according to container application if the type of the load balancing application of container application is F5 Carry the F5 equipment where balanced application.
S1053 obtains the configuration file of the F5 load balancing application in the F5 equipment, and in the configuration file The information of the middle target container example for deleting institute's capacity reducing.
Specifically, pool corresponding to the IP of target container example is determined according to the IP of the target container example of institute's capacity reducing The information of member, by the information deletion of corresponding pool member;It is repaired according to the quantity of the target container example of institute's capacity reducing Change the quantity of the pool member in the pool information of F5 load balancing application, wherein the number of modified pool member The quantity of the quantity of pool member before amount=modification-institute's capacity reducing target container example.
S1054 determines that corresponding load is equal according to container application if the type of load balancing application is non-F5 Weigh the container applied, and obtains configuration file from the container that corresponding load balancing is applied, will be under acquired configuration file It is downloaded to local.
Wherein, if the type of load balancing application is non-F5, corresponding load is determined according to container application The container of equilibrium application, and obtain from the container that the load balancing is applied the configuration file that the load balancing is applied;It will A locally downloading predetermined directory of acquired configuration file.It should be noted that acquired configuration file is downloaded To local, to modify to configuration file, rather than directly remotely modify on the container of load balancing application, If allowing for during modifying to configuration file, network is interrupted, then during the process rewritten also will appear It is disconnected, that is, the fortuitous event influence caused by rewriting occurred during long-range rewrite is excluded, on the other hand, is matched in locally rewriting It is faster than in the speed for remotely rewriting configuration file to set file.
S1055 deletes the information of the target container example of institute's capacity reducing in the configuration file.
If it is the application of LVS load balancing that load balancing, which is applied, then the configuration file in the application of LVS load balancing (should The configuration file that place refers to includes keepalived.conf) in delete institute's capacity reducing target container example information, comprising: root Match corresponding to the IP for positioning target container example in the configuration file that LVS load balancing is applied according to the IP of target container example Set (configuration code);Configuration corresponding to the IP of target container example is deleted.Wherein, the IP institute of a target container example is right IP, target container example in the configuration answered including target container example are provided corresponding to the port of service, target container example Health examination parameter etc..
If it is the application of Haproxy load balancing that load balancing, which is applied, then the configuration text answered in Haproxy load balancing The container instance information of institute's capacity reducing is deleted in part (configuration file that the place refers to includes Haproxy.conf), comprising: positioning is matched Set the option forward node in the listen node in file;According to the IP of target container example in option Configuration corresponding to the IP of target container example is positioned in forward node;By configuration corresponding to the IP of target container example It deletes.Wherein, a target container example includes port (the i.e. container application of the IP of container instance, container instance offer service Port), health examination parameter etc..The information of one target container example is one server sections corresponding, multiple containers example Information corresponds to server sections multiple.
If it is the application of Nginx load balancing that load balancing, which is applied, then the configuration file so answered in LVS load balancing The created container instance information of addition in (configuration file that the place refers to includes Nginx.conf), comprising: bond-allocating text Upstream node in part;The IP institute of target container example is positioned in upstream node according to the IP of target container example Corresponding configuration;Configuration corresponding to the IP of target container example is deleted.Wherein, match corresponding to a target container example Set the IP including container instance, container instance provides the port (i.e. the port of container application) of service, health examination parameter etc..One The information of a target container example is one server sections corresponding, and the information of multiple containers example corresponds to server sections multiple.
The configuration file for deleting the information of target container example is pushed to corresponding load balancing application by S1056 In container, and the load balancing service of the container of corresponding load balancing application is restarted, so that the modification of configuration file comes into force.
Above step S1051-S1056 defines how the configuration file of the load balancing application of modification container application, step The process automation of the configuration file of the load balancing application of modification container application executes in rapid S1051-S1056, improves and repairs The efficiency and efficiency for changing configuration file also further increase the speed and efficiency of capacity reducing.
Above method embodiment can realize that the container instance to container application carries out capacity reducing, provide clothes in proof load equilibrium Cost is reduced while business, and (the container application to capacity reducing, the target container to capacity reducing are real as determined in addition to being arranged accordingly Example, capacity reducing mode) outside, specific capacity reducing process carries out automatically, improves the efficiency of capacity reducing, has saved time cost and people Work cost;On the other hand, capacity reducing process carries out automatically, has higher professional knowledge that can carry out capacity reducing without user, reduces Cost of labor.
Fig. 5 is the schematic block diagram of the capacity reducing device of container application provided by the embodiments of the present application.The device includes being used for Execute unit corresponding to the capacity reduction method of said vesse application.As shown in figure 5, the capacity reducing device 100 of container application includes Information determination unit 101, capacity reducing unit 102, information updating unit 103, load judgment unit 104, load updating unit 105.
Information determination unit 101, for the determining container application to capacity reducing and the container using the target to capacity reducing The capacity reducing mode of container instance, target container example.
In one embodiment, information determination unit 101 includes: capacity reducing setting unit, capacity reducing information determination unit.Wherein, Capacity reducing setting unit, if the container application identities in the capacity reducing setting instruction are obtained for receiving capacity reducing setting instruction, and Call capacity reducing that interface is set, to receive the capacity reducing side that container instance and container instance that interface is arranged are arranged by the capacity reducing Formula.Capacity reducing information determination unit, for obtaining the container application by the container application identities in capacity reducing setting instruction Information, and the container application is determined as target application, set container instance is determined as target container example, will The capacity reducing mode of set container instance is determined as the capacity reducing mode of target container example.
In one embodiment, information determination unit 101 includes: to determine list using determination unit, quantity determination unit, example Member, mode determination unit.Wherein, using determination unit, for determining the container application to capacity reducing.Quantity determination unit, is used for It is the user's amount of access that can be undertaken according to each container instance that total amount of access of active user and the container are applied, described Container calculates the container instance quantity to capacity reducing using total container instance quantity.Example determination unit, for according to wait contract The container instance quantity of appearance determines the target container example to capacity reducing.Mode determination unit, for determining that the target to capacity reducing is held The capacity reducing mode of device example.In one embodiment, example determination unit, the container instance quantity specifically for basis to capacity reducing, According to the sequence of the multiple containers example creation of container application, the multiple containers example applied from the container determines identical The target container example of quantity;Or according to the container instance quantity to capacity reducing, the multiple containers according to container application are real The resource service condition on host where example determines the target container example of identical quantity.
Capacity reducing unit 102 is used for the target container example according to the capacity reducing mode capacity reducing.
In one embodiment, as shown in fig. 6, capacity reducing unit 102 includes: IP deactivated cell 1021, host determination unit 1022, unit 1023, recovery unit 1024 are destroyed.Wherein, IP deactivated cell 1021, for obtaining the current container example IP, and deactivate the IP of the current container example.Host determination unit 1022, for the letter according to the current container example Breath determines the host of the current container example.Unit 1023 is destroyed, for destroying the current appearance on the host Device example.Recovery unit 1024, for recycling all resources and the current container example of the current container example IP。
In one embodiment, recovery unit 1024 includes IP recovery unit.Wherein, IP recovery unit, comprising: predistribution is sentenced Disconnected unit, the pond IP determination unit.Wherein, judging unit is pre-allocated, for judging whether the IP of the current container example is pre- Distribute IP, wherein the predistribution IP includes the identification information for pre-allocating IP.The pond IP determination unit, if being used for the current appearance The IP of device example is predistribution IP, and the IP of the current container example is recycled to predistribution IP address pond.The pond IP determination unit, If the IP for being also used to the current container example is non-predistribution IP, with being recycled to common IP by the IP of the current container example Location pond.
Information updating unit 103, for container application described in the target container example modifications database according to institute's capacity reducing Information.
Load judgment unit 104, for judging whether the container application creates load balancing application.
Load updating unit 105, if load balancing application is created for the container application, according to the load balancing The type of application modifies the configuration file of the load balancing application, is held with deleting the target of institute's capacity reducing in the configuration file The information of device example.
In one embodiment, as shown in fig. 7, load updating unit 105 includes type judging unit 1051, the determining list of equipment Member 1052, configuration delete unit 1053, configuration download unit 1054, push and restart unit 1055.Wherein, type judging unit 1051, for judging whether the type of the load balancing application is F5.Equipment determination unit 1052, if equal for the load The type of weighing apparatus application is F5, determines the F5 equipment where the application of F5 load balancing according to the information that the container is applied.Configuration is deleted Except unit 1053, for obtaining the configuration file of the F5 load balancing application in the F5 equipment, and in the configuration text The information of the target container example of institute's capacity reducing is deleted in part.Download unit 1054 is configured, if for load balancing application Type is non-F5, determines the container of corresponding load balancing application according to the information that the container is applied, and from corresponding load Configuration file is obtained in the container of equilibrium application, acquired configuration file is locally downloading.Unit 1053 is deleted in configuration, also For deleting the information of the target container example of institute's capacity reducing in the configuration file.Unit 1055 is restarted in push, for that will delete It pushes in the container of corresponding load balancing application, and restarts corresponding in addition to the configuration file of the information of target container example The load balancing service of the container of load balancing application, so that the modification of configuration file comes into force.
It should be noted that it is apparent to those skilled in the art that, the tool of above-mentioned apparatus and each unit Body realizes process, can be no longer superfluous herein with reference to the corresponding description in preceding method embodiment, for convenience of description and succinctly It states.
Above-mentioned apparatus can be implemented as a kind of form of computer program, and computer program can be in meter as shown in Figure 8 It calculates and is run on machine equipment.
Fig. 8 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.The equipment is the equipment such as terminal, Server in such as PaaS platform.The equipment 100 includes processor 102, memory and the net connected by system bus 101 Network interface 103, wherein memory may include non-volatile memory medium 104 and built-in storage 105.
The non-volatile memory medium 104 can storage program area 1041 and computer program 1042.This is non-volatile to deposit , it can be achieved that container described in above-mentioned server when the computer program 1042 stored in storage media is executed by processor 102 The capacity reduction method of application.The processor 102 supports the operation of whole equipment 100 for providing calculating and control ability.The memory Reservoir 105 provides environment for the operation of the computer program in non-volatile memory medium, and the computer program is by processor 102 When execution, processor 102 may make to execute the capacity reduction method of the application of container described in above-mentioned server.The network interface 103 For carrying out network communication.It will be understood by those skilled in the art that structure shown in figure, only related to application scheme Part-structure block diagram, do not constitute the restriction for the equipment being applied thereon to application scheme, specific equipment can be with Including than more or fewer components as shown in the figure, perhaps combining certain components or with different component layouts.
Wherein, the processor 102 is for running computer program stored in memory, to realize that said vesse is answered Any embodiment of capacity reduction method.
It should be appreciated that in the embodiment of the present application, alleged processor 102 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (application program lication Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor Or the processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process, It is that relevant hardware can be instructed to complete by computer program.The computer program can be stored in a storage medium, The storage medium can be computer readable storage medium.The computer program is by the processing of at least one of the computer system Device executes, to realize the process step of the embodiment of the above method.
Therefore, present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium, should Computer readable storage medium includes non-volatile computer readable storage medium storing program for executing.The storage medium is stored with computer program, The computer program realizes any embodiment of the capacity reduction method of said vesse application when being executed by a processor.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk Or the various computer readable storage mediums that can store program code such as CD.
In several embodiments provided herein, it should be understood that disclosed device, device and method, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, the division of the unit, Only a kind of logical function partition, there may be another division manner in actual implementation.Those skilled in the art can be with It is well understood, for convenience of description and succinctly, the specific work process of the device of foregoing description, equipment and unit can With with reference to the corresponding process in preceding method embodiment, details are not described herein.The above, the only specific embodiment party of the application Formula, but the protection scope of the application is not limited thereto, and anyone skilled in the art discloses in the application In technical scope, various equivalent modifications or substitutions can be readily occurred in, these modifications or substitutions should all cover the guarantor in the application Within the scope of shield.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (10)

1. a kind of capacity reduction method of container application, which is characterized in that the described method includes:
Determine that the contracting of target container example, target container example to capacity reducing is applied in container application and the container to capacity reducing Capacitance type;
According to target container example described in the capacity reducing mode capacity reducing;
The information applied according to container described in the target container example modifications database of institute's capacity reducing;
Judge whether the container application creates load balancing application;
It is equal according to the type modification load of load balancing application if the container application creates load balancing application Weigh the configuration file applied, to delete the information of the target container example of institute's capacity reducing in the configuration file.
2. the method according to claim 1, wherein the capacity reducing mode includes serial mode and parallel mode, The target container example according to the capacity reducing mode capacity reducing, comprising:
Following steps are executed according to serial mode or parallel mode:
The IP of the current container example is obtained, and deactivates the IP of the current container example;
The host of the current container example is determined according to the information of the current container example;
Destroy the current container example on the host;
Recycle all resources of the current container example and the IP of the current container example.
3. according to the method described in claim 2, it is characterized in that, recycling the IP of the current container example, comprising:
Judge whether the IP of the current container example is predistribution IP, wherein the predistribution IP includes the mark for pre-allocating IP Know information;
If the IP of the current container example is predistribution IP, the IP of the current container example is recycled to predistribution IP address Pond;
If the IP of the current container example is non-predistribution IP, the IP of the current container example is recycled to plain IP address Pond.
4. the method according to claim 1, wherein the type according to load balancing application modifies institute The configuration file of load balancing application is stated, to delete the information of the target container example of institute's capacity reducing, packet in the configuration file It includes:
Whether the type for judging the load balancing application is F5;
If the type of the load balancing application is F5, F5 load balancing application place is determined according to the information that the container is applied F5 equipment;
The configuration file of the F5 load balancing application is obtained in the F5 equipment, and is deleted and contracted in the configuration file The information of the target container example of appearance;
If the type of the load balancing application is non-F5, determine that corresponding load balancing is answered according to the information that the container is applied Container, and configuration file is obtained from the container that corresponding load balancing is applied, acquired configuration file is downloaded to It is local;
The information of the target container example of institute's capacity reducing is deleted in the configuration file;
The configuration file for deleting the information of target container example is pushed in the container of corresponding load balancing application, is laid equal stress on The load balancing service for opening the container of corresponding load balancing application, so that the modification of configuration file comes into force.
5. the method according to claim 1, wherein container application and the container of the determination to capacity reducing Using the capacity reducing mode of target container example, target container example to capacity reducing, comprising:
If receiving capacity reducing setting instruction, the container application identities in the capacity reducing setting instruction are obtained, and capacity reducing is called to be arranged Interface, in a manner of receiving the capacity reducing of container instance and container instance that interface setting is set by the capacity reducing;
The information of the container application is obtained by the container application identities in capacity reducing setting instruction, and the container is answered With target application is determined as, set container instance is determined as target container example, by the contracting of set container instance Capacitance type is determined as the capacity reducing mode of target container example.
6. the method according to claim 1, wherein container application and the container of the determination to capacity reducing Using the capacity reducing mode of target container example, target container example to capacity reducing, comprising:
Determine the container application to capacity reducing;
The user's amount of access that can be undertaken according to each container instance that total amount of access of active user and the container are applied, The container calculates the container instance quantity to capacity reducing using total container instance quantity;
The target container example to capacity reducing is determined according to the container instance quantity to capacity reducing;
Determine the capacity reducing mode of the target container example to capacity reducing.
7. according to the method described in claim 6, it is characterized in that, the basis is determined to the container instance quantity of capacity reducing wait contract The target container example of appearance, comprising:
According to the container instance quantity to capacity reducing, according to the sequence of the multiple containers example creation of container application, from described The multiple containers example of container application determines the target container example of identical quantity;Or
According to the container instance quantity to capacity reducing, according to the money on the host where the multiple containers example of container application Source service condition determines the target container example of identical quantity.
8. a kind of capacity reducing device of container application, which is characterized in that the capacity reducing device of the container application includes:
Information determination unit applies the target container to capacity reducing real for the determining container application to capacity reducing and the container Example, the capacity reducing mode of target container example;
Capacity reducing unit is used for the target container example according to the capacity reducing mode capacity reducing;
Information updating unit, the information for the application of container described in the target container example modifications database according to institute's capacity reducing;
Load judgment unit, for judging whether the container application creates load balancing application;
Load updating unit, if creating load balancing application for the container application, according to load balancing application Type modifies the configuration file of the load balancing application, to delete the target container example of institute's capacity reducing in the configuration file Information.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory, and is connected with the memory Processor;
The memory is for storing computer program;The processor is for running the computer journey stored in the memory Sequence, to execute the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence when the computer program is executed by processor, realizes the method according to claim 1 to 7.
CN201910413906.9A 2019-05-17 2019-05-17 Capacity reduction method, device, computer equipment and the storage medium of container application Pending CN110275776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910413906.9A CN110275776A (en) 2019-05-17 2019-05-17 Capacity reduction method, device, computer equipment and the storage medium of container application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910413906.9A CN110275776A (en) 2019-05-17 2019-05-17 Capacity reduction method, device, computer equipment and the storage medium of container application

Publications (1)

Publication Number Publication Date
CN110275776A true CN110275776A (en) 2019-09-24

Family

ID=67959981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910413906.9A Pending CN110275776A (en) 2019-05-17 2019-05-17 Capacity reduction method, device, computer equipment and the storage medium of container application

Country Status (1)

Country Link
CN (1) CN110275776A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111491040A (en) * 2020-04-09 2020-08-04 北京城市网邻信息技术有限公司 IP distribution method and IP distribution device
CN113918093A (en) * 2021-09-26 2022-01-11 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN116094804A (en) * 2023-01-10 2023-05-09 广东红餐科技有限公司 Method for avoiding repeated login of user based on Lvs server cluster
CN116132366A (en) * 2022-07-01 2023-05-16 马上消费金融股份有限公司 Traffic management method, traffic management device, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9122712B1 (en) * 2013-06-28 2015-09-01 Emc Corporation Compressing container files
CN105979009A (en) * 2016-07-06 2016-09-28 乾云众创(北京)信息科技研究院有限公司 Method for automatically balancing increased load of cloud application container
WO2016183832A1 (en) * 2015-05-20 2016-11-24 华为技术有限公司 Network service instantiation method and device
CN106992887A (en) * 2017-04-05 2017-07-28 国家电网公司 The implementation method of application example elastic telescopic based on container, apparatus and system
CN107766157A (en) * 2017-11-02 2018-03-06 山东浪潮云服务信息科技有限公司 Distributed container cluster framework implementation method based on domestic CPU and OS
WO2018072708A1 (en) * 2016-10-21 2018-04-26 中兴通讯股份有限公司 Cloud platform service capacity reduction method, apparatus, and cloud platform
CN108616398A (en) * 2018-05-08 2018-10-02 深圳大学 A kind of container dynamic capacity reduction method based on DNS load-balancing techniques
CN109002263A (en) * 2018-07-20 2018-12-14 腾讯科技(深圳)有限公司 The method of adjustment and device of memory capacity
CN109343963A (en) * 2018-10-30 2019-02-15 杭州数梦工场科技有限公司 A kind of the application access method, apparatus and relevant device of container cluster
CN109582441A (en) * 2018-11-30 2019-04-05 北京百度网讯科技有限公司 For providing system, the method and apparatus of container service
CN109756366A (en) * 2018-12-24 2019-05-14 上海欣方智能系统有限公司 System is realized in intelligent network SCP cloud service based on CAAS

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9122712B1 (en) * 2013-06-28 2015-09-01 Emc Corporation Compressing container files
WO2016183832A1 (en) * 2015-05-20 2016-11-24 华为技术有限公司 Network service instantiation method and device
CN105979009A (en) * 2016-07-06 2016-09-28 乾云众创(北京)信息科技研究院有限公司 Method for automatically balancing increased load of cloud application container
WO2018072708A1 (en) * 2016-10-21 2018-04-26 中兴通讯股份有限公司 Cloud platform service capacity reduction method, apparatus, and cloud platform
CN106992887A (en) * 2017-04-05 2017-07-28 国家电网公司 The implementation method of application example elastic telescopic based on container, apparatus and system
CN107766157A (en) * 2017-11-02 2018-03-06 山东浪潮云服务信息科技有限公司 Distributed container cluster framework implementation method based on domestic CPU and OS
CN108616398A (en) * 2018-05-08 2018-10-02 深圳大学 A kind of container dynamic capacity reduction method based on DNS load-balancing techniques
CN109002263A (en) * 2018-07-20 2018-12-14 腾讯科技(深圳)有限公司 The method of adjustment and device of memory capacity
CN109343963A (en) * 2018-10-30 2019-02-15 杭州数梦工场科技有限公司 A kind of the application access method, apparatus and relevant device of container cluster
CN109582441A (en) * 2018-11-30 2019-04-05 北京百度网讯科技有限公司 For providing system, the method and apparatus of container service
CN109756366A (en) * 2018-12-24 2019-05-14 上海欣方智能系统有限公司 System is realized in intelligent network SCP cloud service based on CAAS

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111491040A (en) * 2020-04-09 2020-08-04 北京城市网邻信息技术有限公司 IP distribution method and IP distribution device
CN113918093A (en) * 2021-09-26 2022-01-11 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN113918093B (en) * 2021-09-26 2023-11-03 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN116132366A (en) * 2022-07-01 2023-05-16 马上消费金融股份有限公司 Traffic management method, traffic management device, electronic equipment and storage medium
CN116094804A (en) * 2023-01-10 2023-05-09 广东红餐科技有限公司 Method for avoiding repeated login of user based on Lvs server cluster
CN116094804B (en) * 2023-01-10 2023-09-08 广东红餐科技有限公司 Method for avoiding repeated login of user based on Lvs server cluster

Similar Documents

Publication Publication Date Title
CN110275776A (en) Capacity reduction method, device, computer equipment and the storage medium of container application
CN110289982B (en) Container application capacity expansion method and device, computer equipment and storage medium
CN108572795B (en) Capacity expansion method, device, equipment and storage medium based on built storage virtualization
CN102725733B (en) Porting virtual machine images between platforms
CN107247619B (en) Live migration of virtual machine method, apparatus, system, storage medium and equipment
CN108268271A (en) The upgrade method and update device of micro services
CN110225094A (en) Load balancing application virtual IP address switching method, device, computer equipment and storage medium
CN110007978A (en) A kind of method, device and equipment preloading the page
CN110262872B (en) Load balancing application management method and device, computer equipment and storage medium
CN110286930A (en) A kind of cloud platform upgrade method, device, terminal and storage medium
CN105867962A (en) System upgrading method and device
CN109033466A (en) Page sharing method calculates equipment and computer storage medium
CN110262873A (en) Configuration modification method, apparatus, computer equipment and the storage medium of container application
CN110209420A (en) A kind of method and device updating bootstrap loader
CN108153594A (en) The resource fragmentation method for sorting and electronic equipment of a kind of artificial intelligence cloud platform
US8533303B2 (en) Network management system node and method for use in a network management system node for re-configuring a set of data network nodes in a data network
US10783073B2 (en) Chronologically ordered out-of-place update key-value storage system
CN114443332A (en) Storage pool detection method and device, electronic equipment and storage medium
CN105094811A (en) Method can device for processing events
CN111245645A (en) Zone automatic configuration method, system, equipment and medium of SAN switch
US11750451B2 (en) Batch manager for complex workflows
CN110417856B (en) Capacity expansion method, device, equipment and storage medium for multi-active load balancing application
CN110275717B (en) Private image cloning method, private image cloning device, computer equipment and storage medium
CN115061813A (en) Cluster resource management method, device, equipment and medium
CN110290172B (en) Container application cloning method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination