CN110413381B - Method and apparatus for containerizing application services - Google Patents

Method and apparatus for containerizing application services Download PDF

Info

Publication number
CN110413381B
CN110413381B CN201910715877.1A CN201910715877A CN110413381B CN 110413381 B CN110413381 B CN 110413381B CN 201910715877 A CN201910715877 A CN 201910715877A CN 110413381 B CN110413381 B CN 110413381B
Authority
CN
China
Prior art keywords
container
application
stateful
creating
state
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
CN201910715877.1A
Other languages
Chinese (zh)
Other versions
CN110413381A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910715877.1A priority Critical patent/CN110413381B/en
Publication of CN110413381A publication Critical patent/CN110413381A/en
Application granted granted Critical
Publication of CN110413381B publication Critical patent/CN110413381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Abstract

The present disclosure provides a method for containerizing application services, the method comprising: determining whether a first container has been destroyed, the first container being used to run a stateful application; if it is determined that the first container has been destroyed, creating a second container for running the stateful application; releasing the association relation between the application state of the stateful application and the first container; and creating an association between the application state and the second container to implement containerization of the stateful application. The present disclosure also provides an apparatus for containerizing an application service, an electronic device, and a computer-readable storage medium.

Description

Method and apparatus for containerizing application services
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for containerizing an application service.
Background
The convenience of the financial internet has enabled an increasing number of financial activities to be transferred from off-line to on-line. In the face of continuously increasing service flow, the commercial bank data center can only continuously expand the scale of the machine room. At present, the computer room expansion scheme mainly includes a physical machine expansion scheme and a virtual machine expansion scheme. The system is deployed by adopting a traditional physical machine, the environment building period is long, the application and deployment are complex, and various environment systems need to be adapted. By adopting the deployment of the virtual machine, the performance loss of the virtual machine is large, and the waste of computing resources is caused. In addition, both schemes cannot flexibly schedule the workload, and the imbalance of the loads of the applications causes the conflict of the computing resource requirements.
Disclosure of Invention
One aspect of the present disclosure provides a method for containerizing application services, comprising: determining whether a first container has been destroyed, the first container being used to run a stateful application; creating a second container for running the stateful application if it is determined that the first container has been destroyed; releasing the association relationship between the application state of the stateful application and the first container; and creating an association between the application state and the second container to enable containerization of the stateful application
Optionally, the method further comprises: operating the second vessel; and in response to executing the second container, launching the stateful application in the second container.
Optionally, the creating an association relationship between the application state and the second container includes: determining a data storage location of the stateful application when the stateful application is run through the first container; and creating an association between the data storage location and the second container.
Optionally, the creating an association relationship between the application state and the second container includes: determining an IP address, a gateway address and a port number corresponding to the stateful application, which are used by the first container when the stateful application is operated by the first container; and configuring the network state of the second container based on the IP address, the gateway address and the port number.
Optionally, the creating an association relationship between the application state and the second container includes: determining a first file path for storing files of the stateful application, wherein the first file path is configured for the first container when the stateful application is run through the first container; and configuring, for a second container, a second file path for storing files of the stateful application such that the second file path is the same as the first file path.
Another aspect of the present disclosure provides an apparatus for containerizing application services, comprising: the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining whether a first container is destroyed or not, and the first container is used for running a stateful application; a first creation module to create a second container for running the stateful application if it is determined that the first container has been destroyed; the releasing module is used for releasing the association relation between the application state of the stateful application and the first container; and the second creating module is used for creating the association relation between the application state and the second container so as to realize containerization on the stateful application.
Optionally, the apparatus further comprises: an operation module for operating the second container; and a starting module for starting the stateful application in the second container in response to running the second container.
Optionally, the second creating module includes: a determining unit, configured to determine a data storage location of the stateful application when the stateful application is run through the first container; and a creating unit configured to create an association between the data storage location and the second container.
Another aspect of the present disclosure provides an electronic device including: one or more processors; memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method according to an embodiment of the disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing a method according to an embodiment of the present disclosure when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing a method according to an embodiment of the disclosure when executed.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario suitable for the method and apparatus for containerizing application services according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a method for containerizing application services according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a method for containerizing application services according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of an apparatus for containerizing application services according to an embodiment of the present disclosure; and
fig. 5 schematically shows a block diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon for use by or in connection with an instruction execution system.
Embodiments of the present disclosure provide a method for containerizing an application service and an apparatus for containerizing an application service capable of applying the method. The method includes determining whether a first container has been destroyed, the first container being used to run a stateful application; if it is determined that the first container has been destroyed, creating a second container for running the stateful application; releasing the association relation between the application state of the stateful application and the first container; and creating an association between the application state and the second container to implement containerization of the stateful application.
Fig. 1 schematically illustrates an application scenario suitable for a method and apparatus for containerizing application services according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
Because the traditional physical machine is adopted for deployment in the related technology, the environment building period is long, the application deployment is complex, and various environment systems need to be adapted. And by adopting the virtual machine deployment, the performance loss of the virtual machine is large, and the waste of computing resources is caused. In addition, both schemes cannot flexibly schedule the workload, and the imbalance of the loads of the applications causes the conflict of the computing resource requirements.
Therefore, for the pain point, the embodiment of the disclosure performs containerization on the stateful application, so that the containerization application is uniformly scheduled by using a uniform container scheduling platform, which not only can improve the scheduling flexibility, but also can save the consumption of physical machine resources and improve the utilization rate of computing resources.
It should be understood that the nature of the container determines that once a container is destroyed, all of the state information within the container will disappear. A container cannot be restarted after being destroyed. This determines that only stateless applications can enjoy the advantages of containerization. Stateless applications are only a small portion of the multitude of financial application services, while stateful applications are only a large portion of the multitude of financial application services. Therefore, if the containerization of the application is not tied to the characteristic of the state, more resources can be saved for the data center.
In contrast, the application containerization method is improved, that is, the stateful application is stripped from the application state thereof, so that the stateful application can enjoy the containerization advantage, and thus more resources can be saved for the data center. As shown in fig. 1, a stateful application 1 may be stripped from its application state 1. If the stateful application 1 is running using container 1, application state 1 is associated with container 1. If the container 1 is destroyed, the association between the application state 1 and the container 1 can be released and the container 2 can be created, while the association between the application state 1 and the container 2 is created. In this way, application containerization can be achieved for the stateful application 1.
FIG. 2 schematically shows a flow diagram of a method for containerizing application services according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, it is determined whether the first container is destroyed, the first container being used to run a stateful application.
It should be noted that the method for containerizing application services provided by the embodiments of the present disclosure may be used for containerizing any stateful application.
In addition, in the embodiments of the present disclosure, stateful applications are also referred to as stateful services. Stateful services and stateless services are two different service architectures that differ in the handling of service states. The service state is the data required to service the request and may be a variable or a data structure. Stateless services do not record the service state, nor do different requests have any relationship between them. And the other way round if there is a stateful service.
The stateless service processes a single request of a client independently of other requests, and information for processing one request is contained in the request. Stateful services, in contrast, store data information that is context-dependent for requests, and successive requests may be related.
In operation S220, if it is determined that the first container has been destroyed, a second container for running the stateful application is created.
The container can only be destroyed and cannot be restarted. In order to implement containerization of stateful applications, in the embodiments of the present disclosure, it is determined whether a container has been destroyed by monitoring the container in real time. If the container has been destroyed, a new container needs to be created, so that the stateful application that was running on the destroyed container is migrated to the newly created container.
In addition, in the embodiment of the present disclosure, if it is found through real-time monitoring that a certain container is not destroyed, it is not necessary to create a container for the stateful application running thereon again, and it is only necessary to continue monitoring whether the container is destroyed.
In operation S230, an association between an application state of a stateful application and a first container is released.
In order to implement containerization of stateful applications, in the embodiment of the present disclosure, for a destroyed container, in addition to creating a new container and migrating the stateful applications running on the destroyed container to the newly created container, it is also necessary to migrate the application states of the stateful applications together. Before the application state of the stateful application is migrated, the association relationship between the application state of the stateful application and the destroyed container needs to be released.
In operation S240, an association between the application state and the second container is created to implement containerization of the stateful application.
In the embodiment of the present disclosure, creating an association between an application state of a stateful application and a container may include, for example, classifying the application state of the stateful application, and then creating an association between each class of state and the container. For example, the application state of a stateful application may be divided into a storage state, a network state, and a configuration state.
In particular, in the disclosed embodiments, the above three states may be abstracted, for example, into a state descriptive profile. The storage state description file may include external storage information of the service container, such as information of the LUNID, the lungerop group, the host name, the host group to which the service container belongs, and the mapping relationship. The network state description file may contain information such as an IP address, a subnet mask, a gateway, and a VLAN number of the service container. The configuration state description file may contain static configuration information required when the service container is started and dynamic configuration information that can be dynamically changed at runtime. For example, the file path in the application file container for storing the file may be the static configuration information, and the role of the application may be the dynamically changeable dynamic configuration information.
It should be noted that, in the embodiment of the present disclosure, a storage controller, a configuration controller, a network controller, and a general control controller may also be provided.
The storage controller is used for persisting the data of the stateful service container and enabling the data to be associated with the stateful service container through an external stateful service container data directory, and the data can be migrated along with migration of the stateful service container.
The configuration controller is used for stripping the configuration information of the stateful service from the service, intensively storing the configuration information and the service in the configuration controller, and issuing the configuration to the container when the stateful service instance container is created.
The network controller is used for managing the network information of the stateful service container, including network segments, network addresses, subnet masks, VLAN numbers and the like.
The master controller is used for coordinating the work of the storage controller, the configuration controller and the network controller and sending the configuration to each controller through the stateful service description file.
And the storage controller, the configuration controller and the network controller instantiate the corresponding state descriptive configuration files and complete the life cycle management of the stateful service container by submitting the corresponding state descriptive configuration files to the master control controller.
Through the embodiment of the disclosure, the application state of the stateful application can be stripped from the application, so that the state and the application are decoupled, the state can be persistent, and the service is changed into a stateless service, so that the containerization is realized. Fig. 3 schematically illustrates a flow diagram of a method for containerizing application services according to another embodiment of the present disclosure.
As shown in fig. 3, the method may include, for example, operations S310 to S320 as follows, in addition to operations S210 to S240 as shown in fig. 2. For brevity, the embodiments of the present disclosure omit the description of operations S210 to S240.
In operation S310, the second container is operated.
Specifically, in the embodiments of the present disclosure, a Docker image may be constructed by Docker, and the second container may be run by the Docker image.
It should be appreciated that Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image and then distribute it to any popular Linux or Windows machine, as well as to achieve virtualization.
Next, in operation S320, in response to executing the second container, a stateful application is started in the second container.
Specifically, in the embodiments of the present disclosure, the stateful application and the dependency package may be packaged in advance in a portable image, and then the second container is run by running the image, so as to start the stateful application in the second container.
As an alternative embodiment, creating an association between the application state and the second container may include, for example, the following operations. Data storage locations of the stateful application are determined when the stateful application is running through the first container. An association between the data storage location and the second container is created.
Specifically, in the embodiment of the present disclosure, for example, if a stateful application runs on a destroyed container and application data of the stateful application is stored in the database a, when the stateful application is subjected to application containerization, it is necessary to release an association relationship between the database a and the destroyed container, and create a corresponding association relationship between the database a and a newly created container. In this way, after the stateful application is migrated to the newly created container for running, the database a can still be used for storing data, so that the application data of the stateful application can be kept persistent.
As an alternative embodiment, creating an association between the application state and the second container may include, for example, the following operations. And determining an IP address, a gateway address and a port number corresponding to the stateful application, which are used by the first container when the stateful application runs through the first container. And configuring the network state of the second container based on the IP address, the gateway address and the port number.
Specifically, in the embodiment of the present disclosure, for example, if when a stateful application runs on a destroyed container, an IP address used by the destroyed container is IP1, a gateway address is IP2, and a port number of a server corresponding to the stateful application is XX, when the stateful application is containerized, it is necessary to remove an association relationship between IP1, IP2, and port number XX and the destroyed container, and create an association relationship between IP1, IP2, and port number XX and the newly created container respectively. In this way, after the stateful application is migrated to the newly created container for running, the stateful application can still be accessed by using the IP1, the IP2 and the port number XX, so that the persistence of the network state of the stateful application can be realized.
As an alternative embodiment, creating an association between the application state and the second container may include, for example, the following operations. A first file path for a file storing a stateful application is determined, wherein the first file path is configured for a first container when the stateful application is running through the first container. And configuring a second file path for the file stored with the state application aiming at the second container, wherein the second file path is the same as the first file path.
Specifically, in the embodiment of the present disclosure, for example, if a stateful application runs on a destroyed container, and a file storage path of the stateful application in the destroyed container is XXX, when the stateful application is subjected to application containerization, a same file storage path, that is, a file storage path XXX, may be configured for the stateful application in a newly created container, so that persistence of a configuration state of the stateful application can be achieved.
According to the embodiment of the disclosure, the state descriptive configuration file is formed by classifying and stripping the states of the stateful application, so that uniform formatting processing can be realized on the application states. And the configuration information of the stateful application can be managed in a centralized way according to the configuration state description file, and when a stateful application container is instantiated, the corresponding configuration information can be issued as required. And the network state of the stateful application can be stripped from the application according to the network state description file, so that the network state can be ensured not to be changed when the stateful application container is reconstructed. And the correct mounting of the persistent data directory can be ensured when the stateful service container is rebuilt and migrated according to the storage state description file. After the application state is separated from the stateful application, the application state can be kept unchanged after the stateful application is rebuilt and migrated.
Furthermore, by means of the disclosed embodiments, stateful applications may be containerized.
Specifically, by the containerization method provided by the embodiment of the disclosure, the stateful services and the state classification can be separated, so that the stateful services do not pay attention to the state of the stateful services any more and are managed by the container platform in a unified manner.
In addition, in the embodiment of the disclosure, stateless applications and stateful applications can share the same container scheduling platform without mutual interference, and a new container scheduling platform does not need to be built again, so that infrastructure resources of a data center can be saved.
The present disclosure will be described in detail below with reference to specific examples.
For example, a stateful application A runs on a container A, which may be destroyed if the physical machine used to implement the container A fails. In order to ensure that the stateful application A can be normally used after the container A is destroyed, the application state A of the stateful application A can be separated from the stateful application A by the technical scheme provided by the embodiment of the disclosure. And simultaneously, creating a new container B for the stateful application A, thereby migrating the stateful application A to the container B for running. At this time, the association relationship between the application state a and the container a needs to be released first, and then the association relationship between the application state a and the container B needs to be created. Specifically, if the database used by the stateful application a running on the container a is database a, an association between database a and container B is created. If the IP address used by the container A when the stateful application A runs on the container A is IP1, the gateway address of the gateway used by the container A is IP2, and the port number of the port of the server used by the stateful application A is X, the IP address of the container B is configured to be IP1, and the gateway of the container B is configured to be the gateway with the gateway address of IP2, and the port number of the port of the server used by the stateful application A is configured to be X. If the file path used by the stateful application A on the container A when the stateful application A runs on the container A is Y, the file path Y is created on the container B and is allocated to the stateful application A to store the corresponding file.
Fig. 4 schematically illustrates a block diagram of an apparatus for containerizing application services according to an embodiment of the present disclosure.
As shown in fig. 4, the apparatus 400 for containerizing an application service may include, for example, a determination module 401, a first creation module 402, a release module 403, and a second creation module 404. The apparatus for containerizing application services may perform the method described above with reference to the method embodiment, and will not be described herein again.
Specifically, the determination module 401 may be used, for example, to determine whether a first container has been destroyed, the first container being used to run a stateful application.
The first creation module 402 may be used, for example, to create a second container for running a stateful application if it is determined that the first container has been destroyed.
The releasing module 403 may be used, for example, to release the association between the application state of the stateful application and the first container.
The second creation module 404 may be used, for example, to create an association between the application state and a second container to implement containerization of the stateful application.
As an alternative embodiment, the apparatus may further include, for example, an operation module and a start module.
In particular, the operating module can be used, for example, for operating the second container.
The launch module may be used, for example, to launch a stateful application in a second container in response to running the second container.
As an alternative embodiment, the second creating module may include, for example: a determining unit and a creating unit.
In particular, the determination unit may be used, for example, to determine a data storage location of the stateful application when the stateful application is running through the first container.
The creation unit may for example be used to create an association between the data storage location and the second container.
It should be noted that the embodiments of the apparatus portion and the method portion are similar to each other, and the achieved technical effects are also similar to each other, which are not described herein again.
Any of the modules, units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules and units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units according to the embodiments of the present disclosure may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by any other reasonable means of hardware or firmware by integrating or packaging the circuits, or in any one of three implementations of software, hardware and firmware, or in any suitable combination of any of them. Alternatively, one or more of the modules, units according to embodiments of the present disclosure may be implemented at least partly as computer program modules, which, when executed, may perform the respective functions.
For example, any number of the determination module 401, the first creation module 402, the release module 403, and the second creation module 404 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the determining module 401, the first creating module 402, the releasing module 403, and the second creating module 404 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any several of them. Alternatively, at least one of the determining module 401, the first creating module 402, the releasing module 403 and the second creating module 404 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
Fig. 5 schematically shows a block diagram of an electronic device according to an embodiment of the disclosure. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the electronic device 500 includes a processor 510, a computer-readable storage medium 520. The electronic device 500 may perform a method according to an embodiment of the present disclosure.
In particular, processor 510 may include, for example, a general purpose microprocessor, an instruction set processor and/or related chip set and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), and/or the like. The processor 510 may also include on-board memory for caching purposes. Processor 510 may be a single processing unit or a plurality of processing units for performing different actions of a method flow according to embodiments of the disclosure.
Computer-readable storage media 520, for example, may be non-volatile computer-readable storage media, specific examples including, but not limited to: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and so on.
The computer-readable storage medium 520 may include a computer program 521, which computer program 521 may include code/computer-executable instructions that, when executed by the processor 510, cause the processor 510 to perform a method according to an embodiment of the disclosure, or any variation thereof.
The computer program 521 may be configured with, for example, computer program code comprising computer program modules. For example, in an example embodiment, code in computer program 521 may include one or more program modules, including for example 521A, modules 521B, … …. It should be noted that the division and number of modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual situations, and when these program modules are executed by the processor 510, the processor 510 may execute the method according to the embodiment of the present disclosure or any variation thereof.
According to an embodiment of the present disclosure, at least one of the determining module 401, the first creating module 402, the releasing module 403 and the second creating module 404 may be implemented as a computer program module described with reference to fig. 5, which, when executed by the processor 510, may implement the respective operations described above.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be understood by those skilled in the art that while the present disclosure has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Accordingly, the scope of the present disclosure should not be limited to the above-described embodiments, but should be defined not only by the appended claims, but also by equivalents thereof.

