Management unit storage method and device based on distributed file system, equipment, storage medium and program product

By detecting the unbinding time of POD and persistent volume declaration in a distributed Kubernetes cluster, creating a new persistent volume declaration and binding to the distributed file system main volume, the POD service unavailability problem caused by the unavailability of persistent volume declarations is solved. Improves the high availability and data security of POD services.

CN119271356AInactive Publication Date: 2025-01-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411795164.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-01-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In a distributed Kubernetes cluster, state changes in persistent volume and persistent volume declarations during POD runtime cause temporary unavailability issues, affecting the high availability of application services.

Method used

When it is detected that the time for the POD to be unbined with the persistent volume declaration exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent, and a new persistent volume declaration is created based on the pre-listening record information, bound to the distributed file system main volume. On, establish a new relationship to restore POD services.

Benefits of technology

Improves the high availability of POD services, ensures the persistence and data security of application services, and avoids temporary unavailability issues caused by the inability to mount the persistent volume declaration to the new POD.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271356A_ABST
    Figure CN119271356A_ABST
Patent Text Reader

Abstract

The invention discloses a management unit storage method and device based on a distributed file system, equipment, a storage medium and a program product, and the method comprises the steps: determining that a current management unit in a distributed cluster is abnormal, and when the duration for the current management unit to unbind a persistent volume declaration associated with the current management unit exceeds a preset time threshold value, storing the persistent volume declaration in the distributed cluster; sending an instruction for deleting the persistent volume declaration to the distributed cluster; the duration refers to the duration from the unbinding moment to the current moment; the management unit is a schedulable unit on a distributed cluster; creating a new persistent volume declaration based on first information corresponding to a pre-monitored and recorded persistent volume declaration; and binding the new persistent volume declaration to a distributed file system main volume on which the persistent volume declaration depends, and establishing an association relationship between the new persistent volume declaration and the new management unit, so that the distributed cluster recovers the service of the new management unit based on the new persistent volume declaration. By adopting the method, the high availability of the POD service can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a management unit storage method, device, equipment, storage medium and program product based on a distributed file system. Background Art

[0002] In order to achieve containerization and persistence of application services, when deploying application services on a distributed Kubernetes (abbreviated as K8S, an open source platform for automatically deploying, scaling and managing containerized applications) cluster, it is necessary to declare the corresponding minimum deployment and management unit (abbreviated as POD, which is the most basic schedulable unit in K8S and the encapsulation of containers in K8S) information and persistent volume claim (PVC) information.

[0003] However, in the actual service process, the key components of Persistent Volume (PV) and PVC will change their state when the POD is running. For example, in the case of StatefulSet (a controller used to manage stateful applications, maintaining the creation, deletion, update order and persistent storage of Pods) and Deployment (a controller used to manage stateless applications, maintaining service scalability and availability), if the StatefulSet POD or Deployment POD is in the terminating state, there may be a short-term unavailability problem when using PV or PVC. As a result, there will be a temporary unavailability of the application service due to the inability to mount PVC to the POD, which will lead to the instability of business operation.

[0004] Therefore, how to improve the high availability of POD services has become an urgent problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide a management unit storage method, apparatus, device, storage medium and program product based on a distributed file system, which can improve the high availability of POD services.

[0006] In a first aspect, the present application provides a management unit storage method based on a distributed file system, which is applied to a working node in a distributed cluster where a listening component is deployed, and a distributed file system is also deployed in the distributed cluster. The method includes:

[0007] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0008] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0009] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0010] In one of the embodiments, the method further includes: monitoring a distributed file system primary volume and one or more secondary volumes corresponding to the distributed file system primary volume; in the case of determining that a failure has occurred in the distributed file system primary volume, sending first indication information to the distributed file system, the first indication information being used to indicate that data in the distributed file system primary volume is stored in each secondary volume; in the case of receiving a response message from the distributed file system, upgrading any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume; the new distributed file system primary volume is used for use by a new persistent volume; wherein the response message is used to indicate that data in the distributed file system primary volume has been stored in each secondary volume; the new persistent volume is associated with a new persistent volume declaration; the new persistent volume is created based on second information corresponding to the persistent volume associated with the persistent volume declaration that was pre-monitored and recorded.

[0011] In one embodiment, upon receiving a response message from the distributed file system, after upgrading any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume, the method further includes: adding a secondary volume corresponding to a new distributed file system primary volume.

[0012] In one of the embodiments, the method further includes: obtaining third information corresponding to the new persistent volume declaration; and when it is determined based on the third information that the new persistent volume declaration is successfully established, sending second indication information to the distributed cluster, wherein the second indication information is used to indicate deletion of the persistent volume declaration.

[0013] In one of the embodiments, the method also includes: monitoring the current management unit in the distributed cluster and recording fourth information corresponding to the current management unit; when it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or the distributed cluster cannot bind the persistent volume declaration to a new management unit, determining that the current management unit in the distributed cluster is abnormal.

[0014] In one of the embodiments, before monitoring the current management unit in the distributed cluster and recording the fourth information corresponding to the current management unit, the method also includes: when determining that the application service is deployed in the distributed cluster, creating a persistent volume, a persistent volume declaration, and the current management unit based on the configuration file corresponding to the application service; associating the persistent volume declaration with the persistent volume; and associating the persistent volume declaration with the current management unit.

