CONTAINER MANAGEMENT METHOD AND CONTAINER MANAGEMENT PROGRAM
Containers in a multi-cluster environment monitor each other to quickly identify and address failures, enhancing system reliability and availability by reducing detection time and service interruptions.
Patent Information
- Application Number
- JP2021029244
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-25
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2041-02-25
AI Technical Summary
In multi-cluster container configurations, identifying and detecting failures quickly is challenging due to the inability of the master scheduler to directly monitor individual clusters, leading to delayed fault detection and reduced system reliability.
Containers within the same group across clusters perform mutual monitoring and failover, allowing early detection and swift response to failures without needing master scheduler intervention.
This approach enables rapid failure detection and handling, improving system availability and reliability by minimizing downtime and service disruptions.
Smart Images

Figure 0007552433000016 
Figure 0007552433000008 
Figure 0007552433000011
Abstract
Description
[Technical field]
[0001] The present invention relates to a container management method and a container management program. [Background technology]
[0002] In recent years, systems that operate containers using platforms (hereinafter sometimes referred to as "container platforms") that manage a large number of container applications (hereinafter sometimes referred to as "containers"), such as Kubernetes (registered trademark), have been used. In such systems, a scheduler monitors the life and death of containers, and if a container stops due to a failure, another container is generated and operated, thereby improving the availability of the system. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2019-149192 A Summary of the Invention [Problem to be solved by the invention]
[0004] Incidentally, a multi-cluster configuration using containers can be considered to further increase the availability of the system. To manage multiple clusters, a master scheduler is deployed in a specific cluster (master cluster), and a scheduler is deployed in each cluster. The master scheduler then manages the schedulers in each cluster, and the schedulers in each cluster execute and manage containers.
[0005] When a failure occurs in such a multi-cluster configuration, the location of the failure cannot be identified, and the failure cannot be detected early. For example, when a failure occurs in an entire cluster, the scheduler of that cluster cannot handle it, so the master scheduler must fail over all containers on that cluster to another cluster. However, since the master scheduler cannot directly monitor each container, it monitors the schedulers in each cluster, but it cannot distinguish whether the failure is in only the scheduler of each cluster or in the entire cluster. As a result, it takes a long time to identify the location of the failure, which slows down failure detection and reduces the reliability of the system.
[0006] In one aspect, an object of the present invention is to provide a container management method and a container management program that can realize early handling of failures in a multi-cluster environment. [Means for solving the problem]
[0007] In a first proposal, in a container management method executed in a container system in which containers are distributed across a plurality of clusters, a first container deployed in a first cluster: The system is characterized in that it performs status monitoring of a second container deployed in a second cluster different from the first cluster, and instructs a third cluster different from the second cluster to execute a failover of the second container depending on the result of the status monitoring. Effect of the Invention
[0008] According to one embodiment, it is possible to realize early response to failures in a multi-cluster environment. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram illustrating an example of an overall configuration of a container system according to a first embodiment. [Diagram 2] FIG. 2 is a diagram illustrating the mutual monitoring of the container systems according to the first embodiment. [Diagram 3] FIG. 3 is a diagram illustrating an example of how to handle a failure in the container system according to the first embodiment. [Figure 4] FIG. 4 is a diagram illustrating an example of an overall configuration of each cluster according to the second embodiment. [Diagram 5] FIG. 5 is a functional block diagram of the master server and the cluster server according to the second embodiment. [Figure 6] FIG. 6 is a diagram illustrating an example of information stored in the operation information management DB. [Figure 7] FIG. 7 illustrates an example of information stored in the failover destination DB. [Figure 8] FIG. 8 is a diagram illustrating a functional configuration of each container in the container system according to the second embodiment. [Figure 9] FIG. 9 is a diagram illustrating an example of information stored in the container information management table. [Figure 10] FIG. 10 is a diagram for explaining monitoring between containers. [Figure 11] FIG. 11 is a diagram for explaining failure detection. [Figure 12] FIG. 12 is a diagram illustrating a failover. [Figure 13] FIG. 13 is a diagram for explaining collection of operation information after a failover. [Figure 14] FIG. 14 is a flowchart of the failover process according to the second embodiment. [Figure 15] FIG. 15 is a flowchart illustrating a flow when performance degradation occurs due to a delay after a failover process according to the third embodiment. [Figure 16] FIG. 16 is a flowchart illustrating a flow of processing at the time of performance degradation due to degeneration after failover processing according to the fourth embodiment. [Figure 17] FIG. 17 is a flowchart showing the flow of a process for identifying a failover destination based on the number of overlapping clusters. [Figure 18] FIG. 18 is a flowchart showing the flow of the process of specifying the failover destination based on the number of non-overlapping clusters. [Figure 19] FIG. 19 is a flowchart showing the flow of a process for identifying a failover destination based on the amount of communication delay. [Figure 20] FIG. 20 is a diagram illustrating an example of a hardware configuration. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the container management method and container management program disclosed in the present application will be described in detail with reference to the drawings. Note that the present invention is not limited to the embodiment. Furthermore, each embodiment can be appropriately combined within a range that does not cause inconsistency. EXAMPLES
[0011] [Overall configuration] FIG. 1 is a diagram illustrating an example of the overall configuration of a container system according to a first embodiment. As illustrated in FIG. 1, the container system according to the first embodiment is configured with a multi-cluster provided by a plurality of physical servers and virtual machines (VMs) operating on the physical servers. In the example of FIG. 1, an example is illustrated in which five clustering systems, cluster 1 to cluster 5, are executed. Each cluster is provided by one or more physical servers or one or more VMs, and each cluster is provided by a different physical server or VM. In addition, in the container system, containers are executed using Kubernetes (registered trademark) as an example.
[0012] As shown in Fig. 1, a master scheduler, container A1, and container C1 are deployed in cluster 1. A scheduler, container A2, container B2, and container C2 are deployed in cluster 2, a scheduler, and container B3 are deployed in cluster 3. A scheduler, container A4, container B4, and container C4 are deployed in cluster 4, and a scheduler, container B5, and container C5 are deployed in cluster 5.
[0013] The master scheduler receives data from each scheduler, manages the alive monitoring of each cluster and the results of the alive monitoring of the clusters monitored by the scheduler, and controls the clusters and containers. In the conventional Kubernetes (registered trademark), the master scheduler cannot directly manage each container of each cluster. Therefore, when the master scheduler detects an abnormality in the scheduler of a certain cluster, it cannot identify whether the abnormality is in the certain cluster, the container in the certain cluster, or the scheduler in the certain cluster, and it is necessary to fail over all containers in the certain cluster.
[0014] Each scheduler controls the containers in each cluster. For example, each scheduler manages the operating status of containers in the same cluster and notifies the master scheduler of alive / dead information. The master scheduler performs alive / dead monitoring between the schedulers of each container and manages the alive / dead status of each cluster and the operating status of the containers in each cluster.
[0015] Each container forms a container group with containers of the same type, and executes various services in cooperation with one or more containers of the same type. For example, container A1, container A2, and container A3 belong to container group A that provides the same service, and are in a replica relationship with each other. Container B2, container B3, container B4, and container B5 belong to container group B that provides the same service, and are in a replica relationship with each other. Container C1, container C2, container C4, and container C5 belong to container group C that provides the same service, and are in a replica relationship with each other. In this way, since containers that belong to the same container group always cooperate with each other, there is an effect that it is not necessary to newly set a connection for communication for the present invention.
[0016] In addition, within each cluster, the image data of each container is shared, and each scheduler can stop containers that are running (operating) within the same cluster or deploy any container.
[0017] In such a configuration, each container performs mutual monitoring of other containers belonging to the same container group. Fig. 2 is a diagram for explaining mutual monitoring of the container system according to the first embodiment. As shown in Fig. 2, for example, container A1 of cluster 1 performs alive monitoring of container A2 of cluster 2 and container A4 of cluster 4, container A1 of cluster 2 performs alive monitoring of container A1 of cluster 1 and container A4 of cluster 4, and container A4 of cluster 4 performs alive monitoring of container A2 of cluster 2 and container A1 of cluster 1.
[0018] When each container detects a failure in another container, it fails over the container in which the failure was detected to a cluster in normal operation including the cluster in which the container itself is operating. Fig. 3 is a diagram for explaining an example of how to handle a failure in the container system according to the first embodiment. As shown in Fig. 3, when container A4 in cluster 4 detects a failure in container A2 in cluster A2, it outputs an instruction to the scheduler which is its own cluster 4 to fail over container A2 to cluster 4.
[0019] In this way, the container system can achieve early detection of failures even if a failure occurs that affects the entire cluster and the scheduler in that cluster is unable to detect or deal with the failure, because containers in other clusters can detect the failure. EXAMPLES
[0020] In this embodiment, in order to simplify the explanation, an example will be explained in which one physical server executes one cluster, but the configuration method, format, and the like are not limited to this.
[0021] Fig. 4 is a diagram showing an example of the overall configuration of each cluster according to the embodiment 2. As shown in Fig. 4, a master server 100 operates a cluster 1, a cluster server 200 operates a cluster 2, a cluster server 300 operates a cluster 3, a cluster server 400 operates a cluster 4, and a cluster server 500 operates a cluster 5. Note that the containers and the like operating in each cluster are the same as those in the embodiment 1, and therefore detailed explanations will be omitted.
[0022] In such a configuration, the master server and each cluster server perform status monitoring of a first container that is deployed within the same cluster and a second container that is deployed in a second cluster different from the first cluster, and operate the first container to instruct the second cluster to execute a failover of the second container depending on the results of the status monitoring.
[0023] In other words, each container operating in each cluster can monitor the alive status of containers in the same container group across clusters, and when a stopped container is detected, the stopped container can be failed over to another cluster. As a result, even if a failure that affects the entire cluster occurs and the scheduler in the cluster cannot detect or deal with the failure, the container system can detect the failure in the other cluster, so that early detection of the failure can be realized.
[0024] [Container system functional configuration] Next, the functional configuration of each server constituting the container system will be described. Since each cluster server has the same configuration, only the cluster server 200 will be described. Fig. 5 is a functional block diagram showing the functional configuration of the master server and the cluster server according to the second embodiment.
[0025] (Master server functional configuration) As shown in FIG. 5, the master server 100 includes a communication unit 101, a storage unit 102, and a control unit 110.
[0026] The communication unit 101 is a processing unit that controls communication with other devices, and is realized by, for example, a communication interface, etc. For example, the communication unit 101 controls communication between the master server 100 and each of the other cluster servers, thereby transmitting and receiving various data between the cluster 1 and the other clusters.
[0027] The storage unit 102 is an example of a storage device that stores various data and programs executed by the control unit 110, and is realized by, for example, a memory or a hard disk. The storage unit 102 stores an image file DB 103 and an operation information management DB 104 as data accessible by the master scheduler and each container operating in the cluster 1.
[0028] The image file DB 103 is a database that stores image files of each container. For example, the image file DB 103 stores, for each container, an image file that includes information that can start the container. Note that this image file is held in common by each cluster in the container system.
[0029] The operation information management DB 104 is a database that stores operation information of each container deployed in the container system. Fig. 6 is a diagram showing an example of information stored in the operation information management DB 104. As shown in Fig. 6, the operation information management DB 104 stores "cluster ID, container ID, resource usage rate, service time, and failover".
[0030] The "cluster ID" stored here is an identifier for identifying each cluster, and the "container ID" is an identifier for identifying each container. "Resource utilization" is the utilization rate of each resource, such as the processor, memory, and hardware, used by the container. For example, "resource utilization" may be a percentage indicating how much of the hardware resources allocated to the container are currently in use, or a percentage indicating how much of the resources in the cluster are currently in use by the container. "Service time" is the duration of the service provided by the container. "Failover" is information identifying whether or not a container has been failed over.
[0031] In the example of Fig. 6, container A1 operating in cluster 1 indicates that its resource usage rate is 80% and its service time is 10 ms. Container B1 operating in cluster 1 is a failed-over container, and indicates that its resource usage rate is 65% and its service time is 4 ms. Note that the operation information management DB 104 is installed in the master server 100 so as to be accessible from each container of the other cluster servers. Also, the operation information management DB 104 may be provided in a shared DB server in the container system.
[0032] The control unit 110 is a processing unit that controls the entire master server 100, and is realized by, for example, a processor. For example, the control unit 110 has a cluster execution unit 111, a schedule execution unit 112, and a container execution unit 113. Note that the cluster execution unit 111, the schedule execution unit 112, and the container execution unit 113 are realized by electronic circuits included in the processor, processes executed by the processor, and the like.
[0033] The cluster execution unit 111 is a processing unit that provides a cluster environment using hardware resources such as a processor and memory in the master server 100. For example, the cluster execution unit 111 provides a cluster 1 using a known clustering system.
[0034] The schedule execution unit 112 is a processing unit that executes a master scheduler in the cluster 1 provided by the cluster execution unit 111. For example, the schedule execution unit 112 executes a master scheduler in the cluster 1 having a function to be described later.
[0035] The container execution unit 113 is a processing unit that executes containers in the cluster 1 provided by the cluster execution unit 111. For example, the container execution unit 113 executes a container A1 and a container C1 having functions to be described later in the cluster 1 according to instructions from the master scheduler.
[0036] (Cluster server functional configuration) As shown in FIG. 5, the cluster server 200 includes a communication unit 201, a storage unit 202, and a control unit 210.
[0037] The communication unit 201 is a processing unit that controls communication with other devices, and is realized by, for example, a communication interface, etc. For example, the communication unit 201 controls communication between the cluster server 200 and each of the other cluster servers, and communication between the cluster server 200 and the master server 100, thereby transmitting and receiving various data between the cluster 2 and the other clusters.
[0038] The storage unit 202 is an example of a storage device that stores various data and programs executed by the control unit 210, and is realized by, for example, a memory or a hard disk. The storage unit 202 stores an image file DB 203 and a failover destination DB 204 as data accessible by the scheduler and each container operating in the cluster 2.
[0039] The image file DB 203 is a database that stores the image files of each container. The information stored here is the same as that of the image file DB 103 of the master server 100.
[0040] The failover destination DB 204 is a database that stores the failover destination of each container group. Fig. 7 is a diagram showing an example of information stored in the failover destination DB 204. As shown in Fig. 7, the failover destination DB 204 stores "container group, failover destination".
[0041] The "container group" stored here indicates the container group to be failed over, and the "failover destination" indicates the cluster specified as the failover destination. In the example of Fig. 7, container group B is selected as the failover destination for each container belonging to container group A, and cluster 3 is set as the failover destination among the clusters in which container Bn of container group B is deployed.
[0042] The failover destination is determined by the control unit 210. For example, the control unit 210 selects a group for a given container group (target group) that has two or more overlaps in the deployment destination cluster and has the largest number of non-overlapping replicas. Then, the control unit 210 determines, as the failover destination for the target group, the cluster in the selected group that has the smallest average communication delay from each container in the target group, excluding the overlapping replicas.
[0043] The control unit 210 is a processing unit that controls the entire cluster server 200, and is realized by, for example, a processor. For example, the control unit 210 has a cluster execution unit 211, a schedule execution unit 212, and a container execution unit 213. Note that the cluster execution unit 211, the schedule execution unit 212, and the container execution unit 213 are realized by electronic circuits included in the processor, processes executed by the processor, and the like.
[0044] The cluster execution unit 211 is a processing unit that provides a cluster environment using hardware resources such as a processor and memory in the cluster server 200. For example, the cluster execution unit 211 provides a cluster 2 using a known clustering system.
[0045] The schedule execution unit 212 is a processing unit that executes a scheduler in the cluster 2 provided by the cluster execution unit 211. For example, the schedule execution unit 212 executes a scheduler having a function to be described later in the cluster 2.
[0046] The container execution unit 213 is a processing unit that executes containers in the cluster 2 provided by the cluster execution unit 211. For example, the container execution unit 213 executes container A2, container B2, and container C2 having functions to be described later in the cluster 2 according to instructions from a master scheduler or a scheduler.
[0047] [Container features] Next, the functional configuration of each container executed in the container system will be described. Since each container in each cluster server has the same configuration, only the cluster server 200 will be described here. Fig. 8 is a diagram for explaining the functional configuration of each container in the container system according to the second embodiment. Each container executed in each cluster is as shown in Fig. 4.
[0048] (Cluster 1) 4, a master scheduler, a container A1, and a container C1 are executed in cluster 1, but the master scheduler will be described here. Note that container A1 and container C1 have the same configuration as the containers in cluster 2, so detailed description will be omitted here.
[0049] 8, the master scheduler 130 of the cluster 1 includes a live information acquisition unit 131 and an operation information acquisition unit 132. Note that the master scheduler 130 uses information stored in the image file DB 103 within the same cluster 1 to generate each container (starting), operate each container (operating), and stop each container (stopped).
[0050] The alive / dead information acquisition unit 131 is a processing unit that acquires alive / dead information of each cluster and manages the operation state. For example, the alive / dead information acquisition unit 131 periodically monitors each container in the same cluster 1 and manages the alive / dead information.
[0051] Furthermore, the alive / dead information acquisition unit 131 periodically transmits alive / dead confirmation messages to the schedulers of each cluster, and acquires the status of each cluster based on the responses. For example, the alive / dead information acquisition unit 131 transmits an alive / dead confirmation message to the scheduler 230 of cluster 2, and if a response is received, it determines that cluster 2 is operating normally, and if no response is received, it determines that cluster 2 is abnormal. When an abnormality occurs, a function implemented in Kubernetes (registered trademark) is used to recover the cluster or container.
[0052] The operation information acquisition unit 132 is a processing unit that monitors the service status of a container system deployed across multiple clusters. For example, the operation information acquisition unit 132 collects resource usage rates and service times of containers from each scheduler to monitor the service status of the container system.
[0053] (Cluster 2) As shown in FIG. 4, cluster 2 executes a scheduler, container A2, container B2, and container C2. Since each container has a similar configuration, only the scheduler and container A2 will be described here.
[0054] As shown in FIG. 8, the scheduler 230 includes a container information management table 231 , a alive / dead information response unit 232 , a alive / dead information acquisition unit 233 , a container control unit 234 , and a container information acquisition unit 235 .
[0055] The container information management table 231 stores information about each container in the same cluster. Specifically, the container information management table 231 stores information acquired by the scheduler 230 about each container deployed in the cluster 2.
[0056] FIG. 9 is a diagram showing an example of information stored in the container information management table 231. As shown in FIG. 9, the container information management table 231 stores "container ID, alive / dead, status, and fault information." "Container ID" is an identifier for identifying a container. "Alive / dead" is information about the alive / dead status of a container, and is set to "OK" when normal and "NG" when abnormal. "Status" is information indicating the status of a container, and is set to "Running" when it is running, "Creating" when it is starting up and not running but has been created, and "Stop" when it is stopped. "Fault information" indicates the state in which a fault has occurred.
[0057] In the example of Figure 9, containers A2, B2, and C2 are deployed in cluster 2, and container A2 is running, container B2 is not running but is starting up, and container C2 is stopped. Also, container B2 is not providing a service, but a failure of a container belonging to container group A has been detected from another cluster.
[0058] The alive / dead information response unit 232 is a processing unit that checks the alive / dead state of each worker node indicating a container or the like operating in a cluster that it manages and responds. For example, the alive / dead information response unit 232 monitors the alive / dead state of each container in cluster 2, and responds with the alive / dead state of each container in response to a alive / dead confirmation message received from the master scheduler 130.
[0059] The alive / dead information acquisition unit 233 is a processing unit that acquires the alive / dead status of a cluster on a worker node. For example, the alive / dead information acquisition unit 233 periodically transmits an alive / dead confirmation message to each container in the same cluster 2, and acquires the status of each cluster based on the response. Then, the alive / dead information acquisition unit 233 updates the container information management table 231 based on the acquired information.
[0060] The container control unit 234 is a processing unit that executes various processes related to containers, such as starting, stopping, deploying (creating), deleting, etc. on the worker node. In addition, the container control unit 234 executes failover of a container in another cluster and operates the container in cluster 2 according to an instruction from the container information acquisition unit 235, which will be described later, etc.
[0061] The container information acquisition unit 235 is a processing unit that acquires information updated by cooperation between container groups. For example, when a failure of a container in another cluster is detected by the container A2, the container information acquisition unit 235 executes a failover of the container.
[0062] That is, the container information acquisition unit 235 realizes failover of a certain container by requesting the container control unit 234 to deploy and operate the certain container in order to execute the certain container in cluster 2. At this time, the container information acquisition unit 235 updates the container information management table 231.
[0063] Returning to FIG. 8, the container A2 includes a life or death information response unit 241, an operation information registration unit 242, and an inter-group processing unit 243.
[0064] The alive / dead information response unit 241 is a processing unit that confirms the alive / dead state of its own container and responds. For example, the alive / dead information response unit 241 responds to the alive / dead confirmation message received from the alive / dead information acquisition unit 233 with the alive / dead state of the container A2.
[0065] The operation information registration unit 242 is a processing unit that acquires operation information of its own container and updates the operation information management DB 104 in the cluster 1. For example, the operation information registration unit 242 collects resource usage rates and service times of container A4 and directly updates the operation information management DB 104 with the concentrated information, or transmits the collected information to the master scheduler 130 to indirectly update the operation information management DB 104.
[0066] The inter-group processing unit 243 is a processing unit that holds information updated by inter-container group cooperation and executes information exchange between the container groups. For example, the inter-group processing unit 243 transmits and receives monitoring messages between each container of container group A to which container A2 belongs among the containers operating in the container system, and executes mutual alive monitoring.
[0067] Then, when the inter-group processing unit 243 detects that container A4 in cluster 4 has stopped, it executes a failover in accordance with the failover destination in the failover destination DB 204. For example, the inter-group processing unit 243 notifies container B2 in the same cluster 2 that container A4 in cluster 4 has stopped. Then, the inter-group processing unit of container B2 notifies container B3 in cluster 3 that container A4 has stopped. Then, the inter-group processing unit of container B3 notifies the scheduler in cluster 3 that container A4 has stopped, and the scheduler in cluster 3 generates and operates container A4, thereby completing the failover.
[0068] In this way, even if a container abnormality occurs that cannot be detected by the master scheduler 130, the container abnormality can be detected by mutual monitoring across clusters in the same content group. Furthermore, when a container abnormality is detected, the content that detected it notifies the predetermined failover destination, so that the failover can be completed without delay.
[0069] The inter-group processing unit 243 can also detect failure recovery by executing information exchange between container groups. For example, when the inter-group processing unit 243 of the failover destination detects the spread of a failure in the failover source, the scheduler 230 of the failover destination deletes the failed-over container. The scheduler of the failover source also deploys and operates each container before the failure occurred. As a result, the switchback of the container is completed.
[0070] In addition, notification of failure recovery can be detected not only by information exchange between container groups, but also by information exchange between each scheduler, the master scheduler 130 can notify each scheduler, or an administrator can manually notify each scheduler.
[0071] [Specific example] Next, a specific example of failover will be described with reference to Fig. 10 to Fig. 13. Fig. 10 is a diagram for explaining monitoring between containers. As shown in Fig. 10, the container system shown in the specific example has cluster 1, cluster 2, cluster 3, cluster 4, and cluster 5.
[0072] (composition) In cluster 1, a master scheduler 130, a container A1, and a container C1 are deployed, in cluster 2, a scheduler 230, a container A2, a container B2, and a container C2 are deployed, in cluster 3, a scheduler 330, and a container B3 are deployed, in cluster 4, a scheduler 430, a container A4, a container B4, and a container C4 are deployed, and in cluster 5, a scheduler 530, a container B5, and a container C5 are deployed.
[0073] Containers A1, A2, and A3 belong to the same container group A, containers B2, B3, B4, and B5 belong to the same container group B, and containers C1, C2, C3, and C4 belong to the same container group C. Note that the master scheduler 130 has the same function as the master scheduler 130 described in Fig. 8. Schedulers 230, 330, 430, and 530 have the same function as the scheduler 230 described in Fig. 8.
[0074] (mutual monitoring) In such a configuration, each container performs alive monitoring among containers in the same container group. For example, as shown in Fig. 10, container A1, container A2, and container A4 monitor each other. Note that while Fig. 10 shows container group A as an example, containers B2, container B3, container B4, and container B5 also monitor each other, and containers C1, container C2, container C4, and container C5 also monitor each other.
[0075] (Fault detection) Next, as an example, a case will be described in which container A4 of cluster 4 detects a failure in cluster 2. Fig. 11 is a diagram for explaining failure detection. As shown in Fig. 11, container A4 detects the stop of cluster 2 or container A2 when it cannot receive a response to a live / dead confirmation message that is periodically sent from container A2 of cluster 2. Then, container A4 executes a failure notification to the failover destination according to the information stored in the failover destination DB.
[0076] Here, an example of determining the failover destination of container group A will be described. First, among the multiple container groups in the container system, a container group whose overlapping cluster count, which is the number of clusters deployed in the same cluster as container An (n=1, 2, . . .) of container group A, is identified as being equal to or greater than a threshold value. For example, for container group B, the number of containers belonging to the same cluster as container An of container group A is identified as 2 (cluster 2, cluster 4). Similarly, for container group C, the number of containers belonging to the same cluster as container An of container group A is identified as 2 (cluster 2, cluster 4). As a result, container group B and container group C are identified as candidates for the failover destination. When a failure occurs in container group A, a container belonging to container group A detects the failure, and the container requests a failover to containers belonging to other container groups in the same cluster. At this time, the container requesting the failover must exist in the same cluster as the container that detected the failure. The above process identifies a container group that often exists in the same cluster as container group A as a candidate for requesting a failover (failover destination candidate).
[0077] Next, from among the failover destination candidates, a container group is selected in which the number of non-overlapping clusters, which is the number of clusters deployed in clusters in which container An of container group A is not deployed, is equal to or greater than a threshold value. For example, clusters 3 and 5 in which container An is not deployed are identified, and since the number of non-overlapping clusters in which containers of container group B are deployed is 2 and the number of non-overlapping clusters in which containers of container group C are deployed is 1 among clusters 3 and 5, container group B is determined as the migration destination container group. This increases the number of candidates for clusters in which container An is not running, which will be the failover destination in the event of a failure, and has the effect of increasing the possibility of selecting a cluster that has little impact on service performance after failover as the actual failover destination.
[0078] Then, the cluster in which the container that minimizes the average delay between each container Bn belonging to the destination container group and each container An belonging to the source container group A is executed is determined as the migration destination. For example, if the delay (A1B3+A2B3+A4B3)<the delay (A1B5+A2B5+A4B5), cluster 3 is determined as the failover destination. This makes it possible to determine the failover destination taking communication delays into consideration. Note that the delay amount can be calculated using a known method such as the transmission delay time of a communication network using transmission time, etc.
[0079] As a result, container A4 that detected the failure notifies container B4, which belongs to destination container group B among containers deployed in the same cluster 4, that a failure has occurred in container A2 in cluster 2. Container B4 then notifies container B3 of the same container group, which is deployed in the failover destination cluster 3, that a failure has occurred in container A2 in cluster 2. Container B3 then notifies scheduler 330 in the same cluster that a failure has occurred in container A2 in cluster 2.
[0080] (Failover) Next, the failover will be described. Fig. 12 is a diagram for explaining the failover. As shown in Fig. 12, when the scheduler 330 of the cluster 3 is notified by the container B3 that a failure has occurred in the container A2 of the cluster 2, the scheduler 330 acquires information on the container A from the image file DB, deploys it as the container A3, and operates it. As a result, the container group A provided services using the containers A1, A2, and A4 before the failure, but after the failure, the container group A can continue to provide services using the containers A1, A3, and A4.
[0081] (Collecting operation information) Thereafter, the master scheduler 130 collects operation information, and the failover is shared within the container system. FIG. 13 is a diagram for explaining the collection of operation information after a failover. As shown in FIG. 13, the master scheduler 130 periodically transmits a health monitoring message to each scheduler in each cluster. Here, the master scheduler 130 detects a failure in cluster 2 because it cannot detect a response from the scheduler 230 in cluster 2. Then, the master scheduler 130 detects a failover of container A4 (container A2) by obtaining information on a list of deployed containers from the scheduler 330 in cluster 3. At this time, the master scheduler 130 also obtains operation information of each container from each scheduler.
[0082] In this way, the master scheduler 130 updates the operation information management DB 104. Furthermore, each scheduler periodically acquires container information of its own cluster to keep the container information management table up to date.
[0083] In the above example, the failover of container A2 when a failure occurs in cluster 2 is described, but failover is also performed for containers B2 and C2 in cluster 2 using a similar processing procedure.
[0084] [Processing flow] Fig. 14 is a flowchart showing the flow of the failover process according to the embodiment 2. As shown in Fig. 14, when the monitoring timing arrives (S101: Yes), each container selects a container in the same container group (S102) and transmits an alive monitoring message (S103).
[0085] Then, when each container receives a response to the alive monitoring message (S104: Yes), it determines whether or not there is an unselected container in the same container group (S105). If there is no unselected container (S105: No), the process for the current monitoring timing ends.
[0086] On the other hand, if there are any unselected containers (S105: Yes), each container returns to S102 and subsequent steps, selects a container within the same container group, and transmits a health check message.
[0087] Furthermore, in S104, if any of the containers cannot receive a response to the alive monitoring message (S104: No), a failure in the container or cluster is detected and a failover process is executed (S106).
[0088] For example, container A4 notifies container B4 in the same cluster of container group B, which was selected in advance for container A2 from which a response to the alive monitoring message could not be received, of the failure. Then, container B4 notifies cluster 3, which is the failover destination, of the failure information between container group B. After that, container B3 in cluster 3 updates the container information management table and notifies scheduler 330 of the failure. As a result, scheduler 330 in cluster 3 detects the failure of container group A by referring to the container information management table and the notification from container B3, and completes the failover of container group A by newly deploying and operating container A3 in cluster 3.
[0089] After that, when the failure is recovered (S107: Yes), switching back to the container before the failure is executed (S108). For example, when the scheduler 330 of the failover destination cluster 3 is notified of the failure recovery from the same route as at the time of the failure or from the master scheduler 130, it deletes the failed over container A3. In addition, the scheduler 230 of the cluster 2, which has recovered from the failure, operates each container including the container A2 that was stopped due to the failure.
[0090] [effect] As described above, the container system can detect failures between containers by monitoring the aliveness of the second container of the same group, which is a replica of the first container and is deployed in another cluster. As a result, compared to the case where aliveness monitoring of all containers is performed from outside the system, failure detection can be performed quickly with only limited monitoring, and failure handling by failover can be quickly realized.
[0091] In addition, the method of sending various instructions from a container belonging to one cluster to a scheduler in another cluster is not a preferable method because it requires complicated destination management and cumbersome access control. In contrast, the container system monitors between clusters and transmits fault information between clusters, eliminating the need for complicated settings.
[0092] Furthermore, if each container group independently selects a failover destination, a bias may occur, and performance degradation due to resource congestion may occur at the failover destination. Furthermore, if the failover destination is distributed among the container groups, the response delay may increase, and degradation of service quality may occur. In response to these problems, in the container system according to the first embodiment, the failover destination in the event of a failure can be selected and agreed upon within the same container group, so that high-speed failover can be realized while suppressing service degradation, and improvement of service availability and reliability can be realized.
[0093] In addition, since the container system may recover from a cluster failure in a short time, the container system can perform failover starting from a container with a high priority or a container with a high urgency, thereby achieving fast and stable service recovery. For example, the container system can control the order of failover by any method, such as determining the priority in advance, prioritizing a container group with many stopped containers, or prioritizing a service user or a container with a long service duration. EXAMPLES
[0094] Generally, containers have a short startup time and the cost of moving between clusters is small, so a fast failover can be achieved. As explained in the first embodiment, although it is not possible to predict the load state of other clusters when a cluster failure occurs, a fast failure response can be achieved by prioritizing container movement by failover in a somewhat speculative manner. At this time, the performance of the failover destination is monitored, and if performance degradation occurs, it is possible to suppress deterioration in the quality of service by dealing with it sequentially within the same container group.
[0095] For example, the scheduler of the failover destination cluster monitors the operating status of each container in the same cluster, and if it detects that a service delay has occurred, it can temporarily delete or temporarily stop the failed-over container in order to recover from the service delay.
[0096] To explain the above example using the example of the first embodiment, when the scheduler 330 of the failover destination cluster 3 detects a deterioration in the service performance of a container group due to a communication delay of any container including container A3 exceeding a threshold, the scheduler 330 deletes container A3. As a result, in the container system, for container group A, degenerate operation is performed for containers A1 and A4.
[0097] Regardless of the failover destination, the scheduler of another cluster can also monitor the operating status of each container in the same cluster, and if a service delay occurs, it can request the failover destination to stop the failed over container.
[0098] Fig. 15 is a flowchart showing a flow when performance degradation occurs due to a delay after a failover process according to the embodiment 3. Since S201 to S206 shown in Fig. 15 are similar to the processes S101 to S106 described in Fig. 14, detailed description thereof will be omitted.
[0099] After the failover, if the scheduler of the failover destination cluster detects performance degradation due to delay (S207: Yes) until the failure is restored, it deletes the failed over container (S208). On the other hand, the scheduler of the failover destination cluster maintains the operation of the failed over container while it does not detect performance degradation due to delay (S207: No). Note that, as an example of performance degradation, commonly used information such as communication delay, service delay, and processing delay can be used.
[0100] The subsequent steps S209 and S210 are similar to steps S107 and S108 described with reference to FIG. 14, and therefore a detailed description thereof will be omitted. EXAMPLES
[0101] For example, if the performance of a service deteriorates due to a certain resource shortage caused by an abnormal increase in the resource usage rate of a processor, memory, etc. during the degenerate operation of the third embodiment, the service quality can be improved by scaling out.
[0102] To explain the above embodiment as an example, the scheduler 330 of the failover destination cluster 3 deletes container A3, and thus the container system executes degenerate operation of containers A1 and A4 for container group A. In this state, for example, when the scheduler 430 of cluster 4 detects that the resource usage rate of container A4 in cluster 4 has exceeded a threshold, it can newly generate container A4-2 in cluster 4 to improve the service performance of container group A.
[0103] Fig. 16 is a flowchart showing a flow when performance degradation occurs due to degeneration after failover processing according to the embodiment 4. Since S301 to S308 shown in Fig. 16 are similar to the processes from S201 to S208 described in Fig. 15, detailed description thereof will be omitted.
[0104] After the degenerate operation, when each scheduler of each cluster detects performance degradation due to the degeneration (S309: Yes), it executes scale-out of the container whose performance has deteriorated within its own cluster (S310). On the other hand, while each scheduler of each cluster does not detect performance degradation due to the degeneration (S309: No), it maintains the operation of the degenerate container.
[0105] The subsequent steps S311 and S312 are the same as S107 and S108 described in Fig. 14, and therefore detailed description will be omitted. When the failure is recovered, the scale-out also ends. In the above example, the scheduler 430 of the cluster 4 deletes the container A4-2 generated in the cluster 4. EXAMPLES
[0106] The above-mentioned methods for determining the failover destination can be executed independently. Specifically, the method can be determined by using any one of the following methods: a method for determining the destination based on the number of overlapping clusters, a method for determining the destination based on the number of non-overlapping clusters, and a method for determining the destination based on the amount of communication delay. It is also possible to determine a failover destination that satisfies all of the conditions. Here, as an example, the flow of processing when the cluster server 200 executes each method will be described.
[0107] (Determination method based on the number of overlapping clusters) Fig. 17 is a flowchart showing the flow of the process of identifying the failover destination based on the number of overlapping clusters. As shown in Fig. 17, the cluster server 200 selects one container group (S401), identifies a cluster in which the containers of the selected container group operate (S402), and identifies a cluster in which the containers of other container groups other than the selected container group operate (S403).
[0108] Then, the cluster server 200 calculates the number of overlapping clusters (S404). For example, the cluster server 200 counts the number of overlapping clusters, which is the number of clusters deployed in the same cluster as the containers of the selected container group, for other container groups.
[0109] After that, the cluster server 200 determines the failover destination based on the number of overlapping clusters (S405). For example, the cluster server 200 identifies another container group with the largest number of overlapping clusters as a candidate (failover destination candidate) for requesting a failover of the selected container group.
[0110] If there is an unprocessed container group (S406: Yes), the cluster server 200 repeats S401 and subsequent steps, and if there is no unprocessed container group (S406: No), ends the process.
[0111] (Determination method based on the number of non-overlapping clusters) Fig. 18 is a flowchart showing the flow of a process for identifying a failover destination based on the number of non-overlapping clusters. For example, when multiple candidates are selected using the method of Fig. 17, this process can be executed for the multiple candidates to make a final decision. Also, when multiple candidates are selected using the method of Fig. 18, the process of Fig. 17 can be executed for the multiple candidates to make a final decision.
[0112] As shown in FIG. 18, the cluster server 200 selects one container group (S501), identifies a cluster in which the containers of the selected container group will operate (S502), and identifies a cluster in which containers of other container groups other than the selected container group will operate (S503).
[0113] Then, the cluster server 200 calculates the number of non-overlapping clusters (S504). For example, the cluster server 200 counts the number of non-overlapping clusters, which is the number of clusters in which the containers of the selected container group are not deployed, for other container groups.
[0114] After that, the cluster server 200 determines the failover destination based on the number of non-overlapping clusters (S505). For example, the cluster server 200 identifies another container group with the largest number of non-overlapping clusters as a candidate for requesting a failover of the selected container group (a failover destination candidate).
[0115] If there is an unprocessed container group (S506: Yes), the cluster server 200 repeats S501 and subsequent steps, and if there is no unprocessed container group (S506: No), ends the process.
[0116] (Decision method based on communication delay amount) Fig. 19 is a flowchart showing the flow of a process for identifying a failover destination based on the amount of communication delay. When multiple candidates are selected using the methods of Fig. 17 or Fig. 18, or manually, this process can be executed for the multiple candidates to make a final decision. Also, when multiple candidates are selected using the method of Fig. 19, the process of Fig. 17 or Fig. 18 can be executed for the multiple candidates to make a final decision.
[0117] As shown in FIG. 19, the cluster server 200 selects one container group as a candidate for the failover destination (S601), identifies a cluster in which the containers of the selected container group will operate (S602), and identifies a cluster in which containers of other container groups other than the selected container group will operate (S603).
[0118] Then, the cluster server 200 measures the communication delay between each cluster (S604). For example, the cluster server 200 measures the communication delay between each container at the migration source and each container at the migration destination, and calculates the average delay between the clusters using the communication delay between the containers.
[0119] Thereafter, the cluster server 200 determines the cluster with the smallest communication delay as the failover destination (S605). If there is an unprocessed container group (S606: Yes), the cluster server 200 repeats S601 and subsequent steps, and if there is no unprocessed container group (S606: No), ends the process. EXAMPLES
[0120] Although the embodiments of the present invention have been described above, the present invention may be embodied in various different forms other than the above-described embodiments.
[0121] [Numbers, etc.] The number of clusters, number of containers, clustering technology, failure details, performance degradation detection method, numerical examples, thresholds, etc. used in the above embodiments are merely examples and can be changed as desired.
[0122] [system] The information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed arbitrarily unless otherwise specified.
[0123] In addition, each component of each device shown in the figure is a functional concept, and does not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure. In other words, all or part of them can be functionally or physically distributed and integrated in any unit according to various loads, usage conditions, etc.
[0124] Furthermore, each processing function performed by each device may be realized, in whole or in part, by a CPU and a program analyzed and executed by the CPU, or may be realized as hardware using wired logic.
[0125] [Hardware] Next, an example of the hardware configuration of each device described in the above embodiment will be described. Since each device has the same hardware configuration, the cluster server 200 will be described here as an example. Fig. 20 is a diagram for explaining an example of the hardware configuration. As shown in Fig. 20, the cluster server 200 has a communication device 200a, a HDD (Hard Disk Drive) 200b, a memory 200c, and a processor 200d. Moreover, each unit shown in Fig. 20 is connected to each other by a bus or the like.
[0126] The communication device 200a is a network interface card or the like, and communicates with other servers. The HDD 200b stores programs and DBs that operate the functions shown in FIG.
[0127] The processor 200d reads out a program that executes the same processes as the respective processing units shown in FIG. 5 and the like from the HDD 200b and loads it in the memory 200c, thereby operating a process that executes the respective functions described in FIG. 5 and the like. For example, this process executes the same functions as the respective processing units of the cluster server 200. Specifically, the processor 200d reads out a program having the same functions as the cluster execution unit 211, the schedule execution unit 212, the container execution unit 213, and the like from the HDD 200b and the like. Then, the processor 200d executes a process that executes the same processes as the cluster execution unit 211, the schedule execution unit 212, the container execution unit 213, and the like.
[0128] In this way, the cluster server 200 operates as an information processing device that executes various processing methods by reading and executing the program. The cluster server 200 can also realize functions similar to those of the above-mentioned embodiment by reading the program from a recording medium using a medium reading device and executing the read program. Note that the program in this other embodiment is not limited to being executed by the cluster server 200. For example, the present invention can be similarly applied to cases where another computer or server executes a program, or where these execute a program in cooperation with each other.
[0129] This program can be distributed via a network such as the Internet. This program can also be recorded on a computer-readable recording medium such as a hard disk, a flexible disk (FD), a CD-ROM, a magneto-optical disk (MO), or a digital versatile disk (DVD), and can be executed by being read out from the recording medium by a computer. [Explanation of symbols]
[0130] 100 Master Server 101 Communications Department 102 Storage section 103 Image File DB 104 Operational Information Management DB 110 Control section 111 Cluster Executive 112 Schedule Execution Department 113 Container Execution Unit 200 Cluster Servers 201 Communications Department 202 Storage section 203 Image File DB 204 Failover destination DB 210 Control section 211 Cluster Executive 212 Schedule Execution Department 213 Container Execution Department
Claims
1. A container management method executed in a container system in which containers are distributed across a plurality of clusters, comprising: A first container deployed in a first cluster Performing status monitoring of a second container deployed in a second cluster different from the first cluster; instructing a third cluster different from the second cluster to execute a failover of the second container according to a result of the state monitoring; A container management method comprising:
2. 2. The container management method according to claim 1, wherein the first container performs live / dead confirmation with other containers that belong to a container group that provides the same service.
3. The first container comprises: As a failover destination of a first container group to which the first container and the second container belong, The container management method according to claim 1 or 2, characterized in that a container group in which the number of overlapping clusters deployed in the same cluster as containers of the first container group is equal to or greater than a threshold is selected from among a plurality of container groups in the container system.
4. The first container comprises: As a failover destination of a first container group to which the first container and the second container belong, A container management method according to any one of claims 1 to 3, characterized in that a container group in which the number of non-overlapping clusters deployed in clusters in which containers of the first container group are not deployed is equal to or greater than a threshold is selected from among a plurality of container groups in the container system.
5. The first container comprises: The container management method according to claim 3 or 4, characterized in that a cluster in which containers are deployed that minimizes the communication delay between each container belonging to the container group selected as the migration destination and each container belonging to the first container group that is the migration source is determined as the migration destination by the failover.
6. The third cluster comprises: Executing a fourth container that has failed over the second container; monitoring a performance status of the third cluster after executing the fourth container; 6. A container management method according to claim 3, further comprising the steps of: when performance degradation of the third cluster is detected, deleting the fourth container and performing degenerate operation of the first container group to which the second container belongs.
7. a fourth cluster in the container system, The container management method according to claim 5, characterized in that, when performance degradation of the first container group is detected after degenerate operation of the first container group, a scale-out is performed in which a fifth container corresponding to the second container that is the source of failover is deployed in the fourth cluster.
8. In a container management program executed in a container system in which containers are distributed across multiple clusters, A first container deployed in a first cluster Performing status monitoring of a second container deployed in a second cluster different from the first cluster; instructing a third cluster different from the second cluster to execute a failover of the second container according to a result of the state monitoring; A container management program that causes a computer to execute a process.
Citation Information
Patent Citations
Scheduling simulation system and scheduling simulation method
CN110895504A
Mobile agent fault monitoring method
JP2003030161A
Container optimized arrangement system and container recovery system therefor
JP2018156465A
System for managing and scheduling containers
JP2019149192A
Control method, control program, and information processing apparatus
JP2020177489A