Claims (10)

1. A method for containerizing application services, comprising:
determining whether a first container has been destroyed, the first container being used to run a stateful application;
creating a second container for running the stateful application if it is determined that the first container has been destroyed;
releasing the association relationship between the application state of the stateful application and the first container; and
creating an association between the application state and the second container to implement containerization of the stateful application;
wherein creating the association between the application state and the second container comprises:
classifying the application states of the stateful application, and then respectively creating an association relation between each type of state and the container.
2. The method of claim 1, wherein the method further comprises:
operating the second vessel; and
in response to running the second container, launching the stateful application in the second container.
3. The method of claim 2, wherein the creating an association between the application state and the second container comprises:
determining a data storage location of the stateful application when the stateful application is run through the first container; and
an association between the data storage location and the second container is created.
4. The method of claim 2, wherein the creating an association of the application state with the second container comprises:
determining an IP address, a gateway address and a port number corresponding to the stateful application, which are used by the first container when the stateful application is operated by the first container; and
and configuring the network state of the second container based on the IP address, the gateway address and the port number.
5. The method of claim 2, wherein the creating an association between the application state and the second container comprises:
determining a first file path for storing files of the stateful application, wherein the first file path is configured for the first container when the stateful application is run through the first container; and
for a second container, configuring a second file path for storing files of the stateful application such that the second file path is the same as the first file path.
6. An apparatus for containerizing application services, comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining whether a first container is destroyed or not, and the first container is used for running a stateful application;
a first creation module to create a second container for running the stateful application if it is determined that the first container has been destroyed;
the releasing module is used for releasing the association relation between the application state of the stateful application and the first container; and
the second creating module is used for creating an incidence relation between the application state and the second container so as to realize containerization on the stateful application;
wherein creating the association between the application state and the second container comprises:
classifying the application states of the stateful application, and then respectively creating an association relation between each type of state and the container.
7. The apparatus of claim 6, wherein the apparatus further comprises:
an operation module for operating the second container; and
a launch module to launch the stateful application in the second container in response to running the second container.
8. The apparatus of claim 7, wherein the second creation module comprises:
a determining unit, configured to determine a data storage location of the stateful application when the stateful application is run through the first container; and
and the creating unit is used for creating an association relation between the data storage position and the second container.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
10. A computer-readable storage medium storing computer-executable instructions for implementing the method of any one of claims 1 to 5 when executed.
CN201910715877.1A 2019-08-02 2019-08-02 Method and apparatus for containerizing application services Active CN110413381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910715877.1A CN110413381B (en) 2019-08-02 2019-08-02 Method and apparatus for containerizing application services

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910715877.1A CN110413381B (en) 2019-08-02 2019-08-02 Method and apparatus for containerizing application services