[0015] In a second aspect, the present application provides a management unit storage method device based on a distributed file system, which is applied to a working node in a distributed cluster where a listening component is deployed, and a distributed file system is also deployed in the distributed cluster. The device includes:

[0016] A sending module is used to send an instruction to delete the persistent volume declaration to the distributed cluster when it is determined that the current management unit in the distributed cluster is abnormal and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold; the duration refers to the duration between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0017] A creation module, configured to create a new persistent volume declaration based on first information corresponding to the persistent volume declaration recorded in advance;

[0018] The processing module is used to bind the new persistent volume declaration to the distributed file system primary volume on which the persistent volume declaration depends, and to establish an association between the new persistent volume declaration and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume declaration.

[0019] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0020] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0021] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0022] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0023] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0024] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0025] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0026] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0027] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0028] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0029] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0030] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0031] The above-mentioned management unit storage method, device, equipment, storage medium and program product based on a distributed file system are applied to a working node with a monitoring component deployed in a distributed cluster, and a distributed file system is also deployed in the distributed cluster; wherein, the working node (for example, a computer device) can send an instruction to delete the persistent volume declaration (PVC) to the distributed cluster when it is determined that the current management unit (POD) in the distributed cluster (for example, a K8S cluster) is abnormal and the duration of the current management unit unbinding the persistent volume declaration (PVC) associated with it exceeds a preset time threshold; the duration refers to the duration between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster; based on the first information corresponding to the persistent volume declaration recorded in advance, a new persistent volume declaration is created; the new persistent volume declaration is bound to the primary volume of the distributed file system (for example, GlusterFS) on which the persistent volume declaration depends, and an association relationship between the new persistent volume declaration and the new management unit is established, so that the distributed cluster can restore the service of the new management unit based on the new persistent volume declaration. By adopting this method, when the computer device determines that the current POD in the K8S cluster is abnormal and the time for the current POD to unbind the PVC associated with it exceeds the preset time threshold, it can send an instruction to the K8S cluster to delete the current PID, and create a new PVC based on the PVC information recorded in advance. After that, the new PVC can be mounted on the new POD, thereby improving the high availability of the POD service. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 This is a schematic diagram of an application scenario of a management unit storage method based on a distributed file system provided in an embodiment of the present application;

[0034] Figure 2 It is a flowchart of a management unit storage method based on a distributed file system provided in an embodiment of the present application;

[0035] Figure 3 It is a flowchart of another management unit storage method based on a distributed file system provided in an embodiment of the present application;

[0036] Figure 4 It is a flow chart of a POD storage method based on GlusterFS provided in an embodiment of the present application;

[0037] Figure 5 It is a structural diagram of a management unit storage device based on a distributed file system provided in an embodiment of the present application;

[0038] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] In order to facilitate understanding of the embodiments of the present application, some concepts involved in the embodiments of the present application are described below. The description of these concepts includes but is not limited to the following content.

[0041] 1. K8S

[0042] K8S is an open source platform for automating the deployment, expansion and management of containerized applications. It helps users automatically manage container clusters across multiple hosts and provides a variety of functions, such as service discovery and load balancing, storage orchestration, automated rolling updates and rollbacks, key and configuration management, etc. It is the base platform for large-scale application services on the modern Internet and a supporting platform widely used by major Internet companies.

[0043] 2. POD

[0044] POD is the most basic schedulable unit in K8S, which is the encapsulation of containers in K8S, or in other words, POD is a collection of one or more containers. A Pod can contain one or more containers, which share storage resources, network namespaces, and IP addresses, and can communicate with each other as if they were running on the same host.

[0045] 3. Persistent Volume (PV)

[0046] PV is a persistent volume in K8S, which provides storage resources for the cluster. It can be a raw disk, network storage, cloud storage, or other types of storage media. PV exists independently of any specific container or Pod, has lifecycle management, and can be requested and used by PVC. The binding relationship between PV and PVC enables K8S to provide persistent data storage for applications, and data will not be lost even if the Pod is restarted or migrated.

[0047] 4. Persistent Volume Claim (PVC)

[0048] PVC is the core of persistent storage in K8S. It is a resource object in K8S that allows users to skip the underlying storage and simply request storage resources based on demand, declare the required storage capacity and access mode, and then K8S finds the PV and binds it. In other words, PVC is used in pairs with PV. When creating PVC, K8S will look for a suitable PV to bind to it, forming a one-to-one relationship, thereby providing persistent storage space for the Pod. PVC defines the storage size, access mode (such as read-only, read-write, etc.) and other properties to ensure that the POD can access storage resources that meet the requirements.

[0049] 5. GlusterFS

[0050] GlusterFS is a distributed file system that aggregates physical storage devices to form a unified virtual storage pool. It is often used to build large-scale, high-availability storage clusters and is suitable for processing big data, media streaming, backup, archiving, and other application scenarios. In the K8S environment, GlusterFS can be used as the backend storage of PV to provide persistent storage capabilities.

[0051] 6. Listening agent component (or listening component)

