Container system
The container system addresses the challenge of automatically changing container settings during errors by utilizing a container setting change unit that references log information, ensuring stable and efficient operation.
Patent Information
- Application Number
- JP2023205757
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-18
AI Technical Summary
Current container systems face challenges in automatically and appropriately changing container settings when errors occur, often leading to repeated restarts due to incorrect settings.
A container system that includes a container management unit, a container execution unit, a log storage unit, and a container setting change unit, which automatically changes container settings based on log information when an error occurs, ensuring appropriate operation.
The system enables automatic and appropriate changes to container settings during errors, preventing repeated restarts and ensuring stable operation without manual intervention.
Smart Images

Figure 2025090892000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technique for dealing with errors or abnormalities occurring on a container.
Background Art
[0002] Recently, the development and utilization of application management technologies using virtualized containers have been actively carried out. A container can place one or more execution environments on one OS (Operating System). Also, many containers have a function of automatically recovering when an application running on the container stops or abnormally terminates. In addition, a method for estimating the optimal placement of virtual machines / containers for a server selected based on priority has been proposed (for example, Patent Document 1).
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] As described above, when an application running on a container stops or abnormally terminates, automatic recovery processing is performed. However, if the recovery processing is performed with incorrect container settings, the restart procedure may be repeated due to the occurrence of an error. For this reason, currently, when an application running on a container stops or abnormally terminates, in many cases, the user or administrator manually changes the container settings.
[0005] An object related to one aspect of the present invention is to provide a method for automatically and appropriately changing the settings of a container when an error occurs on the container.
Means for Solving the Problems
[0006] A container system according to one aspect of the present invention includes a container capable of executing an application, a container management unit that manages setting information related to the settings of the container, a container execution unit that operates the container according to the setting information, a log storage unit that stores log information representing events occurring in the container, and a container setting change unit that changes the setting information with reference to the log information when an error occurs on the container. The container execution unit operates the container based on the setting information changed by the container setting change unit.
Effect of the Invention
[0007] According to the above aspect, when an error occurs on the container, the settings of the container are automatically and appropriately changed.
Brief Description of the Drawings
[0008]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Embodiments for Carrying Out the Invention
[0009] FIG. 1 shows an example of the functional configuration of a container system according to an embodiment of the present invention. The container system 1 according to the embodiment of the present invention includes an application execution platform 10, a log management platform 20, and an application management platform 30. Note that the container system 1 may further include other functions not shown in FIG. 1.
[0010] The application execution platform 10 includes a plurality of containers 11 (11a to 11n) and a container execution unit 12. Each container 11 provides a virtual execution environment on a common OS for the plurality of containers 11. Hardware resources are allocated to each container 11. Specifically, at least processor resources and memory resources are allocated to each container 11. Then, the container 11 executes one or more applications using the allocated hardware resources. At this time, each container 11 creates log information representing events occurring in its own container. The log information is created, for example, periodically. Also, the log information may be created when an unexpected event such as the occurrence of an error occurs.
[0011] The container execution unit 12 deploys the container 11 according to the setting information given from the application management platform 30. For example, the container execution unit 12 allocates the hardware resources specified by the setting information to the corresponding container 11. Also, the container execution unit 12 causes the application specified by the setting information to be executed in the corresponding container 11.
[0012] The log management platform 20 includes a log storage unit 21. The log information created by each container 11 is stored in the log storage unit 21 in chronological order. Also, it is preferable that the log information is stored for each container 11.
[0013] The application management infrastructure 30 includes a container management unit 31 and a container setting change unit 32. The container management unit 31 manages setting information related to the settings of the container 11. The setting information is created for each container by the user of the container system 1, for example. Also, the setting information includes, for example, the following information. (1) Image (2) Port (3) CPU (4) Memory (5) Number of replicas (6) User authority
[0014] The image represents the image of the application executed on the container 11. The port represents the port used by the application. The CPU represents the upper limit of the CPU usage amount used by (or allocated to) the container 11. The memory represents the upper limit of the memory usage amount used by (or allocated to) the container 11. The number of replicas represents the number of replicas of the application. The user authority represents commands and the like that can be used by the user.
[0015] The container management unit 31 provides the setting information created for each container 11 to the container execution unit 12. As a result, the container 11 operates according to the setting information. For example, when the setting information of the container 11a represents "Memory: 200Mi" and the setting information of the container 11b represents "Memory: 500Mi", the container execution unit 12 allocates 200Mi of memory resources to the container 11a and 500Mi of memory resources to the container 11b.
[0016] The container setting change unit 32 can change the setting information managed by the container management unit 31. In this embodiment, when an application operating on the container 11 abnormally terminates, the container setting change unit 32 refers to the log information stored in the log storage unit 21 and changes the corresponding setting information. For example, when an application operating in the container 11a abnormally terminates, the container setting change unit 32 refers to the log information related to the container 11a and changes the setting information of the container 11a.
[0017] FIG. 2 shows an example of a hierarchical model of the container system 1. The container system 1 is composed of hardware resources 41, an OS 42, a container engine 43, and containers 11 (11a to 11n) for providing a plurality of execution environments. The hardware resources 41 correspond to a CPU and a memory prepared to realize the container system 1. Here, the hardware resources 41 include a plurality of CPU cores (or a plurality of processor cores). Also, the hardware resources 41 may include a plurality of memory devices. The OS 42 is not particularly limited, and any OS can be adopted. The container engine 43 is provided between the OS 42 and the container 11 and corresponds to the container management unit 31, the container setting change unit 32, and the container execution unit 12. Also, the container engine 43 includes an interface for accessing the log storage unit 21.
[0018] One or more applications to be executed are provided to the container 11. Also, the container 11 preferably includes various libraries.
[0019] Container 11 is equipped with a monitoring function for monitoring the state (stopped, starting, running, abnormal, etc.) of the applications operating on itself. Also, container 11 is equipped with a logging function. That is, container 11 creates log information representing the events occurring in itself by utilizing the monitoring function and the logging function. The log information is created, for example, periodically. Alternatively, the log information may be created when an unexpected event such as an abnormal termination of the application occurs. Furthermore, container 11 is equipped with a communication function. That is, container 11 receives instructions or settings from container engine 43. Also, container 11 transmits the created log information to log storage unit 21.
[0020] Figure 3 shows an example of the operation sequence of container system 1. In the embodiment shown in Figure 3, one container 11 is depicted, but actually, a plurality of containers 11a to 11n operate individually. Also, it is assumed that setting information related to the settings of each container 11 is created in advance and managed by container management unit 31.
[0021] First, container management unit 31 transmits the setting information of container 11 to container execution unit 12. The setting information includes information representing, for example, an image, a port, a CPU, a memory, the number of replicas, user authority, etc., as described above. Container execution unit 12 deploys container 11 according to the setting information given from container management unit 31. For example, container execution unit 12 allocates the hardware resources specified by the setting information to container 11.
[0022] Container 11 monitors the state of the application installed in itself using a monitoring function. At this time, the monitoring function may periodically send a survival confirmation signal to the application running on the container, and determine whether the application is operating normally based on the presence or absence of a reply. Then, container 11 periodically creates status information representing the state of the application and sends it to the container management unit 31. Here, the status information includes, for example, time information and information representing the state of the application (stopped, starting, running, abnormal, etc.). Therefore, the container management unit 31 can detect the state of the application installed in container 11. For example, when an error occurs in the application installed in container 11, the container management unit 31 can detect the error based on the status information.
[0023] In addition, container 11 periodically creates log information and sends it to the log storage unit 21. Additionally, when an unexpected event (for example, an error such as abnormal termination of an application) occurs, container 11 sends log information representing the event to the log storage unit 21. Then, the log storage unit 21 stores the log information received from container 11 in chronological order.
[0024] Note that it is preferable that the transmission of status information from container 11 to the container management unit 31 and the transmission of log information from container 11 to the log storage unit 21 are synchronized with each other. However, these operations do not necessarily have to be synchronized with each other.
[0025] In this way, in the container system 1, according to the setting information, the application specified on container 11 is executed. And the log information of each container 11 is stored in the log storage unit 21 in chronological order.
[0026] Figure 4 shows an example of the operation sequence of the container system 1 when an error occurs on the container. In this embodiment, it is assumed that an error occurs and the application terminates abnormally while the application is running on container 11.
[0027] When the container 11 detects an abnormal termination of the application, it notifies the container management unit 31 to that effect using the status information. At this time, the status information includes information indicating that the application has terminated abnormally and information indicating the time when the application has terminated abnormally. In addition, the container 11 creates log information related to the abnormal termination of the application and transmits it to the log management infrastructure 20. Then, the log management infrastructure 20 stores the log information received from the container 11 in the log storage unit 21. The log information includes, in addition to information indicating the time when the application has terminated abnormally, at least an error log related to the cause of the abnormal termination of the application.
[0028] FIG. 5 shows an example of the log information. In this embodiment, as the log information, information for identifying the container 11 in which an error has occurred, information for identifying the abnormally terminated application, the port number, an error log related to the cause of the abnormal termination (Reason: CrashLoopBackOff), etc. are described.
[0029] When the container management unit 31 receives status information indicating an abnormal termination of the application, it transmits error information to the container setting change unit 32. The error information is generated based on the status information received from the container 11 and includes information for identifying the container in which the error has occurred and information indicating the time when the error has occurred. Note that the information for identifying the container in which the error has occurred is specified by the container management unit 31 detecting the source of the status information.
[0030] When receiving the error information from the container management unit 31, the container setting change unit 32 refers to and searches for the log information stored in the log storage unit 21 using the error information. Specifically, the container setting change unit 32 searches for the log information related to the "container in which the error has occurred" in the time zone near the "time when the error has occurred". Thereby, the container setting change unit 32 acquires the log information related to the abnormal termination of the application.
[0031] Subsequently, based on the acquired log information, the container setting change unit 32 determines countermeasures against the abnormal termination of the application. Here, the container setting change unit 32 holds setting change management information in which countermeasures for eliminating the error related to the error log are set in association with the error log that can be described in the log information. Then, the container setting change unit 32 uses this setting change management information to determine countermeasures against the abnormal termination of the application.
[0032] FIG. 6 shows an example of the setting change management information. In this embodiment, the setting change management information describes the cause and countermeasures of the error for the error log. The countermeasure represents a method for eliminating the occurred error, and specifically, it represents how to change the setting information of the container to eliminate the occurred error. For example, it is described that the cause of "OOM (Out of Memory) Killed" is "insufficient memory required to run the container", and the countermeasure is "increase the memory capacity allocated to the container by 1GB". Note that the setting change management information is assumed to be created in advance by, for example, the user or administrator of the container system 1.
[0033] Therefore, the container setting change unit 32 can determine countermeasures against the abnormal termination of the application by searching the log information acquired using the error information. For example, when the error log "OOMKilled" is searched from the acquired log information, the container setting change unit 32 determines that the countermeasure for eliminating the occurred error is "increase the memory capacity allocated to the container by 1GB".
[0034] In addition, the container management unit 31 transmits the setting information of the container 11 in which the error occurred to the container setting change unit 32. In the embodiment shown in FIG. 4, the error information and the setting information are transmitted individually, but the embodiment of the present invention is not limited to this procedure. That is, the container management unit 31 may transmit the error information related to the occurred error and the setting information of the container 11 in which the error occurred to the container setting change unit 32 together.
[0035] The container setting change unit 32 changes the content of the setting information received from the container management unit 31 according to the countermeasure determined using the log information. Then, the container setting change unit 32 transmits the changed setting information to the container management unit 31.
[0036] FIGS. 7 to 8 show an example of the change information. Specifically, FIG. 7 shows an example of the setting information before the change, which is transmitted from the container management unit 31 to the container setting change unit 32. Further, FIG. 8 shows an example of the setting information after the change, which is transmitted from the container setting change unit 32 to the container management unit 31.
[0037] As shown in FIG. 7, the change information includes information related to user authority, information related to an image, and information related to memory / CPU, as information that can be changed by the container setting change unit 32. The information related to user authority represents commands that can be used by the users of the container system 1. The information related to an image represents the application image to be executed on the container 11. The information related to memory / CPU represents the capacity of the memory allocated to the container 11 and the number of CPU cores allocated to the container 11.
[0038] In this embodiment, for example, it is assumed that the error log "OOMKilled" is searched from the log information corresponding to the container 11 in which an error has occurred. Here, as described above, the countermeasure corresponding to this error log is to "increase the memory capacity allocated to the container by 1GB". Therefore, in this case, the container setting change unit 32 changes the description related to the memory in the setting information. Specifically, as shown in FIG. 8, the upper limit value of the memory is rewritten from "200Mi" to "1200Mi". Then, the container setting change unit 32 transmits the setting information with the content changed to the container management unit 31. At this time, the container setting change unit 32 may transmit a container execution command to the container management unit 31 together with the changed setting information.
[0039] The container management unit 31 provides the container execution unit 12 with the setting information whose content has been changed by the container setting change unit 32, and instructs the execution of the container 11. Then, the container execution unit 12 redeploys (or restarts) the container 11 according to the changed setting information. And the container 11 operates according to the changed setting information.
[0040] In the example shown in FIGS. 7 to 8, in the setting information of the container 11, the upper limit value of the memory has been increased from 200 Mi to 1200 Mi. Therefore, the container execution unit 12 increases the memory capacity allocated to the container 11 according to this setting information. And the container 11 executes the application with the increased memory capacity. Thus, a situation where an error occurs due to insufficient memory is avoided.
[0041] As described above, in the container system 1 according to the embodiment of the present invention, when an error occurs in the container 11 and the application abnormally terminates, the cause of the error is identified, and a countermeasure for eliminating the error is determined. Then, the setting information of the container 11 in which the error has occurred is changed according to the determined countermeasure, and is redeployed according to the changed setting information. Therefore, a situation where the same error is repeated in the container 11 is avoided.
[0042] FIG. 9 is a flowchart showing an example of the processing of the container management unit 31. In this embodiment, it is assumed that setting information related to the setting of the container 11 has been created.
[0043] In S1, the container management unit 31 transmits the setting information of the container 11 to the container execution unit 12. Thereby, the container execution unit 12 deploys the container 11, and the container 11 executes the installed application.
[0044] In S2, the container management unit 31 monitors the status information transmitted from the container 11. When receiving status information indicating that an error such as an abnormal termination of the application has occurred, the process of the container management unit 31 proceeds to S3.
[0045] In S3, the container management unit 31 transmits error information indicating that an error has occurred in the container 11 to the container setting change unit 32. The error information includes information for identifying the container 11 in which the error has occurred. Also, in S4, the container management unit 31 transmits the setting information of the container 11 in which the error has occurred to the container setting change unit 32. Note that the container management unit 31 may execute S3 and S4 simultaneously. After that, the container management unit 31 waits for a reply from the container setting change unit 32.
[0046] In S5, the container management unit 31 receives the setting information of the container 11 whose content has been changed by the container setting change unit 32. Then, in S6, the container management unit 31 transmits the changed setting information to the container execution unit 12. Thereby, the container execution unit 12 redeploys the container 11 based on the changed setting information.
[0047] FIG. 10 is a flowchart showing an example of the process of the container setting change unit 32. In S11, the container setting change unit 32 monitors for the transmission of error information from the container management unit 31. When receiving the error information from the container management unit 31, the process of the container setting change unit 32 proceeds to S12. Note that the container setting change unit 32 is assumed to receive the setting information of the container 11 in which the error has occurred together with the error information. Alternatively, the container setting change unit 32 is assumed to receive the setting information of the container 11 in which the error has occurred after receiving the error information.
[0048] In S12 to S13, the container setting change unit 32 refers to the log information stored in the log storage unit 21 based on the error information. At this time, the container setting change unit 32 searches for an error log related to the container 11 specified by the error information (that is, the container 11 in which the error has occurred).
[0049] In S14, the container setting change unit 32 identifies the cause of the error corresponding to the error log searched in S13 and determines a measure for eliminating the error. At this time, the container setting change unit 32 refers to the setting change management information created in advance (for example, the setting change management information shown in FIG. 6).
[0050] In S15, the container setting change unit 32 changes the setting information of the container 11 in which the error has occurred according to the measure determined in S14. At this time, the container setting change unit 32 changes the setting information so that, for example, the upper limit of the memory / CPU resources allocated to the container 11 increases. Alternatively, the container setting change unit 32 changes the setting information so that the authority of the user of the container system 1 is added.
[0051] In S16, the container setting change unit 32 transmits the changed setting information to the container management unit 31. The container management unit 31 receives the changed setting information in S5 shown in FIG. 9. Therefore, the container 11 will be redeployed based on the setting information whose content has been changed by the container setting change unit 32.
[0052] <Variation> In the above-described embodiment, the container 11 monitors the state of the application, and when an error such as an abnormal termination of the application occurs, the state information is notified from the container 11 to the container management unit 31. However, the embodiment of the present invention is not limited to this configuration. For example, the container management unit 31 may monitor the state of the container 11. In this case, the container management unit 31 may periodically transmit a survival confirmation signal to each container 11 and determine whether each container 11 is operating normally based on the presence or absence of the reply.
[0053] In the above embodiment, the error information notified from the container management unit 31 to the container setting change unit 32 includes information representing the time when the error occurred, but the embodiment of the present invention is not limited to this configuration. For example, the container setting change unit 32 that receives the error information may search for un-searched log information to extract an error log corresponding to the new error. When log information is recorded for each container, the un-searched log information may be searched among the log information related to the container 11 specified by the error information (i.e., the container 11 in which the error occurred).
[0054] <Hardware Configuration> FIG. 11 shows an example of the hardware configuration of the container system 1. The container system 1 is realized by a computer 200 including a processor 201, a memory 202, a storage device 203, an input / output device 204, a recording medium reader 205, and a communication interface 206.
[0055] The processor 201 includes a plurality of processor cores and controls the operation of the container system 1 by executing the container management program stored in the storage device 203. The container management program includes program codes describing the procedures of the flowcharts shown in FIGS. 9 to 10. Therefore, when the processor 201 executes this program, the functions of the container execution unit 12, the container management unit 31, and the container setting change unit 32 shown in FIG. 1 are provided. Also, a part of the plurality of processor cores constituting the processor 201 is allocated to realize the container 11.
[0056] The memory 202 is used as a working area for the processor 201. Also, a part of the memory 202 is allocated to realize the container 11. The storage device 203 stores the container management program and other programs. Note that the log storage unit 21 is realized by using the storage device 203.
[0057] The input / output device 204 includes input devices such as a keyboard, a mouse, a touch panel, and a microphone. Also, the input / output device 204 includes output devices such as a display device and a speaker. The recording medium reader 205 can acquire data and information recorded on the recording medium 210. The recording medium 210 is a removable recording medium detachable from the computer 200. Also, the recording medium 210 is realized by, for example, a semiconductor memory, a medium that records signals by optical action, or a medium that records signals by magnetic action. Note that the container management program may be provided from the recording medium 210 to the computer 200. The communication interface 206 provides a function of connecting to a network. Note that when the container management program is stored in the program server 220, the computer 200 may acquire the container management program from the program server 220.
Explanation of Signs
[0058] 1 Container system 10 Application execution platform 11(11a~11n) Container 12 Container execution unit 20 Log management platform 21 Log storage unit 30 Application management platform 31 Container management unit 32 Container setting change unit
Claims
1. A container capable of executing an application, A container management unit that manages setting information related to the settings of the container, A container execution unit that operates the container according to the setting information, A log storage unit that stores log information representing events occurring in the container, A container setting change unit that changes the setting information with reference to the log information when an error occurs on the container, and the container execution unit operates the container based on the setting information changed by the container setting change unit A container system characterized by the above.
2. The container setting change unit Identifies the cause of an error occurring on the container by referring to the log information, Changes the setting information according to the identified cause The container system according to claim 1, characterized by the above.
3. The container setting change unit holds setting change management information in which measures for resolving an error related to the error log are set in association with the error log that can be described in the log information, The container setting change unit Identifies an error log corresponding to an error occurring on the container by searching the log information, Determines a measure corresponding to the identified error log by referring to the setting change management information, Changes the setting information according to the determined measure The container system according to claim 1, characterized by the above.
4. When the application operating on the container terminates abnormally, the container outputs state information indicating that an error has occurred in the container, and stores log information including an error log representing the content of the error occurring in the container in the log storage unit, The container setting change unit identifies an error log corresponding to an error that occurred on the container by searching the log information in response to the output of the state information. The container system according to claim 3, characterized in that.
5. The setting information describes the hardware resources to be allocated to the container. The container setting change unit changes the setting information so that the amount of hardware resources allocated to the container increases. The container system according to claim 1, characterized in that.
Citation Information
Patent Citations
Resource assignment update device, resource assignment update method, program, and virtual machine / container control system
WO2022172385A1