Publications (2)

Publication Number Publication Date
CN110413381A CN110413381A (en) 2019-11-05
CN110413381B true CN110413381B (en) 2022-03-25

Family

ID=68365816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910715877.1A Active CN110413381B (en) 2019-08-02 2019-08-02 Method and apparatus for containerizing application services

Country Status (1)

Country Link
CN (1) CN110413381B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254159B (en) * 2021-06-16 2022-10-21 腾讯科技(成都)有限公司 Migration method and device of stateful service, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844539A (en) * 2017-10-19 2018-03-27 广州阿里巴巴文学信息技术有限公司 Isolated data management method, device, system, computing device and storage medium
CN109614226A (en) * 2018-11-20 2019-04-12 武汉烽火信息集成技术有限公司 A kind of stateful application memory management method based on Kubernetes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11042450B2 (en) * 2016-07-28 2021-06-22 International Business Machines Corporation Mechanism for managing container runtime state

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844539A (en) * 2017-10-19 2018-03-27 广州阿里巴巴文学信息技术有限公司 Isolated data management method, device, system, computing device and storage medium
CN109614226A (en) * 2018-11-20 2019-04-12 武汉烽火信息集成技术有限公司 A kind of stateful application memory management method based on Kubernetes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Stateful Container Migration employing Checkpoint-based Restoration for Orchestrated Container Clusters";SeungYong Oh等;《2018 International Conference on Information and Communication Technology Convergence (ICTC)》;20181119;第25-30页 *
"基于Docker容器的云平台设计与实现";李灿彬 等;《科技广场》;20170630(第6期);第38-41页 *