[0052] The monitoring agent component is used to monitor the status of the cluster POD, handle the problem that the POD cannot be automatically recovered under abnormal conditions, and support PVC storage switching. It is a customized service component that ensures high availability of POD storage.

[0053] In order to achieve containerization and persistence of application services, when deploying application services, it is necessary to declare the corresponding information of the minimum deployment and management unit POD and PVC. POD references persistent storage volumes by binding PVC, fundamentally ensuring that container data will not be lost when POD is running, realizing the decoupling of computing and storage of application services, and ensuring the persistence of application service data.

[0054] However, in the actual service process, the key components of PV and PVC will change their status when the POD is running. Especially when it comes to StatefulSet and Deployment deployment methods, short-term unavailability problems may occur when using PV, resulting in temporary unavailability of application services.

[0055] Most of the PODs of application services use two declaration states: StatefulSet and Deployment. StatefulSet is a controller used to manage stateful applications, and is used in storage applications such as databases and message queue middleware; Deployment is a controller used to manage stateless applications, and is used in website services involving shared storage such as web. When the StatefulSet and Deployment controllers are in the following states, PV access failures will occur, especially ReadWriteOnce (PVC in RWO mode can only be mounted by one Pod at a time), resulting in application usage failures:

[0056] 1. StatefulSet Pod is in Terminating: The Pod cannot be deleted normally, which may cause the Pod to be unable to be migrated to other normal nodes by K8S. K8S will prevent the new Pod from using the PVC bound to the old POD;

[0057] 2. Deployment Pod is in Terminating: K8S tries to create a new Pod after a certain period of time. In RWO mode, the new Pod cannot mount the old PVC before the old Pod is completely terminated.

[0058] The above problems will cause application service abnormalities because PVC cannot be mounted to the new POD, thereby reducing the high availability of the POD service.

[0059] Based on this, the embodiment of the present application provides a management unit storage method, device, equipment, storage medium and program product based on a distributed file system, which can improve the high availability of POD services. It is applied to a working node with a monitoring component deployed in a distributed cluster, and a distributed file system is also deployed in the distributed cluster, wherein the method includes: when it is determined that the current POD in the K8S cluster is abnormal, and the duration of the current unbinding of the PVC associated with it exceeds the preset time threshold, send an instruction to delete the PVC to the K8S cluster; wherein the duration refers to the duration between the unbinding moment and the current moment; based on the first information corresponding to the PVC recorded in advance, create a new PVC; bind the new PVC to the GlusterFS master volume that the PVC depends on, and establish an association relationship between the new PVC and the new POD, so that the K8S cluster can restore the service of the new POD based on the new PVC. By adopting this method, when the working node determines that the current POD in the K8S cluster is abnormal and the time for the current POD to unbind the PVC associated with it exceeds the preset time threshold, it can send an instruction to the K8S cluster to delete the current PID, and create a new PVC based on the PVC information recorded in advance. After that, the new PVC is mounted on the new POD, thereby improving the high availability of the POD service.

[0060] Combine the following Figure 1 , the application scenarios of the management unit storage method based on the distributed file system provided in the embodiment of the present application are introduced.

[0061] See also Figure 1 , Figure 1 Schematic diagram of an application scenario of a management unit storage method based on a distributed file system provided in an embodiment of the present application. Figure 1 As shown, the K8S cluster 100 includes a working node 101 with a monitoring component deployed, a GlusterFS 102, and multiple nodes ( Figure 1 In the figure, three nodes, namely, management node 103, computing node 104 and computing node 105 are drawn as an example).

[0062] Among them, the working node 101 can send an instruction to delete the PVC to the management node 103 in the K8S cluster 100 when it is determined that the current POD in the K8S cluster 100 is abnormal and the duration of the current unbinding of the PVC associated with it exceeds the preset time threshold; thereafter, the working node 101 can create a new PVC based on the first information corresponding to the PVC recorded in advance; bind the new PVC to the GlusterFS primary volume that the PVC depends on, and establish an association relationship between the new PVC and the new POD, so that the management node 103 in the K8S cluster 100 can restore the service of the new POD based on the new PVC. In this way, the working node 101 can send an instruction to delete the current PID to the K8S cluster when it is determined that the current POD in the K8S cluster is abnormal and the duration of the current POD unbinding the PVC associated with it exceeds the preset time threshold, and mount the created new PVC on the new POD, thereby improving the high availability of the POD service.

[0063] The specific process of the management unit storage method based on the distributed file system provided in the embodiment of the present application is described in detail below.

[0064] See also Figure 2 , Figure 2 1 is a flow chart of a management unit storage method based on a distributed file system provided in an embodiment of the present application. The method can be performed by a working node (for example, a Figure 1 101) in the work node. Figure 1 As shown, the management unit storage method based on the distributed file system may include but is not limited to the following steps:

[0065] S201. When it is determined that the current management unit in the distributed cluster is abnormal and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold, send an instruction to delete the persistent volume declaration to the distributed cluster.

[0066] The duration refers to the time between the unbinding time and the current time; the management unit refers to a schedulable unit on the distributed cluster.

[0067] Among them, the distributed cluster is, for example, a K8S cluster; the management unit is, for example, a POD in K8S; and the persistent volume declaration is the core of persistent storage in K8S.

