CN110262873B - Configuration modification method and device for container application, computer equipment and storage medium - Google Patents

Configuration modification method and device for container application, computer equipment and storage medium Download PDF

Info

Publication number
CN110262873B
CN110262873B CN201910413908.8A CN201910413908A CN110262873B CN 110262873 B CN110262873 B CN 110262873B CN 201910413908 A CN201910413908 A CN 201910413908A CN 110262873 B CN110262873 B CN 110262873B
Authority
CN
China
Prior art keywords
container
modified
application
information
container application
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.)
Active
Application number
CN201910413908.8A
Other languages
Chinese (zh)
Other versions
CN110262873A (en
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 CN201910413908.8A priority Critical patent/CN110262873B/en
Priority to PCT/CN2019/103175 priority patent/WO2020232887A1/en
Publication of CN110262873A publication Critical patent/CN110262873A/en
Application granted granted Critical
Publication of CN110262873B publication Critical patent/CN110262873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a configuration modification method, a configuration modification device, computer equipment and a storage medium for container application, which relate to the technical field of cloud computing and can be applied to a PaaS platform. The method comprises the following steps: acquiring configuration information to be modified of the set container application; if the mirror image information to be modified in the configuration information to be modified is inconsistent with the mirror image information of the container application, removing the binding relation between all container instances of the container application and corresponding container instance IP, and destroying all container instances; according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, a new container instance is created, and the created new container instance is bound with a corresponding container instance IP to complete modification and replacement of the mirror image information of the container application. According to the embodiment of the application, the service of the container application can be replaced by changing the configuration, and the service building speed is improved.

Description

Configuration modification method and device for container application, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of cloud computing technologies, and in particular, to a method and apparatus for modifying configuration of a container application, a computer device, and a storage medium.
Background
In a cloud Platform, such as a PaaS-as-a-Service (PaaS-as-a-Service) Platform, generally, when one container application is not used any more and another new container application needs to be created, the processing manner is to delete the original container application and then create the new container application, so that cumbersome operations such as deletion and creation need to be performed to enable the new container application to provide services. In addition, when the creation of the container application is completed, some configuration of the container application may need to be modified. If the memory capacity of the container application is not enough as the user traffic increases, the memory capacity of the container application needs to be modified. When one container application needs to modify the configuration, related personnel are required to log in each container instance of the container application, and then the corresponding configuration is modified one by one, so that the configuration modification process is complicated, and meanwhile, the related personnel are required to have higher expertise, and more labor cost and time cost are required.
Disclosure of Invention
The embodiment of the application provides a configuration modification method, a device, computer equipment and a storage medium for a container application, which can replace the service of the container application in a configuration modification mode, so that the effect of quickly replacing the service is achieved, all container instances of the container application are modified with corresponding configurations at one time, the configuration modification process is automatically completed, and the configuration modification speed of the container application is increased.
In a first aspect, an embodiment of the present application provides a configuration modification method for a container application, including:
if a configuration modification instruction of a container application is received, calling a preset modification interface according to the configuration modification instruction to receive configuration information to be modified of the container application, which is set through the preset modification interface; if a setting completion instruction is received, acquiring configuration information to be modified of the container application; detecting whether the mirror image information to be modified in the configuration information to be modified is consistent with the mirror image information of the container application; if the mirror image information to be modified is inconsistent with the mirror image information of the container application, removing binding relation between all container instances of the container application and corresponding container instance IP, and destroying all container instances; and creating a new container instance according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, and binding the created new container instance with a corresponding container instance IP to complete modification and replacement of the mirror image information of the container application.
In a second aspect, an embodiment of the present invention provides a configuration modification apparatus for a container application, where the configuration modification apparatus for a container application includes a unit corresponding to the method for executing the first aspect.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a memory, and a processor connected to the memory;
the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so as to perform the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the method according to the first aspect.
According to the embodiment of the application, the service of the container application can be replaced in a configuration modification mode, the effect of quickly replacing the service is achieved, and the service construction speed is improved; meanwhile, the corresponding configuration is modified for all container examples of the container application at one time, and the configuration modification process is automatically completed, so that the speed of the configuration modification of the container application is increased, the requirement on the professional degree of a user is not required, the user experience is improved, and the labor cost and the time cost are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method for configuration modification of a container application provided in an embodiment of the present application;
FIG. 2 is a schematic sub-flowchart of a configuration modification method for a container application provided in an embodiment of the present application;
FIG. 3 is a schematic sub-flowchart of a configuration modification method for a container application provided in an embodiment of the present application;
FIG. 4 is a schematic block diagram of a configuration modification device for a container application provided by an embodiment of the present application;
FIG. 5 is a schematic block diagram of a destruction unit provided by an embodiment of the present application;
FIG. 6 is a schematic block diagram of a creation unit provided by an embodiment of the present application;
fig. 7 is a schematic block diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Fig. 1 is a flow chart of a configuration modification method of a container application provided in an embodiment of the present application. As shown in FIG. 1, the method includes S101-S107.
S101, if a configuration modification instruction of a container application is received, calling a preset modification interface according to the configuration modification instruction so as to receive configuration information to be modified of the container application, which is set through the preset modification interface.
The configuration modification instruction of the container application can be triggered in various modes, such as by clicking or triggering a button or an image by a user, for example, clicking a configuration modification button corresponding to a certain container application in a list of container applications to trigger the configuration modification instruction of the container application; such as by receiving a voice configuration modification message from a user to trigger a corresponding configuration modification instruction. The configuration modification instruction includes information of the container application, such as identification information of the container application. The identification information of the container application may be the name of the container application or the number of the container application, etc. information that can determine which container application is specific. The preset modification interface is called according to the configuration modification instruction, and the preset modification interface is developed by a developer and can exist in the form of a setting interface. The configuration information to be modified of the container application can be set through a preset modification interface. It can be understood that the configuration information to be modified of the container application can be set through the preset modification interface, so that the configuration information to be modified is very transparent, the configuration information to be modified can be intuitively seen, and the experience of a user is improved. And the setting can be performed by simple selection/input operation, high expertise of a user is not required, and labor cost and time cost are reduced.
The configuration information to be modified by the container application includes resource information to be modified by the container application, mirror information to be modified by the container application, and the like.
The resource information to be modified by the container application includes CPU resources (such as the number of cores of the CPU), memory resources (such as memory capacity) and the like occupied by each container instance of the container application. Wherein the resource information of the container application may be determined in two ways: firstly, obtaining the flow of the container before application; estimating resource information required by the container application according to the past flow and the current flow of the container application; and determining the estimated resource information as the resource information of the container application. Or determining resource information of the container application according to the prior flow peak of the container application. For example, the resources presumably required by the container application may be estimated according to the past flow peak of the container application, for example, the past flow peak requires 2 core 4G memory, and the resource information of the container application includes 2 core 4G memory. And (II) acquiring the common configuration of the container application stored in the platform, and determining the common configuration as the resource information of the container application. Such as webogic applications, typically require 2-core 4G memory, then 2-core 4G memory is a common configuration for webogic applications. That is, the weblogic application will typically be set to 2-core 4G memory. It should be noted that the common configuration of the container application is set by the user according to the business scenario of the company, i.e. the common configuration is tailored to the business scenario of the company. After the resource information of the container application is determined, the resource information of the container application is displayed on a preset setting interface, so that a user can set the resource information to be modified of the container application according to the displayed resource information of the container application. As in an embodiment, the user may directly set the displayed resource information of the container application as the resource information to be modified by the container application. In one embodiment, the resource information of the displayed container application is set as the resource information of the default container application; if the modification of the resource information of the default container application by the user is received, acquiring the resource information modified by the user; and taking the acquired resource information modified by the user as resource information to be modified. In some embodiments, the resource information of the container application also includes DNS server information, which is typically determined by the architecture of the enterprise, and is typically not modified.
The image information of the container application includes an image type and an image name of the container application. The mirrored information of the container application may be determined as follows: determining a mirror type, such as acquiring a plurality of candidate mirror types from a database, and receiving a mirror type selected by a user from the plurality of candidate mirror types; determining a specific image according to the image type, for example, acquiring all candidate images under the image type from a database according to the image type (it can be understood that a plurality of different image versions exist under the image type); and receiving one image selected by the user from the candidate images as a specific image, and acquiring the image name of the specific image. And taking the image type and the specific image selected by the user as image information to be modified. It should be noted that if the image information to be modified by the container application is empty, the image information of the container application may be considered not to be modified.
It will be appreciated that the configuration information of the set container application to be modified may include only one of the configuration information, such as only mirror information to be modified, only resource information to be modified, only a CPU in the resource information to be modified, only a memory in the resource information to be modified, and the like.
S102, if a setting completion instruction is received, acquiring configuration information to be modified of the container application.
The setting completion instruction may be triggered in various manners, such as by a user clicking or triggering a button or an image, such as by a user clicking a corresponding button or image, such as a "submit" button, a "confirm" image, etc.; such as by receiving a voice determination message from the user to trigger a corresponding setup completion instruction. And after receiving the setting completion instruction, acquiring configuration information to be modified of the container application.
S103, detecting whether the mirror image information to be modified in the configuration information to be modified is consistent with the mirror image information applied by the container.
Wherein all information of all container applications is stored in the database. And determining which container application is according to the identification information of the container application in the configuration modification instruction, and acquiring various information of the container application from a database according to the identification information of the container application. Such as obtaining mirror information for the container application stored in the database. And matching the obtained mirror image information of the container application with the mirror image information with modification in the configuration information to be modified so as to determine whether the mirror image information to be modified is consistent with the mirror image information of the container application stored in the database. If the mirror image information to be modified is empty, determining that the mirror image information to be modified is consistent with the mirror image information of the container application; if the mirror image information to be modified is not empty, but the mirror image information to be modified is the same as the mirror image information of the container application, determining that the mirror image information to be modified is consistent with the mirror image information of the container application; otherwise, if the image information to be modified is different from the image information of the container application, determining that the image information to be modified is inconsistent with the image information of the container application. The image information to be modified is the same as the image information applied by the container, and the image type and the image name are the same. If one of the image type and the image version is different, the information is considered to be different, that is, the image information to be modified is inconsistent with the image information of the container application.
If the mirror image information to be modified is inconsistent with the mirror image information of the container application, executing step S104; if the image information to be modified is consistent with the image information of the container application, step S106 is executed.
S104, the binding relation between all container instances of the container application and corresponding container instance IP is released, and all container instances are destroyed.
The binding relation between the container instance of the container application and the container instance IP is released, and then the container instance of the container application is destroyed.
In one embodiment, as shown in FIG. 2, step S104 includes the following steps S1041-S1043.
S1041, determining the host where all container instances of the container application are located.
And storing the information of the host machines of all the container instances of the container application in a database, and acquiring the host machines of all the container instances of the container application from the database. If the information of the container application is obtained from the database according to the identification information of the container application, the host machines where all container instances of the container application are located are obtained from the database according to the information of the container application. Typically, a container instance corresponds to a host. If there are multiple container instances, the host machine corresponding to the multiple container instances is obtained. It should be noted that the host may also include multiple container instances of other applications thereon.
S1042, the binding relation between the container instance of the container application on the host and the corresponding container instance IP is released.
The database stores information such as container instance IP of the container application. The container instance can access the container application through the IP only after the container instance IP is set. And acquiring the container instance IP information of the container application from the database, and determining the container instance of the container application on the host machine according to the container instance IP information of the container application. The binding relationship between the container instance of the container application on the host and the corresponding container instance IP is released, and the method can be realized by the following steps: and connecting the container instance of the container application through an automatic operation and maintenance tool, and unbinding the container instance of the container application and the container instance IP. Specifically, the container instance of the container application is connected through an automatic operation and maintenance tool, and an instruction for deleting the network card is issued to delete the network card of the container instance of the container application. The automated operation tool may be an existing tool, or may be another tool that may implement the same function. After the binding relationship between the container instance of the container application and the container instance IP is released, the IP state of the container instance is also changed, such as modifying from a use state to a disabled state. In other embodiments, the binding of the container instance of the container application on the host to the corresponding container instance IP may also be resolved in other ways.
It should be noted that, before unbinding the container instance of the container application on the host from the corresponding container instance IP, the method further includes: and stopping the running of the container instance of the container application on the host. Such as by executing instructions to stop the execution of container instances, such as a docker stop instruction.
S1043, destroying the container instance of the container application on the host machine and recovering the resource of the container instance.
And e.g. issuing a destroying instruction to a host machine where the container instance of the container application is located through a container arranging tool so as to destroy the container instance of the container application on the host machine and recover the resources of the container instance. The destroying container instance releases and recovers all the resources occupied by the container instance, such as CPU resources, memory resources, environment information corresponding to the container instance, file input/output stream (closed), connection with database (closed), and the like. Among them, orchestration tools such as marathon, etc. Specifically, the resources of the container instance are destroyed, and it is understood that the process of the container instance on the corresponding host machine is stopped (kill operation). Once kill has the process, it indicates that the container instance does not already exist on the host, nor does it occupy any resources on the host. It will be appreciated that one container instance corresponds to one process.
The embodiment realizes that the binding relation between all container instances of the container application and corresponding container instance IP is released and all container instances are destroyed automatically, and provides the speed of releasing the corresponding binding relation and destroying the container instances.
S105, creating a new container instance according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, and binding the created new container instance with a corresponding container instance IP to complete modification and replacement of the mirror image information of the container application.
The corresponding container instance IP is the IP bound by the destroyed container instance. The number of created new container instances is equal to the number of destroyed container instances. Creating a new container instance and binding the created new container instance with the corresponding container instance IP. Therefore, the IP bound by the destroyed container instance is directly used without distributing the container instance IP for the new container instance, and the speed of modifying and replacing the mirror image information of the container application is improved.
In one embodiment, as shown in FIG. 3, step S105 includes the following steps S1051-S1054.
S1051, determining an image warehouse under the area where the container is applied, and acquiring a specific image from the determined image warehouse according to the image information to be modified.
Such as the application environment of the container application, the region of the container application, is saved in the database. And determining a mirror warehouse under the area of the container application according to the application environment of the container application and the area of the container application. Specifically, according to the application environment of the container application and the region of the container application, searching a mirror warehouse under the region of the container application from a database. It is understood that one mirror repository is defined per application environment, per region. And each region in each application environment corresponds to a mirror image warehouse for storing mirror image resources, and all the mirror image resources required to be used in the region in the application environment are stored in the mirror image warehouse. The application environment comprises a production environment, a test environment, a development environment and the like. After the mirror image warehouse is determined, a specific mirror image is extracted from the mirror image warehouse according to the type and the name of the mirror image in the mirror image information to be modified.
In one embodiment, the mirrored repository under the region where the container application is located may be obtained directly from the database based on the identification information of the container application.
S1052, determining a host for creating a new container instance of the container application according to the mirror image information to be modified and the resource information to be modified.
If the application environment of the container application and the area of the container application can be obtained in the database, the host cluster is determined according to the application environment of the container application and the area of the container application, for example, the host cluster under the area of the container application is obtained from the database according to the application environment of the container application and the area of the container application. In one embodiment, the host cluster under the area where the container application is located may be obtained directly from the database according to the identification information of the container application. After the host cluster is acquired, determining a host for creating a new container instance of the container application according to the mirror information to be modified and the resource information to be modified. The method comprises the steps that a container instance is created, resources of a host are required to be occupied, and resources required to be occupied for creating a new container instance are determined according to the information of the resources to be modified and the mirror image information to be modified; and determining the host machine for creating the new container instance from the host machine cluster under the area where the container application is located according to the resources required to be occupied for creating the new container instance.
It should be noted that the determined host that created the new container instance is randomly assigned and not necessarily the host where the destroyed container instance is located. It will be appreciated that the mirrored information of the application creating the container has changed, and thus, the resources required to create the container instance may also have changed, and if a new container instance is also created on the host where the destroyed container instance is located, there is a high probability that there is insufficient host resources where the destroyed container instance is located, resulting in failure of creation of the new container instance. Thus, the hosts that create the new container instances are randomly allocated according to the resources that need to be occupied to create the new container instances, and thus, there is no shortage of resources for the randomly allocated hosts.
It should be noted that if the resource information to be modified in the step is all empty, the resource information of the container application is directly obtained, the resource information of the container application is used as the resource information to be modified, which means that only the mirror image information of the container application is modified, and the resource information of the created new container instance is the same as the resource information of the destroyed container instance; if a part of the resource information to be modified is empty, the empty part directly uses the corresponding resource of the container application, and if the part is not empty, the information in the resource information to be modified is used; and if the resource information to be modified is not empty, directly using the resource information to be modified.
S1053, creating a new container instance on the determined host according to the specific mirror image and the resource information to be modified.
If the resource information to be modified is packaged, the packaged resource information to be modified and the specific mirror image are sent to the determined host machine through the container arrangement tool, so that the creation of the container instance is carried out on the determined host machine through the container arrangement tool. Specifically, an API function interface, such as a creation interface, in the container orchestration tool is invoked to enable creation of the container instance. The container arranging tool can be a Marathon tool, and can also be other container arranging tools. It should be noted that how many container instances the container application destroys, and then how many container instances are newly created there.
S1054, binding the created new container instance with the corresponding container instance IP.
The created new container instance is connected, such as by an automated operation tool, and bound with the corresponding container instance IP to set the destroyed container instance IP as the created new container instance IP. Wherein, the automated operation tool can be an allowable tool and the like. After the IP is bound with the container instance, the state of the IP is also modified, such as changing the state of the IP from a deactivated state to a used state.
It should be noted that if a container application has multiple container instances, then the container instances on multiple hosts are obtained, each with a replacement of the application image. In this way, the application image of all container instances of the container application can be replaced at one time without requiring a container instance to be replaced one by one.
The embodiment provides a brand new technical thought and technical scheme for quickly replacing the service of the container application by modifying the mirror image information of the container application directly on the basis of the container application, can be realized in seconds, and achieves unexpected technical effects. In addition, the embodiment creates a new container instance according to the mirror image information to be modified and the resource information to be modified, binds the new container instance with the destroyed container instance IP, and improves the speed and efficiency of the replacement of the application mirror image of the container by automating the process.
The steps S104-S105 can realize the application image of the modified container application, namely, the image information of the container application is replaced by the image information to be modified, so that the quick switching or the construction service can be achieved, and meanwhile, the IP of the container instance is kept unchanged. Or can be understood as replacing only the application image or application service of the container application, and the service replacement can be realized quickly and in a second level without changing the other.
S106, detecting whether the resource information to be modified in the configuration information to be modified is consistent with the resource information of the container application.
If the mirror image information to be modified is consistent with the mirror image information of the container application, determining that the mirror image information of the container application is not changed, and detecting whether the resource information to be modified is consistent with the resource information of the container application. If the resource information of the container application is obtained from the database according to the identification information of the container application, matching the obtained resource information of the container application with the resource information to be modified so as to determine whether the resource information to be modified is consistent with the resource information of the container application. If the resource information to be modified is empty, determining that the resource information to be modified is consistent with the resource information of the container application; if the resource information to be modified is not empty, but the resource information to be modified is the same as the resource information of the container application, determining that the resource information to be modified is consistent with the resource information of the container application; otherwise, if the resource information to be modified is different from the resource information of the container application, determining that the resource information to be modified is inconsistent with the resource information of the container application. The resource information to be modified is the same as the resource information of the container application, which can be understood that all the information in the resource information to be modified is the same, and if one of the information is different, the information is considered to be different, that is, the resource information to be modified is inconsistent with the resource information of the container application.
If the resource information to be modified is inconsistent with the resource information of the container application, executing step S107; if the resource information to be modified is consistent with the resource information of the container application, that is, the mirror image information to be modified is consistent with the mirror image information of the container application, and the resource information to be modified is also consistent with the resource information of the container application, this means that the configuration information of the container application is not modified, and the process is ended.
And S107, modifying the resources of the container application according to the resource information to be modified so as to complete the modification of the resource information of the container application.
And acquiring the resource information of the container application from the database, and modifying the resource of the container application on the corresponding host according to the acquired resource information of the container application and the set resource information to be modified. If the resource information to be modified and the acquired resource information of the container application are different, determining the resource information which is required to be added/deleted for the container application. If the memory in the original resource information is 2G and the memory set in the resource information to be modified is 4G, then it is determined that the newly added memory resource 2G is to be applied to the container, that is, the newly added memory resource 2G is to be applied to the container on the corresponding host. If the memory in the original resource information is 4G and the memory set in the resource information to be modified is 2G, determining that the memory resource 2G is deleted for the container application, that is, releasing the memory resource 2G corresponding to the container application on the corresponding host. In this manner, the resource information of the container application is updated to ensure that the resources of the container application are sufficient for use of the container application.
It should be noted that if a container application has multiple container instances, then the container instances on multiple hosts are obtained, each modified.
In addition, the method does not need to log on the corresponding container instance to modify, does not need to put forward requirements on the professional degree of the user, and improves the experience of the user.
In an embodiment, as shown in fig. 1, the method further includes:
s108, updating the configuration information modified by the container application into a database.
Such as updating the modified resource information and/or the modified application image information into the database to ensure that the data in the database is synchronized in real time.
In an embodiment, as shown in fig. 1, the method further includes:
s109, restarting the container application to enable configuration modification of the container application to be effective.
The embodiment of the method can modify the corresponding configuration of all container examples of the container application at one time, and the configuration modification process is automatically completed, so that the speed of configuration modification of the container application is increased, the requirement on the professional degree of a user is not required, the user experience is improved, and the labor cost and the time cost are reduced. Specifically, if the application mirror image of the container application can be replaced, the service of the container application is replaced, and the speed of building the service is improved; such as resource information for a container application that can be quickly modified. In addition, the configuration information to be modified is intuitively set through the corresponding preset setting interface, so that the setting of the configuration information to be modified is very transparent, the requirement on the professional degree of a user is not required, and the user experience is improved.
Fig. 4 is a schematic block diagram of a configuration modification apparatus of a container application provided in an embodiment of the present application. The device comprises a unit corresponding to a configuration modification method for executing the container application. As shown in fig. 4, the configuration modification apparatus 100 of the container application includes a setting unit 101, an information acquisition unit 102, a mirror detection unit 103, a destruction unit 104, a creation unit 105, a resource detection unit 106, and a resource modification unit 107.
The setting unit 101 is configured to, if a configuration modification instruction of a container application is received, invoke a preset modification interface according to the configuration modification instruction, so as to receive configuration information to be modified of the container application set through the preset modification interface.
And the information obtaining unit 102 is configured to obtain configuration information to be modified of the container application if a setting completion instruction is received.
And the image detection unit 103 is used for detecting whether the image information to be modified in the configuration information to be modified is consistent with the image information applied by the container.
And the destroying unit 104 is configured to, if the image information to be modified is inconsistent with the image information of the container application, remove binding relations between all container instances of the container application and corresponding container instances IP, and destroy all container instances.
In an embodiment, as shown in fig. 5, the destruction unit 104 includes an original host determining unit 1041, a removing unit 1042, and a container destruction unit 1043. The original host determining unit 1041 is configured to determine a host where all container instances of the container application are located. And a releasing unit 1042, configured to release the binding relationship between the container instance of the container application on the host and the corresponding container instance IP. A container destroying unit 1043, configured to destroy a container instance of the container application on the host machine and recover a resource of the container instance.
The creating unit 105 is configured to create a new container instance according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, and bind the created new container instance with the corresponding container instance IP, so as to complete modification and replacement of the mirror image information of the container application.
In an embodiment, as shown in fig. 6, the creation unit 105 includes a mirroring determination unit 1051, a new host determination unit 1052, a container creation unit 1053, and a binding unit 1054. The image determining unit 1051 is configured to determine an image repository under an area where the container is applied, and obtain a specific image from the determined image repository according to the image information to be modified. A new host determining unit 1052, configured to determine a host that creates a new container instance of the container application according to the mirror information to be modified and the resource information to be modified. A container creation unit 1053 for creating a new container instance on the determined host machine based on the specific mirror image and the resource information to be modified. A binding unit 1054 for binding the created new container instance with the corresponding container instance IP.
In an embodiment, the new host determining unit 1052 includes an area acquisition unit, a host cluster determining unit, a container host determining unit. The region acquisition unit is used for acquiring the application environment of the container application and the region of the container application. And the host machine cluster determining unit is used for determining the host machine clusters according to the application environment of the container application and the area of the container application. And the container host determining unit is used for determining a host for creating a new container instance from the host cluster according to the mirror image information to be modified and the resource information to be modified.
And the resource detection unit 106 is configured to detect whether the resource information to be modified in the configuration information to be modified is consistent with the resource information of the container application, if the mirror information to be modified is consistent with the mirror information of the container application.
And the resource modifying unit 107 is configured to modify, according to the resource information to be modified, the resource of the container application to complete modification of the resource information of the container application, if the resource information to be modified is inconsistent with the resource information of the container application.
In one embodiment, as shown in fig. 4, the configuration modification device 100 of the container application further includes:
a database updating unit 108, configured to update the configuration information modified by the container application into a database.
In one embodiment, as shown in fig. 4, the configuration modification device 100 of the container application further includes:
a restarting unit 109, configured to restart the container application, so as to validate configuration modification of the container application.
It should be noted that, as those skilled in the art can clearly understand the specific implementation process of the foregoing apparatus and each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described apparatus may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 7.
Fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application. The device is a terminal and other devices, such as a server in a PaaS platform. The device 100 comprises a processor 102, a memory and a network interface 103 connected by a system bus 101, wherein the memory may comprise a non-volatile storage medium 104 and an internal memory 105.
The non-volatile storage medium 104 may store an operating system 1041 and computer programs 1042. The computer program 1042 stored in the nonvolatile storage medium, when executed by the processor 102, can implement the container application configuration modification method described in the server. The processor 102 is used to provide computing and control capabilities to support the operation of the overall device 100. The internal memory 105 provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by the processor 102, causes the processor 102 to perform the container application configuration modification method described in the server above. The network interface 103 is used for network communication. It will be appreciated by persons skilled in the art that the structures shown in the figures are block diagrams of only some of the structures associated with the aspects of the present application and do not constitute limitations on the apparatus to which the aspects of the present application may be applied, and that a particular apparatus may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 102 is configured to run a computer program stored in a memory to implement any of the embodiments of the configuration modification method of the container application described above.
It should be appreciated that in embodiments of the present application, the processor 102 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (application lication Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium, which may be a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium including a non-volatile computer-readable storage medium. The storage medium stores a computer program which, when executed by a processor, implements any of the embodiments of the configuration modification method of the container application described above.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus, device, and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and the division of the units is merely a logical function division, and other divisions may be implemented in practice. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of configuration modification of a container application, the method comprising:
if a configuration modification instruction of a container application is received, calling a preset modification interface according to the configuration modification instruction to receive configuration information to be modified of the container application, which is set through the preset modification interface;
if a setting completion instruction is received, acquiring configuration information to be modified of the container application;
detecting whether the mirror image information to be modified in the configuration information to be modified is consistent with the mirror image information of the container application;
if the mirror image information to be modified is inconsistent with the mirror image information of the container application, removing binding relation between all container instances of the container application and corresponding container instance IP, and destroying all container instances;
and creating a new container instance according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, and binding the created new container instance with a corresponding container instance IP to complete modification and replacement of the mirror image information of the container application.
2. The method according to claim 1, wherein the method further comprises:
if the mirror image information to be modified is consistent with the mirror image information of the container application, detecting whether the resource information to be modified in the configuration information to be modified is consistent with the resource information of the container application;
and if the resource information to be modified is inconsistent with the resource information of the container application, modifying the resource of the container application according to the resource information to be modified so as to complete the modification of the resource information of the container application.
3. The method of claim 1, wherein unbinding all container instances of the container application from the corresponding container instance IP and destroying all container instances comprises:
determining a host machine where all container instances of the container application are located;
releasing the binding relation between the container instance of the container application on the host and the corresponding container instance IP;
destroying the container instance of the container application on the host and reclaiming the resources of the container instance.
4. The method of claim 3, wherein the destroying the container instance of the container application on the host and reclaiming resources of the container instance comprises:
and sending a destroying instruction to a host computer where the container instance of the container application is located through a container arranging tool so as to destroy the container instance of the container application on the host computer and recover the resources of the container instance.
5. The method according to claim 1, wherein creating a new container instance according to the resource information to be modified and the mirror information to be modified in the configuration information to be modified, and binding the created new container instance with the corresponding container instance IP, comprises:
determining an image warehouse under the area where the container is applied, and acquiring a specific image from the determined image warehouse according to the image information to be modified;
determining a host for creating a new container instance of the container application according to the mirror image information to be modified and the resource information to be modified;
creating a new container instance on the determined host according to the specific mirror image and the resource information to be modified;
the created new container instance is bound to the corresponding container instance IP.
6. The method of claim 5, wherein the determining a host to create a new container instance for the container application based on the mirrored information to be modified and the resource information to be modified comprises:
acquiring an application environment of the container application and an area of the container application;
determining a host cluster according to the application environment of the container application and the area of the container application;
and determining a host for creating a new container instance from the host cluster according to the mirror information to be modified and the resource information to be modified.
7. The method according to claim 1, wherein the method further comprises:
updating the configuration information modified by the container application into a database;
restarting the container application to validate configuration modifications of the container application.
8. A configuration modification apparatus for a container application, the configuration modification apparatus for a container application comprising:
the setting unit is used for calling a preset modification interface according to the configuration modification instruction if the configuration modification instruction of the container application is received, so as to receive configuration information to be modified of the container application, which is set through the preset modification interface;
the information acquisition unit is used for acquiring configuration information to be modified of the container application if a setting completion instruction is received;
the mirror image detection unit is used for detecting whether the mirror image information to be modified in the configuration information to be modified is consistent with the mirror image information applied by the container;
the destroying unit is used for removing the binding relation between all container examples of the container application and corresponding container examples IP if the mirror image information to be modified is inconsistent with the mirror image information of the container application, and destroying all container examples;
the creation unit is used for creating a new container instance according to the resource information to be modified and the mirror image information to be modified in the configuration information to be modified, and binding the created new container instance with a corresponding container instance IP so as to complete modification and replacement of the mirror image information of the container application.
9. A computer device comprising a memory, and a processor coupled to the memory;
the memory is used for storing a computer program; the processor is configured to execute a computer program stored in the memory to perform the method of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
CN201910413908.8A 2019-05-17 2019-05-17 Configuration modification method and device for container application, computer equipment and storage medium Active CN110262873B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910413908.8A CN110262873B (en) 2019-05-17 2019-05-17 Configuration modification method and device for container application, computer equipment and storage medium
PCT/CN2019/103175 WO2020232887A1 (en) 2019-05-17 2019-08-29 Configuration modification method and apparatus for container application, and computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910413908.8A CN110262873B (en) 2019-05-17 2019-05-17 Configuration modification method and device for container application, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110262873A CN110262873A (en) 2019-09-20
CN110262873B true CN110262873B (en) 2023-07-28

Family

ID=67913406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910413908.8A Active CN110262873B (en) 2019-05-17 2019-05-17 Configuration modification method and device for container application, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110262873B (en)
WO (1) WO2020232887A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110674043B (en) * 2019-09-24 2023-09-12 聚好看科技股份有限公司 Processing method and server for application debugging
CN112181597B (en) * 2020-10-12 2024-01-19 成都精灵云科技有限公司 Dynamic updating method for container resource use limit
CN113157339B (en) * 2021-04-23 2023-07-18 东云睿连(武汉)计算技术有限公司 Application service extension method, system, storage medium and device based on OSB
CN115309457B (en) * 2022-08-10 2023-10-27 中电金信软件有限公司 Restarting method and device of application instance, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application
CN108984268A (en) * 2018-07-13 2018-12-11 郑州云海信息技术有限公司 The method and apparatus of Container Management in Docker system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015995B (en) * 2016-01-28 2021-01-05 华为技术有限公司 Method and device for modifying mirror image file
US10230786B2 (en) * 2016-02-26 2019-03-12 Red Hat, Inc. Hot deployment in a distributed cluster system
US10346143B2 (en) * 2017-06-21 2019-07-09 Ca, Inc. Systems and methods for transforming service definitions in a multi-service containerized application
CN107580083B (en) * 2017-09-20 2020-11-03 北京京东尚科信息技术有限公司 Method and system for allocating IP addresses of containers
CN108683516B (en) * 2018-03-14 2021-09-10 聚好看科技股份有限公司 Application instance upgrading method, device and system
CN109343963B (en) * 2018-10-30 2021-12-07 杭州数梦工场科技有限公司 Application access method and device for container cluster and related equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application
CN108984268A (en) * 2018-07-13 2018-12-11 郑州云海信息技术有限公司 The method and apparatus of Container Management in Docker system

Also Published As

Publication number Publication date
WO2020232887A1 (en) 2020-11-26
CN110262873A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
CN110262873B (en) Configuration modification method and device for container application, computer equipment and storage medium
US11593302B2 (en) Methods, systems, and computer readable mediums for implementing a data protection policy for a transferred enterprise application
US11249856B2 (en) Application consistent snapshots as a sidecar of a containerized application
US9189224B2 (en) Forming an upgrade recommendation in a cloud computing environment
US20180018193A1 (en) Virtual network function management apparatus, system, healing method, and program
WO2016078417A1 (en) Method and device for upgrading virtualized network function manager, and server
US20140215265A1 (en) Data backup and recovery
US10204021B2 (en) Recovery of an infected and quarantined file in a primary storage controller from a secondary storage controller
EP2724231A1 (en) A method of provisioning a cloud-based render farm
CN107463390B (en) Software upgrading method and upgrading server
CN103778026A (en) Object calling method and device
CN110275717B (en) Private image cloning method, private image cloning device, computer equipment and storage medium
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
EP4162649B1 (en) Stable references for network function life cycle management automation
CN116400934B (en) Project automatic deployment method based on jenkins
CN110852571A (en) House resource management method for franchisee, computer-readable storage medium, and server
CN115858086A (en) Data recovery method, data recovery system, device and storage medium
US20220179664A1 (en) Graphical user interface to specify an intent-based data management plan
CN110221952B (en) Service data processing method and device and service data processing system
CN110262871B (en) Container instance start-stop method and device for container application, computer equipment and storage medium
CN109901933B (en) Operation method and device of business system, storage medium and electronic device
CN109101253B (en) Management method and device for host in cloud computing system
CN117389713B (en) Storage system application service data migration method, device, equipment and medium
JP2018073099A (en) Scale-in processing program, scale-in processing method, and information processing system
KR102214486B1 (en) Nfv apparatus performing self-healing

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
GR01 Patent grant
GR01 Patent grant