Also Published As

Publication number Publication date
CN110413381A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
Akkus et al. {SAND}: Towards {High-Performance} serverless computing
US9934073B2 (en) Extension of resource constraints for service-defined containers
US9336042B1 (en) Performing virtual machine live migration within a threshold time by adding available network path in multipath network
US9256463B2 (en) Method and apparatus to replicate stateful virtual machines between clouds
US8775696B2 (en) Storage area network access for virtual machines
US8671403B2 (en) Pre-creating virtual machines in a grid environment
US8352938B2 (en) System, method and program to migrate a virtual machine
ES2734248T3 (en) Procedure to fork or migrate a virtual machine
US10263907B2 (en) Managing virtual network ports
US9244710B2 (en) Concurrent hypervisor replacement
KR20040028805A (en) System for Yielding to a Processor
WO2019060228A1 (en) Systems and methods for instantiating services on top of services
US11334372B2 (en) Distributed job manager for stateful microservices
US10671438B2 (en) Providing additional memory and cache for the execution of critical tasks by folding processing units of a processor complex
US11113075B2 (en) Launching a middleware-based application
US10467078B2 (en) Crash dump extraction of guest failure
JP2023057535A (en) Computer installation method, system, and computer program (dynamic scaling for workload execution)
CN110413381B (en) Method and apparatus for containerizing application services
US20230115261A1 (en) Migrating stateful workloads between container clusters with different storage backends
US10102024B2 (en) System and methods to create virtual machines with affinity rules and services asymmetry
CN111782335A (en) Extended application mechanism through in-process operating system
CN116028163A (en) Method, device and storage medium for scheduling dynamic link library of container group
US20210067599A1 (en) Cloud resource marketplace
US20220318044A1 (en) Load balancing virtual computing instances associated with virtual graphics processing units
US11086686B2 (en) Dynamic logical partition provisioning

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