[0068] In an optional implementation, the current management unit exception may be that the management node in the distributed cluster (K8S cluster) is unable to unbind the persistent volume claim (PVC) associated with the current management unit (current POD), or the management node is unable to bind the PVC to a new management unit (new POD), etc.

[0069] S202: Create a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance.

[0070] In an optional implementation, before step S202, the working node may monitor and record the first information corresponding to the persistent volume declaration associated with the current management unit. This is conducive to creating a new persistent volume based on the first information monitored and recorded when the current management unit is abnormal.

[0071] S203. Bind the new persistent volume declaration to the distributed file system primary volume on which the persistent volume declaration depends, and establish an association between the new persistent volume declaration and the new management unit, so that the distributed cluster restores the service of the new management unit based on the new persistent volume declaration.

[0072] The distributed file system is, for example, GlusterFS.

[0073] In an embodiment of the present application, a working node with a monitoring component deployed in a distributed cluster can send an instruction to delete the PVC to the distributed cluster when it is determined that the current POD in the distributed cluster is abnormal and the duration of the current unbinding of the PVC associated with it exceeds a preset time threshold; wherein the duration refers to the duration between the unbinding moment and the current moment; based on the first information corresponding to the PVC recorded in advance, a new PVC is created; the new PVC is bound to the main volume of the distributed file system that the PVC depends on, and an association relationship between the new PVC and the new POD is established, so that the distributed cluster can restore the service of the new POD based on the new PVC. Using this method, the working node can send an instruction to delete the current PID to the distributed cluster when it is determined that the current POD in the distributed cluster is abnormal and the duration of the current POD unbinding the PVC associated with it exceeds a preset time threshold, and create a new PVC based on the PVC information recorded in advance, and then mount the new PVC on the new POD, thereby improving the high availability of the POD service.

[0074] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of another management unit storage method based on a distributed file system provided in an embodiment of the present application. Figure 2 The difference of the management unit storage method based on the distributed file system shown is that Figure 3 The management unit storage method based on the distributed file system shown in FIG. 1 also describes that the working node monitors the distributed file system master volume (GlusterFS master volume), and upgrades the secondary volume to the new master volume in the event of a GlusterFS master volume failure. Figure 3 As shown, the management unit storage method based on the distributed file system may include but is not limited to the following steps:

[0075] S301. When it is determined that the current management unit in the distributed cluster is abnormal and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold, send an instruction to delete the persistent volume declaration to the distributed cluster.

[0076] The duration refers to the time between the unbinding time and the current time; the management unit refers to a schedulable unit on the distributed cluster.

[0077] It should be noted that in step S301, after the working node sends an instruction to delete the persistent volume declaration to the distributed cluster, whether the distributed cluster completes the deletion of the persistent volume declaration is not concerned here.

[0078] In an optional implementation, before step S301, the working node may also monitor the current management unit in the distributed cluster and record the fourth information corresponding to the current management unit; when it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or that the distributed cluster cannot bind the persistent volume declaration to a new management unit, it is determined that the current management unit in the distributed cluster is abnormal.

[0079] In this implementation, the working node monitors the current management unit in the distributed cluster and records the fourth information corresponding to the current management unit. It can also, when determining that the application service is deployed in the distributed cluster, create a persistent volume, a persistent volume declaration, and the current management unit based on the configuration file corresponding to the application service, wherein the persistent volume declaration is associated with the persistent volume; and associate the persistent volume declaration to the current management unit.

[0080] S302: Create a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance.

[0081] S303. Bind the new persistent volume declaration to the distributed file system primary volume on which the persistent volume declaration depends, and establish an association between the new persistent volume declaration and the new management unit, so that the distributed cluster restores the service of the new management unit based on the new persistent volume declaration.

[0082] In an optional implementation, the relevant descriptions of steps S301 to S303 can refer to the descriptions of the aforementioned steps S201 to S203, and will not be repeated here.

[0083] S304: Monitor the distributed file system primary volume and one or more secondary volumes corresponding to the distributed file system primary volume.

[0084] When the primary volume of the distributed file system is abnormal, the persistent volume may be unavailable, which will affect the normal operation of the management unit. Therefore, by monitoring the primary and secondary volumes of the distributed file system, the working node is conducive to configuring emergency plans based on the characteristics of the distributed file system when the primary volume is abnormal, and realizing automatic failover of the underlying storage.

[0085] S305: When it is determined that the primary volume of the distributed file system fails, first indication information is sent to the distributed file system, where the first indication information is used to instruct to store data in the primary volume of the distributed file system into each secondary volume.

[0086] Among them, a distributed file system is, for example, GlusterFS. GlusterFS uses the primary-secondary volume mode to replicate data to multiple nodes, which can improve data availability and fault tolerance. In this way, even if a node or disk fails, data can still be accessed and read from other replicas, making the underlying data inherently disaster-tolerant and highly available.

[0087] After the working node completes step S305, the distributed file system can automatically store the data in the primary volume in each secondary volume, thereby ensuring the availability and consistency of the data. It should be noted that the primary and secondary volumes need to be configured to adopt a strong synchronous replication mode, so as to avoid the problem of data inconsistency caused by the data of the failed primary volume being ahead of the secondary volume.

