Snapshot processing method and device based on dual-live volume and computer related equipment
By creating storage templates and snapshot templates in the dual-live volume system, and judging and processing snapshot creation of dual-live volumes, the problem of insufficient snapshot management of dual-live volumes in the existing technology is solved, and data reliability and redundancy protection are improved. High availability and business continuity are achieved.
Patent Information
- Application Number
- CN202411327308.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-07
AI Technical Summary
The prior art cannot effectively manage snapshots of active volumes, resulting in insufficient reliability of data volume snapshot processing.
Provide a snapshot processing method based on dual-live volumes. By creating storage templates, persistent volumes and snapshot templates, obtaining attribute information of the target dual-live volume, and determining whether it is a target data volume. If it is a target data volume, create a snapshot. If it is a non-target data volume, it is considered to be a failure and creates a snapshot on the secondary volume, establishes a remote replication relationship between the primary volume and the secondary volume, and realizes redundant backup and failover of data.
Improves the reliability of dual live volumes and data redundancy protection, ensuring that data can be automatically switched and recovered in case of failure, meeting the needs of high availability and business continuity.
Smart Images

Figure CN119271132A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a snapshot processing method and device based on dual-active volumes, and computer-related equipment. Background Art
[0002] The active-active storage system has two storage pools working simultaneously. The primary volume and auxiliary volume of each active-active volume are created on the two storage pools respectively. The CSI (Container Storage Interface) plug-in in the prior art can only manage snapshots of ordinary volumes, create and delete snapshots of ordinary volumes, and cannot effectively manage snapshots of active-active volumes. Summary of the invention
[0003] Based on this, it is necessary to provide a snapshot processing method, device and computer-related equipment based on dual-active volumes that can improve the reliability of data volume snapshot processing in order to address the above technical problems.
[0004] In order to solve the above technical problems, in a first aspect, a snapshot processing method based on a dual-active volume is provided, the method comprising:
[0005] In response to receiving the active-active volume creation instruction, creating a storage template, the storage template including preset parameters;
[0006] Create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration;
[0007] Create a snapshot template, which includes a snapshot template name;
[0008] Create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration;
[0009] Mount the active-active volume on the container based on the storage template, persistent volume, persistent volume declaration, snapshot template, snapshot volume, and snapshot volume declaration, so that the container has the right to use the active-active volume.
[0010] In response to receiving an instruction to create a snapshot of a target active-active volume, acquiring attribute information of the target active-active volume;
[0011] Determine whether the target active-active volume is a target data volume based on the storage template and the target active-active volume attribute information;
[0012] If the target active-active volume is a target data volume, create a snapshot for the target data volume;
[0013] If the target active-active volume is not a target data volume, the target data volume is considered to be faulty, and a snapshot is created for the target data volume's secondary volume.
[0014] In one embodiment, before obtaining the attribute information of the target active-active volume, the method further includes:
[0015] Obtain the type of storage pool corresponding to the target active-active volume based on preset parameters;
[0016] If the type of the storage pool corresponding to the target active-active volume is an active-active storage pool, the attribute information of the target active-active volume in the active-active storage pool is obtained.
[0017] In one embodiment, the method further comprises:
[0018] Obtain the first storage system and the second storage system, and add the first storage system to the cluster corresponding to the second storage system;
[0019] Modify the topology of the total storage system formed by the first storage system and the second storage system into an active-active topology;
[0020] The data volume in the second storage system is used as the primary volume, and a secondary volume is created in the first storage system. The format information of the secondary volume is consistent with that of the primary volume.
[0021] Establish a remote replication relationship between the primary volume and the secondary volume so that the primary volume and the secondary volume form an active-active volume.
[0022] In one embodiment, the method further comprises:
[0023] Creating a primary volume change volume corresponding to the primary volume in the second storage system, where the primary volume change volume is used to back up the snapshot stored in the primary volume;
[0024] Creating a secondary volume change volume corresponding to the secondary volume in the first storage system, where the secondary volume change volume is used to back up the snapshot stored in the primary volume;
[0025] Establish a remote replication relationship between the primary volume change volume and the secondary volume change volume.
[0026] In one embodiment, the method further comprises:
[0027] In response to receiving the snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time;
[0028] In response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume;
[0029] In response to the auxiliary volume receiving the data in the buffer, obtaining a second confirmation identifier issued by the auxiliary volume;
[0030] In response to receiving a first confirmation identifier issued by the master volume, generating a first time tag;
[0031] In response to receiving a second confirmation identifier issued by the auxiliary volume, generating a second time tag;
[0032] The time information of the first time tag and the second time tag are consistent.
[0033] In one embodiment, the method further comprises:
[0034] In response to detecting that a failure occurs in any of the active-active volumes, a failure notification is triggered, and the failure notification is sent to the target active-active volume, where the failure notification carries target task information;
[0035] In response to the target active-active volume obtaining a fault notification, the target active-active volume obtains the to-be-processed data from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification;
[0036] The target active-active volume executes the target task based on the target task information and the data to be processed.
[0037] In one embodiment, the method further comprises:
[0038] Monitor the write cache status and memory status of the primary volume and the secondary volume respectively;
[0039] In response to the state of the write cache of the primary volume being the target state and lasting for a first preset time period, prohibiting memory allocation of the primary volume and the secondary volume;
[0040] In response to the primary volume and the secondary volume memory allocation being prohibited, first marking the data written into the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume;
[0041] Reallocating memory for the first marked write data;
[0042] In response to memory reallocation of the first marked write data, obtaining a write cache state of the primary volume within a second preset time period as a target state;
[0043] Determining whether the write cache state of the primary volume meets the write cache standard according to the write cache state of the primary volume within the second preset time period;
[0044] If the write cache state of the primary volume meets the write cache standard, the first mark is deleted;
[0045] In response to the state of the write cache of the auxiliary volume being the target state and lasting for a first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by a second mark;
[0046] Reallocate memory for the second marked write data;
[0047] In response to memory reallocation of the write data with the second mark, obtaining a write cache state of the auxiliary volume within a second preset time period as a target state;
[0048] Determining whether the write cache state of the auxiliary volume meets the write cache standard according to the write cache state of the auxiliary volume within the second preset time period;
[0049] If the write cache status of the secondary volume meets the write cache standard, the second mark is deleted.
[0050] In order to solve the above technical problem, in a second aspect, a snapshot processing device based on a dual-active volume is provided, the device comprising:
[0051] A creation module, configured to create a storage template in response to receiving an active-active volume creation instruction, the storage template including preset parameters; create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration; create a snapshot template, the snapshot template including a snapshot template name; create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration; complete the active-active volume mounting on the container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the active-active volume;
[0052] The snapshot module is used to obtain the attribute information of the target active-active volume in response to receiving an instruction to create a snapshot of the target active-active volume; determine whether the target active-active volume is the target data volume based on the storage template and the attribute information of the target active-active volume; if the target active-active volume is the target data volume, create a snapshot of the target data volume; if the target active-active volume is not the target data volume, consider the target data volume to be faulty, and create a snapshot of the auxiliary volume of the target data volume.
[0053] In order to solve the above technical problem, a third aspect provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: the processor implements the steps of the above first aspect method when executing the computer program.
[0054] In order to solve the above technical problems, in a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the above first aspect are implemented.
[0055] Different from the prior art, the present application creates a storage template in response to receiving an active-active volume creation instruction, the storage template includes preset parameters; creates a persistent volume and a persistent volume declaration, and binds the persistent volume and the persistent volume declaration; creates a snapshot template, the snapshot template includes a snapshot template name; creates a snapshot volume and a snapshot volume declaration, and binds the snapshot volume and the snapshot volume declaration; completes the active-active volume mounting on the container according to the storage template, persistent volume, persistent volume declaration, snapshot template, snapshot volume and snapshot volume declaration, so that the container has the right to use the active-active volume; in response to receiving an instruction to create a snapshot of the target active-active volume, obtains the attribute information of the target active-active volume; determines whether the target active-active volume is the target data volume based on the storage template and the target active-active volume attribute information; if the target active-active volume is the target data volume, creates a snapshot for the target data volume; if the target active-active volume is a non-target data volume, it is considered that the target data volume is faulty, and the non-target data volume is used as the target data volume to create a snapshot. By setting the storage template persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume and the snapshot volume declaration to complete the dual-active volume mounting on the container, the container has the right to use the dual-active volume, and the dual-active volume is processed, the reliability of storing the dual-active volume can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 The figure is a flowchart of a snapshot processing method based on a dual-active volume in one embodiment;
[0057] Figure 2 It is a structural block diagram of a snapshot processing device based on dual-active volumes in one embodiment;
[0058] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] 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.
[0060] In one embodiment, Figure 1 As shown, a snapshot processing method based on a dual-active volume is provided, and the method includes the following steps:
[0061] Step 101: In response to receiving a dual-active volume creation instruction, create a storage template, where the storage template includes preset parameters.
[0062] Specifically, the snapshot processing method based on dual-active volumes in the present application is applied to the dual-active volume storage system, so the present application also includes: obtaining the first storage system and the second storage system, adding the first storage system to the cluster corresponding to the second storage system; modifying the topology of the total storage system constituted by the first storage system and the second storage system to an active-active topology; taking the data volume in the second storage system as the primary volume, creating a secondary volume in the first storage system, and the format information of the secondary volume is consistent with that of the primary volume; establishing a remote replication relationship between the primary volume and the secondary volume, so that the primary volume and the secondary volume constitute an active-active volume.
[0063] The first storage system can be a newly added storage system, and the second storage system can be an existing storage system. The overall topology of the first storage system and the second storage system is modified, and the topology of the total storage system composed of the two storage systems is changed to a dual-active topology. Based on the dual-active topology, the dual-active volume is established.
[0064] Specifically, the common volume located in the second storage system in the dual-active topology is set as the master volume of the dual-active volume to be established, and the properties of the common volume can be set as the master volume properties; a secondary volume is created in the first storage system in the dual-active topology, and the created secondary volume corresponds to the primary volume located in the second storage system, and when the secondary volume is created, the secondary volume has the same format information as the primary volume; after the secondary volume is established, it is necessary to establish a remote replication relationship between the primary volume and the secondary volume, and the remote replication relationship can enable the total storage system to realize the mutual backup of the data information stored in the primary volume and the data information stored in the secondary volume during operation, so as to ensure the security of the data information. When the remote replication relationship between the primary volume and the secondary volume is established, the dual-active volume consisting of the primary volume and the secondary volume can be obtained.
[0065] In one embodiment, a primary volume change volume corresponding to the primary volume is created in the second storage system, and the primary volume change volume is used to back up the snapshots stored in the primary volume; a secondary volume change volume corresponding to the secondary volume is created in the first storage system, and the secondary volume change volume is used to back up the snapshots stored in the primary volume; and a remote replication relationship between the primary volume change volume and the secondary volume change volume is established.
[0066] The primary volume can directly send the data information received and stored in the primary volume to the secondary volume for backup through the remote replication relationship between the primary volume and the secondary volume, and can also send the data information received and stored in the primary volume to the secondary volume for backup through the primary volume change volume and the secondary volume change volume. Specifically, the replication relationship between the primary volume and the primary volume change volume can be a snapshot relationship, and the replication relationship between the secondary volume and the secondary volume change volume can be a snapshot relationship, that is, the primary volume stores the data information after receiving the data information, and can also send the received data information to the primary volume change volume corresponding to the primary volume, the primary volume change volume can also send the received data information to the secondary volume change volume corresponding to the secondary volume, and the secondary volume change volume will then send the received data information to the secondary volume for storage, thereby realizing the backup of the data information in the primary volume to achieve redundant protection of the data information.
[0067] The active-active storage system provided in this application has a high availability function, and can access high-availability volumes at two different sites. If the node or storage device of any site is offline, the other online site maintains the latest data. The active-active storage system automatically implements failover and accesses the online copy. When the fault is restored, the active-active storage system automatically resynchronizes the two copies. The active-active storage system is suitable for application scenarios with high requirements for business continuity, high reliability, and support for multiple faults. The active-active storage function is based on a cluster storage system, and the primary volume and auxiliary volume of each active-active volume belong to two different read-write operation threads respectively. In the process of realizing data synchronization, the active-active storage system function adopts synchronous remote replication technology, change volume technology, and seamless data migration technology. The host, node, and storage all have the concept of Site, and the application obtains read and write resources from the node / storage on the local site. Each data volume that provides read and write access services consists of four volumes: 1 primary volume, 1 primary volume change volume, 1 auxiliary volume, and 1 auxiliary volume change volume. Normal read and write data flow: from the primary volume to the auxiliary volume. During a failover, the logical unit number is simulated on the secondary volume to achieve transparent access to upper-layer applications. InMetro uses synchronous replication to achieve data synchronization between the primary and secondary volumes of the active-active volume. Under normal circumstances, the primary volume provides data access services. The secondary volume is not mapped to the host and is normally in the offline state. The synchronous replication relationship cannot be started or stopped and is automatically controlled by the storage system.
[0068] Step 102: Create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration.
[0069] A persistent volume is a resource object in Kubernetes that is used to store persistent data. PV is a storage resource set by the administrator. It is not directly related to the Pod, but is dynamically bound through Persistent Volume Claim (PVC). PVC is a user's request for storage, and it can automatically bind the appropriate PV to the Pod according to the Pod's requirements.
[0070] In a Kubernetes cluster, persistent storage management is mainly achieved through persistent volumes (PV) and persistent volume claims (PVC). PV is a storage resource in the cluster, which is actively created and provided by the administrator or dynamically provided using StorageClass. It does not belong to any namespace and has its own life cycle. Users apply for the required storage resources through PVC. The relationship between PV and PVC can be understood as the relationship between supply and demand, that is, PV provides storage resources, and PVC is the user's demand statement for storage resources.
[0071] To establish a relationship between PV and PVC, the user first creates a PVC, specifies the required storage space and access mode, and then submits the PVC to the Kubernetes API server. Kubernetes will look for a matching PV and bind it to the PVC. This binding process ensures that users can use the storage resources provided by the PV through the PVC. Once the PV is successfully bound to the PVC, the Pod can use the storage resources by referencing the bound PVC12.
[0072] For example, when cluster users need to use persistent storage in their Pods, they first create a PVC, specifying the minimum capacity requirements and access mode required. After the user submits the PVC to the Kubernetes API server, Kubernetes finds a matching PV and binds it to the PVC. In this way, users can use the storage resources provided by the PV through the PVC2.
[0073] This mechanism makes the allocation and management of storage resources more flexible and efficient, and also simplifies the user's use of storage resources. Through the use of PV and PVC, Kubernetes can effectively manage the persistent storage needs in the cluster and ensure that Pods can continuously and reliably access the required storage resources.
[0074] Step 103: Create a snapshot template, where the snapshot template includes a snapshot template name.
[0075] A snapshot is a fully available copy of a specified data set, which includes an image of the corresponding data at a certain point in time. Snapshot technology is mainly used for data protection and recovery. It provides an instant copy of data by creating a mirror of a data set at a specific moment. This technology allows users to view the state of data at a specific point in time and restore it to that state when necessary, thereby reducing data loss. Snapshot templates are used to define snapshots.
[0076] Step 104: Create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration.
[0077] In Kubernetes, Volume Snapshot is a feature that allows users and database administrators to copy the contents of a volume at a specific point in time without creating a completely new volume. This feature is essential for backing up and restoring data, especially to ensure data security before performing modification operations (such as editing or deleting). To achieve this feature, Kubernetes introduces several key concepts and components:
[0078] VolumeSnapshot, VolumeSnapshotContent, and VolumeSnapshotClass: These are API resources in Kubernetes for creating and managing volume snapshots. VolumeSnapshot represents a user's request for a volume snapshot, similar to a PersistentVolumeClaim (PVC); VolumeSnapshotContent is the snapshot content obtained from a volume, and VolumeSnapshotClass allows you to specify different properties belonging to VolumeSnapshot.
[0079] Snapshot controller and csi-snapshotter: As part of the VolumeSnapshot deployment process, the Kubernetes team provides a snapshot controller deployed in the control plane and a sidecar auxiliary container called csi-snapshotter, which is deployed with the CSI driver. The snapshot controller monitors the VolumeSnapshot and VolumeSnapshotContent objects and is responsible for creating and deleting VolumeSnapshotContent objects. The sidecar csi-snapshotter monitors the VolumeSnapshotContent object to ensure the smooth progress of the snapshot process.
[0080] Volume snapshot usage scenarios: For example, a database administrator can back up a database before performing modifications such as editing or deleting. By using the volume snapshot function, data security can be ensured.
[0081] In addition, Container Storage provides a cloud-based volume management, deployment, and orchestration service that is built natively for containers. It supports creating snapshots of volumes and restoring them through new persistent volume claims, which is very important for managing and protecting data in cloud environments.
[0082] Step 105 , complete the dual-active volume mounting on the container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the dual-active volume.
[0083] This application declares some functional fields of the storage side, including volume name, pool name, etc., through configuration files such as storage template, persistent volume, persistent volume declaration, snapshot template, snapshot volume, and snapshot volume declaration, and applies for resources from the container through these fields.
[0084] If the container needs to take a snapshot of the active-active volume, the properties of the active-active volume and the snapshot are written to the storage template. The container can take a snapshot of the data volume in the active-active volume by calling the storage template, and store the snapshot on the storage. The storage here is independent of the data volume. In the active-active volume storage system, there is a storage pool. Some space in the storage pool is used to store data volumes. The data volumes are provided to the container. The container takes a snapshot of the data volume and stores the snapshot generated by the snapshot operation in the storage system.
[0085] The container in this application is a K8s container cluster. K8s stands for kubernetes, which is a portable container orchestration management tool for container services. The k8s cluster consists of a Master node and a Node (Worker) node. The Master node refers to the cluster control node, which manages and controls the entire cluster. Basically, all control commands of k8s are sent to it, and it is responsible for the specific execution process.
[0086] The main running processes on the Master are: Kubernetes Controller Manager (kube-controller-manager): the automated control center for all resource objects in k8s, maintaining and managing the status of the cluster, such as fault detection, automatic expansion, rolling updates, etc.
[0087] Kubernetes Scheduler (kube-scheduler): responsible for resource scheduling, scheduling Pods to the corresponding machines according to the predetermined scheduling strategy. etcd: saves the status of the entire cluster. Nodes other than the master are called Nodes or Worker nodes. Each Node will be assigned some workloads (Docker containers) by the Master. When a Node goes down, the workload on the node will be automatically transferred to other nodes by the Master. The main running on the Node: kubelet: responsible for the creation, start and stop of the container corresponding to the Pod, and closely cooperates with the Master to realize the basic functions of cluster management.
[0088] kube-proxy: implements service communication and load balancing. docker (Docker Engine): Docker engine, responsible for the creation and management of local containers.
[0089] The application in this application is an industry standard interface specification jointly developed by community members from Kubernetes, Mesos, Docker, etc., Container Storage Interface (CSI for short), which aims to expose any storage system to containerized applications. The main functions of the CSI plug-in are: providing industry standards so that storage vendors can develop a plug-in that meets the CSI standard; decoupling the container orchestration system from storage, connecting to systems such as Kubernetes, Cloud Foundry, Mesos, etc. upwards, and connecting to various storages downwards; providing persistent volume storage capabilities for the container orchestration system.
[0090] The K8s container cluster set up in this application can manage the active-active storage pool through the CSI plug-in and provide persistent active-active storage space for the K8s container cluster, which can greatly improve the data reliability of the K8s container cluster.
[0091] Before the CSI plug-in creates a storage snapshot, it needs to create a series of storage-related resources. The storage resources need to declare some configurations related to the active-active volume and snapshot. The steps for the CSI plug-in to create a storage active-active volume snapshot are as follows:
[0092] Create a storage template.
[0093] Create a PVC, which is a declaration of a persistent volume. Create a persistent volume PV and bind the PVC and PV.
[0094] Create VolumeSnapshotClass, which is the snapshot template.
[0095] Create VolumeSnapshot, that is, snapshot declaration, and create snapshot VolumeSnapshotContent at the same time, and bind VolumeSnapshot to VolumeSnapshotContent. Note that VolumeSnapshot is created based on PVC.
[0096] Specifically, when the CSI plug-in creates / deletes snapshots of volumes, the volLevel parameter is added to the storage template (SC) to indicate the storage pool type: active-active storage pool / normal storage pool; the volPoolName / volAuxPoolName parameters are added to indicate the primary / auxiliary storage pool name. The specific implementation process is as follows:
[0097] Create SC:
[0098] The sc.yaml example is as follows:
[0099] apiVersion:storage.k8s.io / v1
[0100] kind:StorageClass
[0101] metadata:
[0102] name:aa-sc
[0103] provisioner:csi-instorage
[0104] parameters:
[0105] devKind:block
[0106] volLevel:aa
[0107] volPoolName:Pool0
[0108] volAuxPoolName:Pool1
[0109] volIOGrp:io_grp0
[0110] volAuxIOGrp:io_grp1
[0111] reclaimPolicy:Delete
[0112] The meaning of the main parameters:
[0113] metadata.name: Storage Template (SC) name.
[0114] parameters.devName: storage name. Used to bind a storage, which is consistent with the name in the storage configuration file.
[0115] parameters.devKind: device type. You can choose block or share. Block represents block device, and share represents NAS device.
[0116] parameters.volPoolName: primary storage pool name;
[0117] parameters.volAuxPoolName: auxiliary storage pool name;
[0118] parameters.volIOGrp: main IO group name;
[0119] parameters.volAuxIOGrp: auxiliary IO group name;
[0120] Use the above configuration files to create sc in the container cluster.
[0121] Create a PVC:
[0122] The following is an example of pvc.yaml:
[0123] apiVersion:v1
[0124] kind:PersistentVolumeClaim
[0125] metadata:
[0126] name:aa-pvc
[0127] spec:
[0128] accessModes:
[0129] -ReadWriteOnce
[0130] volumeMode:Filesystem
[0131] resources:
[0132] requests:
[0133] storage:1Gi
[0134] storageClassName:aa-sc
[0135] The meaning of the main parameters:
[0136] metadata.name: PVC name.
[0137] spec.accessModes: access mode. You can choose ReadWriteOnce, ReadWriteMany or ReadOnlyMany. ReadWriteOnce means single-node read and write, ReadWriteMany means multi-node read and write, and ReadOnlyMany means multi-node read-only.
[0138] spec.volumeMode: Volume mode. You can choose Filesystem or Block. Filesystem means the volume is mounted as a file system (formatted), and Block means the volume is mounted as a raw device (not formatted).
[0139] spec.resources.request.storage: Volume size.
[0140] spec.storageClassName: SC name. Used to bind a certain SC.
[0141] Use the above configuration files to create a PVC in the container cluster.
[0142] Create VolumeSnapshotClass:
[0143] The vsc.yaml example is as follows:
[0144] kind:VolumeSnapshotClass
[0145] metadata:
[0146] name:snapshotter-aa-vsc
[0147] snapshotter:csi-instorage
[0148] The meaning of the main parameters:
[0149] metadata.name: VolumeSnapshotClass name.
[0150] snapshotter: Driver name. The default value is csi-instorage.
[0151] Use the above configuration file to create volumesnapshotclass in the container cluster.
[0152] Create VolumeSnapshot:
[0153] The vs.yaml example is as follows:
[0154] apiVersion:VolumeSnapshot
[0155] kind:VolumeSnapshot
[0156] metadata:
[0157] name:snapshotter-aa-vs
[0158] spec:
[0159] snapshotClassName:snapshotter-aa-vsc
[0160] source:
[0161] name:aa-pvc
[0162] kind:PersistentVolumeClaim
[0163] The meaning of the main parameters:
[0164] metadata.name: VolumeSnapshot name.
[0165] snapshotClassName: snapshot template name.
[0166] source.name: data source PVC name.
[0167] source.kind: data type, here is PVC.
[0168] Use the above configuration file to create volumesnapshot in the container cluster.
[0169] In this application, when creating an active-active volume snapshot, the parameters related to the active-active volume and their corresponding meanings are specified: volPoolName / volAuxPoolName, etc.; in the SC, PVC, VSC and other configuration files of the CSI plug-in to create the active-active volume snapshot, the unique configuration parameters and definition methods related to the active-active volume snapshot are used to complete the mounting of the active-active volume on the K8s container, so as to realize the precise control of the active-active volume by the container.
[0170] Step 106 : in response to receiving the instruction to create a snapshot of the target active-active volume, obtaining attribute information of the target active-active volume.
[0171] In one embodiment, before obtaining the attribute information of the target active-active volume, the method further includes: obtaining the type of storage pool corresponding to the target active-active volume according to preset parameters; if the type of storage pool corresponding to the target active-active volume is an active-active storage pool, obtaining the attribute information of the target active-active volume in the active-active storage pool. That is, before obtaining the attribute information of the target active-active volume, it is also necessary to determine whether the storage pool corresponding to the current target active-active volume is an active-active storage pool or an ordinary storage pool. Only when the storage pool corresponding to the target active-active volume is an active-active storage pool, can the attribute information of the target active-active volume in the active-active storage pool be obtained. The preset parameter here refers to the active-active pool type parameter, and the type of storage pool corresponding to the target active-active volume is determined according to the active-active pool type parameter.
[0172] Step 107: Determine whether the target active-active volume is a target data volume based on the storage template and the target active-active volume attribute information.
[0173] After the attribute information of the target active-active volume is obtained through step 106, it can be determined whether the target active-active volume is the target data volume based on the attribute information of the target active-active volume. Here, the target data volume is the master volume. First, the corresponding name information of the target active-active volume is obtained, and then the name information of the master volume is obtained from the storage template. If the corresponding name information of the target active-active volume is inconsistent with the name information of the master volume obtained from the storage template, it means that the type of the target active-active volume has changed. The reason for the change may be that the target active-active volume is the primary auxiliary volume. When the original master volume fails, the primary auxiliary volume, that is, the target active-active volume, is used as the primary volume to continue the operation.
[0174] Step 108: If the target active-active volume is a target data volume, a snapshot is created for the target data volume.
[0175] Step 109: If the target active-active volume is a non-target data volume, the target data volume is considered to be faulty, and a snapshot is created for the auxiliary volume of the target data volume.
[0176] If the corresponding name information of the target active-active volume is consistent with the name information of the primary volume obtained from the storage template, a snapshot is directly created for the target data volume. If the target active-active volume is a non-target data volume, the target data volume is considered to be faulty, and a snapshot is created using the non-target data volume as the target data volume.
[0177] In a specific implementation, when the CSI plug-in creates a snapshot operation for the active-active volume, it is necessary to first confirm the storage volume marked as the primary volume in the active-active volume, and then create a snapshot operation for the volume. To achieve this function, a Boolean primary volume identification field is added to the active-active volume information: such as primary, the value and meaning can be true: the current volume is the primary volume and false: the backup volume of the current volume is the primary volume.
[0178] In this implementation, when obtaining the active-active volume information, it is determined whether the primary pool identification field of the current volume is true; if it is true, the current volume is the primary volume, and a snapshot operation is performed on the volume; if it is not true, the backup volume of the current volume is the primary volume, and a snapshot operation is performed on the backup volume. Create an active-active volume snapshot, and the process ends;
[0179] This application proposes a method for implementing the management of active-active volume snapshots based on CSI plug-ins in a K8s cluster. Through this method, the K8s cluster can create / delete active-active volume snapshots through the CSI plug-in, which can improve the reliability of storing active-active volumes; when the K8s cluster container is mounted and uses active-active volumes, the reliability of container data can also be greatly improved.
[0180] In one embodiment, the method also includes: in response to receiving a snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time; in response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume; in response to the secondary volume receiving the data in the cache, obtaining a second confirmation identifier issued by the secondary volume; in response to receiving the first confirmation identifier issued by the primary volume, generating a first time tag; in response to receiving the second confirmation identifier issued by the secondary volume, generating a second time tag; the time information of the first time tag and the second time tag are consistent.
[0181] If the application system contains multiple active-active volumes and the application system has consistency requirements for the data in the data volumes, you need to configure the active-active volumes into a snapshot consistency group and mark the synchronization quantity, synchronization requirements, and application information of the volumes in the snapshot consistency group to facilitate subsequent management.
[0182] When the storage triggers a snapshot operation, the CSI plug-in receives the information to create a snapshot and performs IO (input and output) quiescence on the application. At this time, the application will not be able to read and write for a short time. The host plug-in flushes the written data in the memory to the storage. Record the data received by the active-active volume and determine whether the confirmation characters issued by the two storages are received. After the storage receives the completion of the cache flush, the active-active snapshot module will record the information of the storage active-active volume flush, and wait for the active-active volume storage systems of the active-active to complete the write and feedback ACK (Acknowledge character, confirmation character) information. In response to receiving the confirmation characters issued by the two storages, a snapshot data pointer table is created based on the recorded data. After receiving the ACK information, the active-active snapshot creates a snapshot data pointer table. The snapshot data pointer table is synchronized to the two storages to form a snapshot volume. The snapshot data pointer table can be synchronized to the two active-active storages. At this time, the snapshot has been completed, the snapshot time nodes on the two active-active storage devices are consistent, and the snapshot data pointer table is consistent.
[0183] In one embodiment, the present application also includes real-time checking whether the snapshot data pointer table in the active-active volume storage system is synchronized. The snapshot data pointer table of the active-active volume storage system will also be synchronized and checked to check in real time whether the data stored in the active-active volume is consistent. In some embodiments, it also includes the possibility of tuning when there are multiple active-active volumes. If an application uses multiple active-active volume storage systems, the data volumes allocated to the host need to be differentiated, and the host plug-in performs targeted tuning. When there are multiple active-active volume storage systems, different storage can be divided so that they do not affect each other when creating active-active snapshots. This ensures that the entire system runs efficiently without affecting the performance of the application, reduces the operations of the implementation personnel, and improves the availability of the entire system.
[0184] In one embodiment, when any active-active volume in an active-active volume system fails, a fault notification is triggered and sent to a target active-active volume, the fault notification carrying target task information; in response to the target active-active volume obtaining the fault notification, the target active-active volume obtains the data to be processed from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification; the target active-active volume executes the target task based on the target task information and the data to be processed.
[0185] In this application, when any dual-active volume fails while executing a target task, a fault notification will be triggered. The fault notification can be a display interface prompting fault information or a sound alarm, so as to inform the operator in time, so that the operator can troubleshoot and maintain the fault. When another dual-active volume fails and receives the fault notification, the fault notification will be parsed to obtain the data to be processed. The other dual-active volume executes the target task on the other dual-active volume based on the data to be processed, so as to ensure the normal execution of the target task when a failure occurs.
[0186] In one embodiment, in response to the state of the write cache of the primary volume being a target state and lasting for a first preset time, memory allocation of the primary volume and the auxiliary volume is prohibited; in response to the memory allocation of the primary volume and the auxiliary volume being prohibited, data written to the data storage space corresponding to the primary volume and the data storage space corresponding to the auxiliary volume are first marked; memory is reallocated for the write data marked with the first mark; in response to the memory reallocation for the write data marked with the first mark, the write cache state of the primary volume within a second preset time is obtained as a target state; based on the write cache state of the primary volume within the second preset time, it is determined whether the write cache state of the primary volume meets the write cache standard; if the write cache state of the primary volume meets the write cache standard, If the write cache standard is not met, the first mark is deleted; in response to the state of the write cache of the auxiliary volume being the target state and lasting for the first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by the second mark; the memory is reallocated for the write data with the second mark; in response to the memory reallocation for the write data with the second mark, the write cache state of the auxiliary volume within the second preset time is obtained as the target state; according to the write cache state of the auxiliary volume within the second preset time, it is determined whether the write cache state of the auxiliary volume meets the write cache standard; if the write cache state of the auxiliary volume meets the write cache standard, the second mark is deleted.
[0187] Specifically, if it is detected that the write cache of the primary volume is full for 10 seconds, other applications or other data storage services are prohibited from using the memory through the memory monitoring program, and the write data from the host is continuously received. After receiving the write data sent by the host, it is no longer cached in the primary volume, but the received write data of the host is stored in the memory of the primary volume and the auxiliary volume respectively according to the ratio of the free memory of the primary volume and the auxiliary volume, and the addresses of these write data in the memory are added to the write data temporary cache table, and the write data in the memory is marked through the write data temporary cache table.
[0188] Specifically, when the write cache of the primary volume is full, the write cache of the secondary volume is almost full, because in the active-active storage system, the data of the write cache of the primary volume and the write cache of the secondary volume are synchronized in real time. At this time, other applications on the storage server system of the primary and secondary volumes are prohibited from allocating memory, for example, the primary and secondary volumes are prohibited from performing data snapshots and other operations. The write data sent from the host end is fully received, and the write data is allocated according to the ratio of the remaining memory space of the primary and secondary volumes. For example, at this time, the primary volume memory has 2GB remaining, and the secondary volume memory has 1GB remaining, then the write data is allocated to the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume in a ratio of 2:1, that is, the primary volume sends part of the write data to the secondary volume. After the secondary volume receives this part of the write data, the address of the write data in its respective memory is added to the write data temporary cache table as a mark. When the status of the write cache of the primary volume and the secondary volume is restored to idle, the data corresponding to the memory address in the write data temporary cache table in the primary volume is sent to the secondary volume, and the data corresponding to the memory address in the write data temporary cache table in the secondary volume is sent to the primary volume, so as to realize the two-way backup transmission of data.
[0189] If, in some cases, such as when the secondary volume performs a data snapshot operation, the speed of writing data to the disk is affected, resulting in the data in the secondary volume write cache not being written to the disk in a timely and effective manner, and the secondary volume write cache being unable to receive the write data from the secondary volume, it may eventually affect the data writing of the primary volume, because the data consistency of the primary and secondary volumes must be guaranteed. In this case, on the primary volume side, you can stop sending write data to the secondary volume, and add the address of the write data in the write cache to the temporary cache table of the secondary volume write data in the primary volume memory as a mark.
[0190] After stopping sending write data to the auxiliary volume, the primary volume continues to write the write data in the write cache to the disk. At the same time, the cleanup work of the write data written to the disk in the memory under normal circumstances is canceled. That is, the write data is temporarily saved in the memory, and the addresses of the write data in the memory are added to the auxiliary volume write data temporary cache table in the primary volume memory as a mark. Further, a certain amount of memory is reallocated to the write cache space of the primary volume.
[0191] If within the second preset time period, the write cache of the auxiliary volume is always full and it is difficult to receive write data from the primary volume, and the memory space usage rate of the primary volume is high, the data in the address space recorded in the temporary cache table of the auxiliary volume write data located in the primary volume memory that has not been cleared in the memory will be cleared.
[0192] In this embodiment, when the write cache of the master volume is exhausted and the storage server of the master volume and the storage server of the slave volume have prohibited other applications from allocating memory space, the master volume, when receiving the write data sent from the host, will divide the write data equally, write a part of it into the memory of the master volume, and add its memory address to the write data temporary cache table. The write data is sent to the slave volume, written into the memory of the slave volume, and the specific memory address is saved in the write data temporary cache table located in the slave volume. When the use status of the master volume cache and the slave volume cache is restored to idle, the data corresponding to the data address recorded in the write data temporary cache table in the master volume memory is sent to the slave volume, and at the same time, the data at the slave volume memory address recorded in the write data temporary cache table of the slave volume is sent to the master volume. Rapidly realize the two-way backup of data.
[0193] It should be understood that although Figure 1 The steps in the flowchart 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 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0194] In one embodiment, Figure 2 As shown, a snapshot processing device based on a dual-active volume is provided, comprising: a creation module 20 and a snapshot module 21, wherein:
[0195] A creation module, configured to create a storage template in response to receiving an active-active volume creation instruction, the storage template including preset parameters; create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration; create a snapshot template, the snapshot template including a snapshot template name; create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration; complete the active-active volume mounting on the container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the active-active volume;
[0196] The snapshot module is used to obtain the attribute information of the target active-active volume in response to receiving an instruction to create a snapshot of the target active-active volume; determine whether the target active-active volume is the target data volume based on the storage template and the attribute information of the target active-active volume; if the target active-active volume is the target data volume, create a snapshot of the target data volume; if the target active-active volume is not the target data volume, consider the target data volume to be faulty, and create a snapshot of the auxiliary volume of the target data volume.
[0197] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0198] Before obtaining the attribute information of the target active-active volume, the following steps are also required:
[0199] Obtain the type of storage pool corresponding to the target active-active volume based on preset parameters;
[0200] If the type of the storage pool corresponding to the target active-active volume is an active-active storage pool, the attribute information of the target active-active volume in the active-active storage pool is obtained.
[0201] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0202] Obtain the first storage system and the second storage system, and add the first storage system to the cluster corresponding to the second storage system;
[0203] Modify the topology of the total storage system formed by the first storage system and the second storage system into an active-active topology;
[0204] The data volume in the second storage system is used as the primary volume, and a secondary volume is created in the first storage system. The format information of the secondary volume is consistent with that of the primary volume.
[0205] Establish a remote replication relationship between the primary volume and the secondary volume so that the primary volume and the secondary volume form an active-active volume.
[0206] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0207] The method also includes:
[0208] Creating a primary volume change volume corresponding to the primary volume in the second storage system, where the primary volume change volume is used to back up the snapshot stored in the primary volume;
[0209] Creating a secondary volume change volume corresponding to the secondary volume in the first storage system, where the secondary volume change volume is used to back up the snapshot stored in the primary volume;
[0210] Establish a remote replication relationship between the primary volume change volume and the secondary volume change volume.
[0211] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0212] The method also includes:
[0213] In response to receiving the snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time;
[0214] In response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume;
[0215] In response to the auxiliary volume receiving the data in the buffer, obtaining a second confirmation identifier issued by the auxiliary volume;
[0216] In response to receiving a first confirmation identifier issued by the master volume, generating a first time tag;
[0217] In response to receiving a second confirmation identifier issued by the auxiliary volume, generating a second time tag;
[0218] The time information of the first time tag and the second time tag are consistent.
[0219] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0220] The method also includes:
[0221] In response to detecting that a failure occurs in any of the active-active volumes, a failure notification is triggered, and the failure notification is sent to the target active-active volume, where the failure notification carries target task information;
[0222] In response to the target active-active volume obtaining a fault notification, the target active-active volume obtains the to-be-processed data from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification;
[0223] The target active-active volume executes the target task based on the target task information and the data to be processed.
[0224] In one embodiment, another implementation of the snapshot processing method based on the dual-active volume that can be implemented by the above device includes the following specific steps:
[0225] Monitor the write cache status and memory status of the primary volume and the secondary volume respectively;
[0226] In response to the state of the write cache of the primary volume being the target state and lasting for a first preset time period, prohibiting memory allocation of the primary volume and the secondary volume;
[0227] In response to the primary volume and the secondary volume memory allocation being prohibited, first marking the data written into the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume;
[0228] Reallocating memory for the first marked write data;
[0229] In response to memory reallocation of the first marked write data, obtaining a write cache state of the primary volume within a second preset time period as a target state;
[0230] Determining whether the write cache state of the primary volume meets the write cache standard according to the write cache state of the primary volume within the second preset time period;
[0231] If the write cache state of the primary volume meets the write cache standard, the first mark is deleted;
[0232] In response to the state of the write cache of the auxiliary volume being the target state and lasting for a first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by a second mark;
[0233] Reallocate memory for the second marked write data;
[0234] In response to memory reallocation of the write data with the second mark, obtaining a write cache state of the auxiliary volume within a second preset time period as a target state;
[0235] Determining whether the write cache state of the auxiliary volume meets the write cache standard according to the write cache state of the auxiliary volume within the second preset time period;
[0236] If the write cache status of the secondary volume meets the write cache standard, the second mark is deleted.
[0237] For the specific definition of the snapshot processing device based on dual-active volumes, please refer to the definition of the snapshot processing method based on dual-active volumes in the above text, which will not be repeated here. Each module in the above-mentioned snapshot processing device based on dual-active volumes 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.
[0238] In one embodiment, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the snapshot processing method based on the active-active volume provided by the above methods.
[0239] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data applied by the snapshot processing method based on dual-active volumes. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a snapshot processing method based on dual-active volumes is implemented.
[0240] Those skilled in the art will understand that Figure 3 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.
[0241] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0242] Step 101: In response to receiving a dual-active volume creation instruction, create a storage template, where the storage template includes preset parameters.
[0243] Step 102: Create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration.
[0244] Step 103: Create a snapshot template, where the snapshot template includes a snapshot template name.
[0245] Step 104: Create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration.
[0246] Step 105 , complete the dual-active volume mounting on the container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the dual-active volume.
[0247] Step 106 : in response to receiving the instruction to create a snapshot of the target active-active volume, obtaining attribute information of the target active-active volume.
[0248] Step 107: Determine whether the target active-active volume is a target data volume based on the storage template and the target active-active volume attribute information.
[0249] Step 108: If the target active-active volume is a target data volume, a snapshot is created for the target data volume.
[0250] Step 109: If the target active-active volume is a non-target data volume, the target data volume is considered to be faulty, and a snapshot is created for the auxiliary volume of the target data volume.
[0251] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0252] Before obtaining the attribute information of the target active-active volume, the following steps are also required:
[0253] Obtain the type of storage pool corresponding to the target active-active volume based on preset parameters;
[0254] If the type of the storage pool corresponding to the target active-active volume is an active-active storage pool, the attribute information of the target active-active volume in the active-active storage pool is obtained.
[0255] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0256] The method also includes:
[0257] Obtain the first storage system and the second storage system, and add the first storage system to the cluster corresponding to the second storage system;
[0258] Modify the topology of the total storage system formed by the first storage system and the second storage system into an active-active topology;
[0259] The data volume in the second storage system is used as the primary volume, and a secondary volume is created in the first storage system. The format information of the secondary volume is consistent with that of the primary volume.
[0260] Establish a remote replication relationship between the primary volume and the secondary volume so that the primary volume and the secondary volume form an active-active volume.
[0261] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0262] The method also includes:
[0263] Creating a primary volume change volume corresponding to the primary volume in the second storage system, where the primary volume change volume is used to back up the snapshot stored in the primary volume;
[0264] Creating a secondary volume change volume corresponding to the secondary volume in the first storage system, where the secondary volume change volume is used to back up the snapshot stored in the primary volume;
[0265] Establish a remote replication relationship between the primary volume change volume and the secondary volume change volume.
[0266] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0267] The method also includes:
[0268] In response to receiving the snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time;
[0269] In response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume;
[0270] In response to the auxiliary volume receiving the data in the buffer, obtaining a second confirmation identifier issued by the auxiliary volume;
[0271] In response to receiving a first confirmation identifier issued by the master volume, generating a first time tag;
[0272] In response to receiving a second confirmation identifier issued by the auxiliary volume, generating a second time tag;
[0273] The time information of the first time tag and the second time tag are consistent.
[0274] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0275] The method also includes:
[0276] In response to detecting that a failure occurs in any of the active-active volumes, a failure notification is triggered, and the failure notification is sent to the target active-active volume, where the failure notification carries target task information;
[0277] In response to the target active-active volume obtaining a fault notification, the target active-active volume obtains the to-be-processed data from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification;
[0278] The target active-active volume executes the target task based on the target task information and the data to be processed.
[0279] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0280] The method also includes:
[0281] Monitor the write cache status and memory status of the primary volume and the secondary volume respectively;
[0282] In response to the state of the write cache of the primary volume being the target state and lasting for a first preset time period, prohibiting memory allocation of the primary volume and the secondary volume;
[0283] In response to the primary volume and the secondary volume memory allocation being prohibited, first marking the data written into the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume;
[0284] Reallocating memory for the first marked write data;
[0285] In response to memory reallocation of the first marked write data, obtaining a write cache state of the primary volume within a second preset time period as a target state;
[0286] Determining whether the write cache state of the primary volume meets the write cache standard according to the write cache state of the primary volume within the second preset time period;
[0287] If the write cache state of the primary volume meets the write cache standard, the first mark is deleted;
[0288] In response to the state of the write cache of the auxiliary volume being the target state and lasting for a first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by a second mark;
[0289] Reallocate memory for the second marked write data;
[0290] In response to memory reallocation of the write data with the second mark, obtaining a write cache state of the auxiliary volume within a second preset time period as a target state;
[0291] Determining whether the write cache state of the auxiliary volume meets the write cache standard according to the write cache state of the auxiliary volume within the second preset time period;
[0292] If the write cache status of the secondary volume meets the write cache standard, the second mark is deleted.
[0293] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0294] Step 101: In response to receiving a dual-active volume creation instruction, create a storage template, where the storage template includes preset parameters.
[0295] Step 102: Create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration.
[0296] Step 103: Create a snapshot template, where the snapshot template includes a snapshot template name.
[0297] Step 104: Create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration.
[0298] Step 105 , complete the dual-active volume mounting on the container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the dual-active volume.
[0299] Step 106 : in response to receiving the instruction to create a snapshot of the target active-active volume, obtaining attribute information of the target active-active volume.
[0300] Step 107: Determine whether the target active-active volume is a target data volume based on the storage template and the target active-active volume attribute information.
[0301] Step 108: If the target active-active volume is a target data volume, a snapshot is created for the target data volume.
[0302] Step 109: If the target active-active volume is a non-target data volume, the target data volume is considered to be faulty, and a snapshot is created for the auxiliary volume of the target data volume.
[0303] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0304] Before obtaining the attribute information of the target active-active volume, the following steps are also required:
[0305] Obtain the type of storage pool corresponding to the target active-active volume based on preset parameters;
[0306] If the type of the storage pool corresponding to the target active-active volume is an active-active storage pool, the attribute information of the target active-active volume in the active-active storage pool is obtained.
[0307] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0308] The method also includes:
[0309] Obtain the first storage system and the second storage system, and add the first storage system to the cluster corresponding to the second storage system;
[0310] Modify the topology of the total storage system formed by the first storage system and the second storage system into an active-active topology;
[0311] The data volume in the second storage system is used as the primary volume, and a secondary volume is created in the first storage system. The format information of the secondary volume is consistent with that of the primary volume.
[0312] Establish a remote replication relationship between the primary volume and the secondary volume so that the primary volume and the secondary volume form an active-active volume.
[0313] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0314] The method also includes:
[0315] Creating a primary volume change volume corresponding to the primary volume in the second storage system, where the primary volume change volume is used to back up the snapshot stored in the primary volume;
[0316] Creating a secondary volume change volume corresponding to the secondary volume in the first storage system, where the secondary volume change volume is used to back up the snapshot stored in the primary volume;
[0317] Establish a remote replication relationship between the primary volume change volume and the secondary volume change volume.
[0318] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0319] The method also includes:
[0320] In response to receiving the snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time;
[0321] In response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume;
[0322] In response to the auxiliary volume receiving the data in the buffer, obtaining a second confirmation identifier issued by the auxiliary volume;
[0323] In response to receiving a first confirmation identifier issued by the master volume, generating a first time tag;
[0324] In response to receiving a second confirmation identifier issued by the auxiliary volume, generating a second time tag;
[0325] The time information of the first time tag and the second time tag are consistent.
[0326] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0327] The method also includes:
[0328] In response to detecting that a failure occurs in any of the active-active volumes, a failure notification is triggered, and the failure notification is sent to the target active-active volume, where the failure notification carries target task information;
[0329] In response to the target active-active volume obtaining a fault notification, the target active-active volume obtains the to-be-processed data from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification;
[0330] The target active-active volume executes the target task based on the target task information and the data to be processed.
[0331] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0332] The method also includes:
[0333] Monitor the write cache status and memory status of the primary volume and the secondary volume respectively;
[0334] In response to the state of the write cache of the primary volume being the target state and lasting for a first preset time period, prohibiting memory allocation of the primary volume and the secondary volume;
[0335] In response to the primary volume and the secondary volume memory allocation being prohibited, first marking the data written into the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume;
[0336] Reallocating memory for the first marked write data;
[0337] In response to memory reallocation of the first marked write data, obtaining a write cache state of the primary volume within a second preset time period as a target state;
[0338] Determining whether the write cache state of the primary volume meets the write cache standard according to the write cache state of the primary volume within the second preset time period;
[0339] If the write cache state of the primary volume meets the write cache standard, the first mark is deleted;
[0340] In response to the state of the write cache of the auxiliary volume being the target state and lasting for a first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by a second mark;
[0341] Reallocate memory for the second marked write data;
[0342] In response to memory reallocation of the write data with the second mark, obtaining a write cache state of the auxiliary volume within a second preset time period as a target state;
[0343] Determining whether the write cache state of the auxiliary volume meets the write cache standard according to the write cache state of the auxiliary volume within the second preset time period;
[0344] If the write cache status of the secondary volume meets the write cache standard, the second mark is deleted.
[0345] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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 memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0346] 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 specification.
[0347] The above-mentioned 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 invention patent. 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 patent of the present application shall be subject to the attached claims.
Claims
1. A snapshot processing method based on dual-active volumes, characterized in that: include: In response to receiving the active-active volume creation instruction, creating a storage template, wherein the storage template includes preset parameters; Creating a persistent volume and a persistent volume declaration, and binding the persistent volume and the persistent volume declaration; Creating a snapshot template, wherein the snapshot template includes a snapshot template name; Creating a snapshot volume and a snapshot volume declaration, and binding the snapshot volume and the snapshot volume declaration; Mounting the active-active volume on the container according to the storage template, the persistent volume, the declaration of the persistent volume, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the active-active volume; In response to receiving an instruction to create a snapshot of a target active-active volume, acquiring attribute information of the target active-active volume; Determining whether the target active-active volume is a target data volume based on the storage template and the target active-active volume attribute information; If the target active-active volume is a target data volume, creating a snapshot of the target data volume; If the target active-active volume is a non-target data volume, the target data volume is considered to be faulty, and a snapshot is created for the auxiliary volume of the target data volume.
2. The method according to claim 1, characterized in that Before obtaining the attribute information of the target active-active volume, the method further includes: Obtaining the type of the storage pool corresponding to the target active-active volume according to the preset parameters; If the type of the storage pool corresponding to the target active-active volume is an active-active storage pool, the attribute information of the target active-active volume in the active-active storage pool is obtained.
3. The method according to claim 1, characterized in that The method further comprises: Obtain a first storage system and a second storage system, and add the first storage system to a cluster corresponding to the second storage system; Modify the topology of the total storage system formed by the first storage system and the second storage system into an active-active topology; Using the data volume in the second storage system as the primary volume, creating a secondary volume in the first storage system, wherein the secondary volume has the same format information as the primary volume; A remote replication relationship between the primary volume and the secondary volume is established so that the primary volume and the secondary volume form an active-active volume.
4. The method according to claim 2, characterized in that: The method further comprises: Creating a primary volume change volume corresponding to the primary volume in the second storage system, the primary volume change volume being used to back up the snapshot stored in the primary volume; Creating a secondary volume change volume corresponding to the secondary volume in the first storage system, wherein the secondary volume change volume is used to back up the snapshot stored in the primary volume; A remote replication relationship between the primary volume change volume and the secondary volume change volume is established.
5. The method according to claim 1, characterized in that The method further comprises: In response to receiving the snapshot storage instruction, writing the data in the cache to the primary volume and the secondary volume at the same time; In response to the primary volume receiving the data in the cache, obtaining a first confirmation identifier issued by the primary volume; In response to the auxiliary volume receiving the data in the buffer, obtaining a second confirmation identifier issued by the auxiliary volume; In response to receiving a first confirmation identifier issued by the master volume, generating a first time tag; In response to receiving a second confirmation identifier issued by the auxiliary volume, generating a second time tag; The time information of the first time tag is consistent with the time information of the second time tag.
6. The method according to claim 1, characterized in that The method further comprises: In response to detecting that a failure occurs in any of the active-active volumes, triggering a failure notification, sending the failure notification to the target active-active volume, the failure notification carrying target task information; In response to the target active-active volume obtaining a fault notification, the target active-active volume obtains the to-be-processed data from the data storage space corresponding to the target active-active volume based on the target task information carried in the fault notification; The target active-active volume executes the target task based on the target task information and the data to be processed.
7. The method according to claim 1, characterized in that The method further comprises: Monitor the write cache status and memory status of the primary volume and the secondary volume respectively; In response to the state of the write cache of the primary volume being the target state and lasting for a first preset time period, prohibiting memory allocation of the primary volume and the secondary volume; In response to the memory allocation of the primary volume and the secondary volume being prohibited, first marking the data written into the data storage space corresponding to the primary volume and the data storage space corresponding to the secondary volume; Performing memory reallocation on the first marked write data; In response to reallocating the memory for the first-marked write data, obtaining a write cache state of the primary volume within a second preset time period as a target state; determining whether the write cache state of the primary volume meets a write cache standard according to the write cache state of the primary volume within the second preset time period; If the write cache state of the primary volume meets the write cache standard, deleting the first mark; In response to the state of the write cache of the auxiliary volume being the target state and lasting for a first preset time, the primary volume is prohibited from sending write data to the auxiliary volume, and the write data is stored in the data storage space corresponding to the primary volume after being marked by a second mark; Performing memory reallocation on the write data that is subjected to the second mark; In response to reallocating the memory for the write data marked with the second flag, obtaining a write cache state of the auxiliary volume within a second preset time period as a target state; determining, according to the write cache state of the auxiliary volume within the second preset time period, whether the write cache state of the auxiliary volume meets a write cache standard; If the write cache status of the secondary volume meets the write cache standard, the second mark is deleted.
8. A snapshot processing device based on dual-active volumes, characterized in that: The device comprises: A creation module, configured to create a storage template in response to receiving an active-active volume creation instruction, wherein the storage template includes preset parameters; create a persistent volume and a persistent volume declaration, and bind the persistent volume and the persistent volume declaration; create a snapshot template, wherein the snapshot template includes a snapshot template name; create a snapshot volume and a snapshot volume declaration, and bind the snapshot volume and the snapshot volume declaration; complete active-active volume mounting on a container according to the storage template, the persistent volume, the persistent volume declaration, the snapshot template, the snapshot volume, and the snapshot volume declaration, so that the container has the right to use the active-active volume; A snapshot module is used to obtain attribute information of the target active-active volume in response to receiving an instruction to create a snapshot of the target active-active volume; determine whether the target active-active volume is a target data volume based on the storage template and the attribute information of the target active-active volume; if the target active-active volume is the target data volume, create a snapshot of the target data volume; if the target active-active volume is a non-target data volume, consider the target data volume to be faulty, and create a snapshot of the auxiliary volume of the target data volume.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. 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 7 are implemented.
Citation Information
Cited By
Data synchronization method and device, equipment and medium
CN119988489A