[0088] S306. When receiving a response message from the distributed file system, any secondary volume corresponding to the distributed file system primary volume is upgraded to a new distributed file system primary volume; the new distributed file system primary volume is used for the new persistent volume.

[0089] Among them, the response message is used to indicate that the data in the distributed file system primary volume has been stored in each secondary volume; the new persistent volume is associated with the new persistent volume declaration; the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration recorded in advance.

[0090] In an optional implementation, when receiving a response message from the distributed file system, the working node can upgrade any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume, and can also add a secondary volume corresponding to a new distributed file system primary volume. In this way, it can be ensured that in the event of a subsequent failure of the new distributed file system primary volume, the secondary volume is still highly available and has the secondary volume disaster recovery capability.

[0091] In an optional implementation, after step S306, the working node may also retain the failed primary volume and output a first alarm message, where the first alarm message is used to indicate that the primary volume has failed. This is helpful for the user to check and repair the failed primary volume based on the alarm message.

[0092] In an optional implementation, after step S306, the working node may also obtain third information corresponding to the new persistent volume declaration; based on the third information, if it is determined that the new persistent volume declaration is successfully established, the working node sends second indication information to the distributed cluster, and the second indication information is used to indicate the deletion of the persistent volume declaration. That is, after determining that the new persistent volume declaration is successfully established, the working node may force the distributed cluster to delete the old persistent volume declaration (i.e., the persistent volume life associated with the current management unit).

[0093] In this implementation, when an abnormality is detected in the deletion of a persistent volume declaration in a distributed cluster, a command to suspend the deletion can be sent to the distributed cluster, and the abnormality scene is retained, and a second alarm message is output, which is used to indicate that the deletion of the persistent volume declaration is abnormal. In this way, it is helpful for the user to check the cause of the abnormality in deleting the persistent volume declaration based on the second alarm message and determine the corresponding repair strategy.

[0094] In an embodiment of the present application, on the one hand, when the working node determines that the current POD in the distributed cluster is abnormal and the time for the current POD to unbind the PVC associated with it exceeds a preset time threshold, it can send an instruction to delete the current PID to the K8S cluster, and create a new PVC based on the PVC information recorded in advance. After that, the new PVC is bound to the main volume of the distributed file system that the PVC depends on, and the new PVC is mounted on the new POD, thereby improving the high availability of the POD service. On the other hand, when the working node detects that the main volume of the distributed file system has failed, it can send a message to the distributed file system indicating that the data in the main volume is stored in each secondary volume corresponding to the main volume; receive a response message from the distributed file system, the response message is used to indicate that the data in the main volume has been stored in each secondary volume; upgrade any secondary volume corresponding to the main volume of the distributed file system to a new main volume of the distributed file system, the new main volume of the distributed file system is used for the new persistent volume, and the new persistent volume is associated with the new persistent volume declaration; in this way, since the new PV is associated with the new PVC, and the new PVC is associated with the new POD, the continuity of the POD service and the security of the data can be ensured, thereby ensuring that the new PV can successfully bind the original storage data of the business and improve the high availability of the POD service.

[0095] The following uses the distributed cluster as a K8S cluster and the distributed file system as GlusterFS as an example to illustrate the management unit storage method based on the distributed file system provided in the embodiment of the present application. Figure 4 , Figure 4 1 is a flow chart of a POD storage method based on GlusterFS provided in an embodiment of the present application. The method can be executed by a working node with a monitoring component deployed in a K8S cluster. Figure 4 As shown, the POD storage method based on GlusterFS may include but is not limited to the following steps:

[0096] S401. When it is determined that the application service is deployed in the K8S cluster, create PV, PVC and current POD based on the configuration file corresponding to the application service; wherein PVC and PV are associated.

[0097] S402: Associate the PVC with the current POD.

[0098] S403. Monitor the current POD, PVC and PV in the K8S cluster, and record the information corresponding to the current POD, PVC and PV.

[0099] S404. When it is determined that the information corresponding to the POD indicates that the PVC associated with the current management unit cannot be unbound in the K8S cluster, or the K8S cluster cannot bind the PVC to a new POD, it is determined that the current POD in the K8S cluster is abnormal.

[0100] S405: When it is determined that the current POD in the K8S cluster is abnormal and the duration of the current POD being unbound from the PVC associated with it exceeds a preset time threshold, an instruction to delete the PVC is sent to the K8S cluster.

[0101] The duration refers to the time between the unbinding time and the current time.

[0102] S406: Create a new PVC based on the information corresponding to the PVC recorded in advance.

[0103] S407. Bind the new PVC to the GlusterFS primary volume that the PVC depends on, and establish an association between the new PVC and the new POD, so that the K8S cluster can restore the service of the new POD based on the new PVC.

[0104] In this way, the availability of application services can be achieved and the normal reading and writing of data can be guaranteed.

[0105] S408: Monitor the GlusterFS primary volume and one or more secondary volumes corresponding to the GlusterFS primary volume.

[0106] S409: When it is determined that the GlusterFS primary volume fails, first indication information is sent to GlusterFS, where the first indication information is used to instruct to store the data in the GlusterFS primary volume in each secondary volume.

[0107] S410. Upon receiving a response message from GlusterFS, any secondary volume corresponding to the GlusterFS primary volume is upgraded to a new GlusterFS primary volume; the new GlusterFS primary volume is used for a new PV, which is created based on information corresponding to the PV recorded in advance.

[0108] The response message is used to indicate that the data in the GlusterFS primary volume has been stored in each secondary volume; and the new PV is associated with the new PVC.

[0109] S411. Add a new secondary volume corresponding to the GlusterFS primary volume.

[0110] S412: Obtain information corresponding to the new PVC.

[0111] S413. When it is determined that the new PVC is successfully established based on the information corresponding to the new PVC, a second indication message is sent to the K8S cluster, where the second indication message is used to indicate the deletion of the PVC.

[0112] In the embodiment of the present application, the working node deployed with the monitoring component can monitor the status of POD, PVC and PV from the K8S system. When the current POD is abnormal, it starts to intervene automatically, triggers the above-mentioned processing flow, and automatically binds the new POD to the storage PVC to ensure the availability of data storage and the stability of the service. At the same time, when the underlying storage primary volume also has an abnormality, the storage volume can be actively switched, that is, the backup secondary volume can be quickly upgraded to the new primary volume, thereby ensuring the continuity of the POD service and the security of the data, and ensuring that the new PV can successfully bind the original storage data of the business to achieve high availability of the business.

[0113] It should be understood that although Figure 2 , Figure 3 and Figure 4 The steps in the flowchart shown are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , Figure 3 and Figure 4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0114] See also Figure 5 , Figure 5 1 is a schematic diagram of a structure of a management unit storage device based on a distributed file system provided in an embodiment of the present application. The device is applied to a working node in a distributed cluster where a monitoring component is deployed, and a distributed file system is also deployed in the distributed cluster. Figure 5 As shown, the device includes but is not limited to the following modules:

[0115] The sending module 501 is used to send an instruction to delete the persistent volume declaration to the distributed cluster when it is determined that the current management unit in the distributed cluster is abnormal and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold; the duration refers to the duration between the unbinding time and the current time; the management unit refers to a schedulable unit on the distributed cluster;

[0116] A creation module 502, configured to create a new persistent volume declaration based on first information corresponding to the persistent volume declaration recorded in advance by monitoring;

[0117] Processing module 503 is used to bind the new persistent volume declaration to the distributed file system primary volume that the persistent volume declaration depends on, and establish an association relationship between the new persistent volume declaration and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume declaration.

[0118] In one embodiment, the device further includes a monitoring module. The monitoring module is used to monitor the distributed file system main volume and one or more secondary volumes corresponding to the distributed file system main volume; the sending module 501 is also used to send a first indication information to the distributed file system when it is determined that the distributed file system main volume fails, and the first indication information is used to indicate that the data in the distributed file system main volume is stored in each secondary volume; the processing module 503 is also used to upgrade any secondary volume corresponding to the distributed file system main volume to a new distributed file system main volume when a response message is received from the distributed file system; the new distributed file system main volume is used for use by the new persistent volume; the response message is used to indicate that the data in the distributed file system main volume has been stored in each secondary volume; the new persistent volume is associated with the new persistent volume declaration; the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration recorded in advance.

[0119] In one embodiment, the processing module 503 is used to add a new secondary volume corresponding to the distributed file system primary volume after upgrading any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume upon receiving a response message from the distributed file system.

[0120] In one embodiment, the device further includes an acquisition module. The acquisition module is used to acquire third information corresponding to the new persistent volume declaration; the sending module 501 is also used to send second indication information to the distributed cluster when it is determined based on the third information that the new persistent volume declaration is successfully established, and the second indication information is used to indicate the deletion of the persistent volume declaration.

[0121] In one embodiment, the device further includes a determination module. The monitoring module is further used to monitor the current management unit in the distributed cluster and record the fourth information corresponding to the current management unit; the determination module is used to determine that the current management unit in the distributed cluster is abnormal when it is determined that the fourth information indicates that the distributed cluster cannot unbind the persistent volume declaration associated with the current management unit, or the distributed cluster cannot bind the persistent volume declaration to the new management unit.

[0122] In one embodiment, before the monitoring module is used to monitor the current management unit in the distributed cluster and record the fourth information corresponding to the current management unit, the creation module 502 is also used to create a persistent volume, a persistent volume declaration and the current management unit based on the configuration file corresponding to the application service when it is determined that the application service is deployed in the distributed cluster; the persistent volume declaration is associated with the persistent volume; and the persistent volume declaration is associated with the current management unit.

[0123] For the specific definition of the management unit storage device based on the distributed file system, please refer to the definition of the management unit storage method based on the distributed file system in the above text, which will not be repeated here. Each module in the above-mentioned management unit storage device based on the distributed file system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0124] In an exemplary embodiment, the present application embodiment provides a working node (computer device), which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a management unit storage method based on a distributed file system is implemented.

[0125] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0126] In an exemplary embodiment, the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0127] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0128] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0129] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0130] In one embodiment, when the processor executes the computer program, the following steps are also implemented: monitoring the distributed file system main volume and one or more secondary volumes corresponding to the distributed file system main volume; when it is determined that the distributed file system main volume fails, sending first indication information to the distributed file system, the first indication information is used to indicate that the data in the distributed file system main volume is stored in each secondary volume; when a response message is received from the distributed file system, upgrading any secondary volume corresponding to the distributed file system main volume to a new distributed file system main volume; the new distributed file system main volume is used for use by the new persistent volume; wherein the response message is used to indicate that the data in the distributed file system main volume has been stored in each secondary volume; the new persistent volume is associated with the new persistent volume declaration; the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration recorded in advance.

[0131] In one embodiment, the processor executes a computer program to upgrade any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume after receiving a response message from the distributed file system, and further implement the following steps: adding a new secondary volume corresponding to the distributed file system primary volume.

[0132] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining third information corresponding to the new persistent volume declaration; and when it is determined based on the third information that the new persistent volume declaration is successfully established, sending second indication information to the distributed cluster, where the second indication information is used to indicate the deletion of the persistent volume declaration.

[0133] In one embodiment, the processor also implements the following steps when executing the computer program: monitoring the current management unit in the distributed cluster and recording fourth information corresponding to the current management unit; determining that the current management unit in the distributed cluster is abnormal when it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or that the distributed cluster cannot bind the persistent volume declaration to a new management unit.

[0134] In one embodiment, before the processor executes a computer program to monitor the current management unit in the distributed cluster and records the fourth information corresponding to the current management unit, it also implements the following steps: when it is determined that the application service is deployed in the distributed cluster, based on the configuration file corresponding to the application service, create a persistent volume, a persistent volume declaration, and the current management unit; associate the persistent volume declaration with the persistent volume; and associate the persistent volume declaration with the current management unit.

[0135] In an exemplary embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0136] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0137] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0138] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0139] In one embodiment, the computer program is executed by the processor to further implement the following steps: monitoring the distributed file system main volume and one or more secondary volumes corresponding to the distributed file system main volume; in the case of determining that the distributed file system main volume fails, sending first indication information to the distributed file system, the first indication information is used to indicate that the data in the distributed file system main volume is stored in each secondary volume; in the case of receiving a response message from the distributed file system, upgrading any secondary volume corresponding to the distributed file system main volume to a new distributed file system main volume; the new distributed file system main volume is used for use by the new persistent volume; wherein the response message is used to indicate that the data in the distributed file system main volume has been stored in each secondary volume; the new persistent volume is associated with the new persistent volume declaration; the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration that was pre-monitored and recorded.

[0140] In one embodiment, the computer program is executed by a processor to implement, upon receiving a response message from the distributed file system, upgrading any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume, and further implementing the following steps: adding a new secondary volume corresponding to the distributed file system primary volume.

[0141] In one embodiment, the computer program executed by the processor also implements the following steps: obtaining third information corresponding to the new persistent volume declaration; and when it is determined based on the third information that the new persistent volume declaration is successfully established, sending second indication information to the distributed cluster, wherein the second indication information is used to indicate deletion of the persistent volume declaration.

[0142] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: monitoring the current management unit in the distributed cluster and recording fourth information corresponding to the current management unit; when it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or that the distributed cluster cannot bind the persistent volume declaration to the new management unit, determining that the current management unit in the distributed cluster is abnormal.

[0143] In one embodiment, the computer program is executed by a processor to monitor the current management unit in the distributed cluster, and before recording the fourth information corresponding to the current management unit, the following steps are also implemented: when it is determined that the application service is deployed in the distributed cluster, based on the configuration file corresponding to the application service, a persistent volume, a persistent volume declaration, and the current management unit are created; the persistent volume declaration is associated with the persistent volume; and the persistent volume declaration is associated with the current management unit.

[0144] In an exemplary embodiment, the present application provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0145] When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds the preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the time between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster;

[0146] Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance;

[0147] Bind the new persistent volume claim to the primary volume of the distributed file system on which the persistent volume claim depends, and establish an association between the new persistent volume claim and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume claim.

[0148] In one embodiment, the computer program is executed by the processor to further implement the following steps: monitoring the distributed file system main volume and one or more secondary volumes corresponding to the distributed file system main volume; in the case of determining that the distributed file system main volume fails, sending first indication information to the distributed file system, the first indication information is used to indicate that the data in the distributed file system main volume is stored in each secondary volume; in the case of receiving a response message from the distributed file system, upgrading any secondary volume corresponding to the distributed file system main volume to a new distributed file system main volume; the new distributed file system main volume is used for use by the new persistent volume; wherein the response message is used to indicate that the data in the distributed file system main volume has been stored in each secondary volume; the new persistent volume is associated with the new persistent volume declaration; the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration that was pre-monitored and recorded.

[0149] In one embodiment, the computer program is executed by a processor to implement, upon receiving a response message from the distributed file system, upgrading any secondary volume corresponding to the distributed file system primary volume to a new distributed file system primary volume, and further implementing the following steps: adding a new secondary volume corresponding to the distributed file system primary volume.

[0150] In one embodiment, the computer program executed by the processor also implements the following steps: obtaining third information corresponding to the new persistent volume declaration; and when it is determined based on the third information that the new persistent volume declaration is successfully established, sending second indication information to the distributed cluster, wherein the second indication information is used to indicate deletion of the persistent volume declaration.

[0151] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: monitoring the current management unit in the distributed cluster and recording fourth information corresponding to the current management unit; when it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or that the distributed cluster cannot bind the persistent volume declaration to the new management unit, determining that the current management unit in the distributed cluster is abnormal.

[0152] In one embodiment, the computer program is executed by a processor to monitor the current management unit in the distributed cluster, and before recording the fourth information corresponding to the current management unit, the following steps are also implemented: when it is determined that the application service is deployed in the distributed cluster, based on the configuration file corresponding to the application service, a persistent volume, a persistent volume declaration, and the current management unit are created; the persistent volume declaration is associated with the persistent volume; and the persistent volume declaration is associated with the current management unit.

[0153] It should be noted that the data involved in this application (including but not limited to the first information, second information, third information and fourth information, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0154] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a distributed file system management unit storage method logic based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0155] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0156] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A management unit storage method based on a distributed file system, characterized in that: Applied to a working node in which a monitoring component is deployed in a distributed cluster, wherein a distributed file system is also deployed in the distributed cluster, the method includes: When it is determined that the current management unit in the distributed cluster is abnormal, and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold, an instruction to delete the persistent volume declaration is sent to the distributed cluster; the duration refers to the duration between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster; Creating a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance; Bind the new persistent volume declaration to the distributed file system primary volume on which the persistent volume declaration depends, and establish an association between the new persistent volume declaration and the new management unit so that the distributed cluster resumes the service of the new management unit based on the new persistent volume declaration.

2. The method according to claim 1, characterized in that The method further comprises: Monitoring the distributed file system primary volume and one or more secondary volumes corresponding to the distributed file system primary volume; In the case of determining that the primary volume of the distributed file system fails, sending first indication information to the distributed file system, wherein the first indication information is used to instruct to store the data in the primary volume of the distributed file system into each of the secondary volumes; Upon receiving a response message from the distributed file system, upgrading any one of the secondary volumes corresponding to the distributed file system primary volume to a new distributed file system primary volume; the new distributed file system primary volume is used for use by the new persistent volume; Among them, the response message is used to indicate that the data in the distributed file system primary volume has been stored in each of the secondary volumes; the new persistent volume is associated with the new persistent volume declaration; and the new persistent volume is created based on the second information corresponding to the persistent volume associated with the persistent volume declaration recorded in advance.

3. The method according to claim 2, characterized in that After the response message from the distributed file system is received and any one of the secondary volumes corresponding to the primary volume of the distributed file system is upgraded to a new primary volume of the distributed file system, the method further includes: Add a secondary volume corresponding to the new distributed file system primary volume.

4. The method according to claim 3, characterized in that The method further comprises: Obtain third information corresponding to the new persistent volume declaration; In a case where it is determined based on the third information that the new persistent volume declaration is successfully established, second indication information is sent to the distributed cluster, where the second indication information is used to instruct deletion of the persistent volume declaration.

5. The method according to claim 1, characterized in that The method further comprises: Monitoring a current management unit in the distributed cluster, and recording fourth information corresponding to the current management unit; When it is determined that the fourth information indicates that the persistent volume declaration associated with the current management unit cannot be unbound in the distributed cluster, or the distributed cluster cannot bind the persistent volume declaration to a new management unit, it is determined that the current management unit in the distributed cluster is abnormal.

6. The method according to claim 5, characterized in that Before monitoring the current management unit in the distributed cluster and recording the fourth information corresponding to the current management unit, the method further includes: In the case where it is determined that the application service is deployed in the distributed cluster, based on the configuration file corresponding to the application service, the persistent volume, the persistent volume declaration and the current management unit are created; the persistent volume declaration is associated with the persistent volume; Associate the persistent volume claim with the current management unit.

7. A management unit storage device based on a distributed file system, characterized in that: Applied to a working node in which a monitoring component is deployed in a distributed cluster, wherein a distributed file system is also deployed in the distributed cluster, the device comprises: A sending module, configured to send an instruction to the distributed cluster to delete the persistent volume declaration when it is determined that the current management unit in the distributed cluster is abnormal and the duration of the current management unit unbinding the persistent volume declaration associated with it exceeds a preset time threshold; the duration refers to the duration between the unbinding moment and the current moment; the management unit refers to a schedulable unit on the distributed cluster; A creation module, configured to create a new persistent volume declaration based on the first information corresponding to the persistent volume declaration recorded in advance; A processing module is used to bind the new persistent volume declaration to the distributed file system primary volume on which the persistent volume declaration depends, and to establish an association between the new persistent volume declaration and the new management unit so that the distributed cluster can restore the service of the new management unit based on the new persistent volume declaration.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Kafka cluster fault recovery method, device, equipment and medium

    CN111752759A

  • Method and device for creating persistent data volume and server

    CN114253459A

  • Resource binding method and device and electronic equipment

    CN116700626A

  • Business cluster instance backup and recovery method and related equipment

    CN117909020A

  • Storage processing method and related device

    CN118051166A