Backup management method, device, computer equipment and storage medium for active-standby cluster

By sending backup preparation information and executing backup commands in the DMMPP active and standby clusters, the problem that traditional technology cannot satisfy the backup and recovery of the DMMPP active and standby clusters is solved, data security and integrity are achieved, and backup calibration adapted to active and standby node switching is achieved. Verification and summary, supporting automatic queuing and execution.

CN117667515BActive Publication Date: 2024-10-18GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311682589.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2024-10-18
Estimated Expiration
2043-12-08

AI Technical Summary

Technical Problem

Traditional technology cannot meet the backup and recovery needs of DMMPP active and standby clusters, and cannot effectively ensure the security of database data.

Method used

Provides a backup management method for active and standby clusters. It sends backup preparation information to the cluster manager through the database node, obtains the cluster resource lock, and executes the backup command to store the data to the storage server, including the metadata information record of the sub-cluster to which the backup set belongs. and node information to implement backup and recovery operations.

Benefits of technology

It realizes the backup and recovery of DMMPP active and standby clusters, ensures the security and integrity of data, performs backup verification and summary when the active and standby nodes are switched, and supports the automatic queuing and execution of scheduled backup tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667515B_ABST
    Figure CN117667515B_ABST
Patent Text Reader

Abstract

The present application relates to a backup management method, device, computer equipment and storage medium for a master-slave cluster. The method includes: in response to obtaining a backup job, the database node sends backup preparation information to the cluster manager; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node; when the master node currently serving as the backup entry node obtains the cluster resource lock, the backup command in the backup job is executed; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server. This method can be used to implement backup management of the DMPP master-slave cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a backup management method, device, computer equipment and storage medium for a master-slave cluster. Background Art

[0002] With the development of computer technology, big data technology has emerged, in which databases are usually used for data storage. In many scenarios in the digital information age, a single data server cannot meet the needs of a large number of users. Clusters can better share the pressure of a single data server and improve user access performance and user experience.

[0003] Due to the diversity of clusters, although some characteristic types of clusters can improve the overall access performance, the fault tolerance of the entire cluster cannot meet the requirements. Based on the above complex considerations and the advantages of various types of clusters, combined clusters were born, and the DMMPP (DM Massively Parallel Processing) master-slave cluster is one of the combined clusters.

[0004] In addition, in order to prevent the loss of important data due to hardware and software failures, an additional backup of the data is required. In the event of data loss, the backup set and the corresponding archive logs can be used to restore, copy or migrate important data in the database, further ensuring the security of the data in the database.

[0005] The backup method of active-standby clusters in traditional technologies cannot meet the backup and recovery requirements of DMMPP active-standby clusters. Summary of the invention

[0006] Based on this, it is necessary to provide a backup management method, device, computer equipment, computer-readable storage medium and computer program product for the active-standby cluster that can meet the requirements of the DMMPP active-standby cluster in order to solve the above technical problems.

[0007] In a first aspect, the present application provides a backup management method for an active-standby cluster, which is applied to an active-standby cluster, wherein the active-standby cluster includes at least two active-standby sub-clusters; the active-standby sub-clusters include at least two database nodes for performing active-standby node switching;

[0008] The method comprises:

[0009] In response to obtaining the backup job, the database node sends backup preparation information to the cluster manager; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node;

[0010] When the master node, which is currently the backup entry node, obtains the cluster resource lock, the backup command in the backup job is executed; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server.

[0011] In one of the embodiments, the backup set includes metadata information, and the metadata information is used to record the active and standby sub-cluster to which the backup set belongs, the database node to which the backup set belongs, and current active and standby node information of the active and standby sub-cluster.

[0012] In one embodiment, the method further comprises:

[0013] Read back the backup set. When the current active and standby node information of the active and standby sub-clusters recorded in the metadata information is consistent with the actual information, summarize the node database size of this backup execution and write it to the Catalog server as the total data volume stored in this backup.

[0014] In one embodiment, obtaining a backup job includes:

[0015] The database node receives the backup job sent by backupd; wherein the backup job is determined by backupd according to the backup task input by the user.

[0016] In one embodiment, it also includes:

[0017] In response to obtaining the backup and recovery job, the database node searches the catalog server for the target backup set in the subcluster to which it belongs and the target archive log of each database node, and obtains the backup set address of the target backup set and the log address of the target archive log fed back by the catalog server;

[0018] The database node downloads the target archive log from the storage server based on the log address;

[0019] The database node restores the data corresponding to the backup set based on the backup set address and the target archive log.

[0020] In one of the embodiments, the backup and restore job is determined by backupd according to the backup and restore task input by the user;

[0021] The method also includes:

[0022] The database node reports the recovery information corresponding to the backup and recovery job to backupd.

[0023] In a second aspect, the present application further provides a backup management device for a master-slave cluster, which is applied to a master-slave cluster, wherein the master-slave cluster includes at least two master-slave sub-clusters; each master-slave sub-cluster includes at least two database nodes that can switch between a master node and a standby node;

[0024] The device comprises:

[0025] The backup preparation module is used for the database node to send backup preparation information to the cluster manager in response to obtaining the backup job; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node;

[0026] The backup command execution module is used to execute the backup command in the backup job when the master node, which is currently the backup entry node, obtains the cluster resource lock; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0029] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0030] In the backup management method, apparatus, computer equipment and storage medium of the above-mentioned active-standby cluster, the database node sends backup preparation information to the cluster manager in response to obtaining a backup job; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node; when the master node, which is currently the backup entry node, obtains the cluster resource lock, the backup command in the backup job is executed; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server, so as to realize the backup of the DMPP active-standby cluster. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0032] Figure 1 An application environment diagram of a backup management method for a master-slave cluster in one embodiment;

[0033] Figure 2 A schematic diagram of a process flow of a backup management method for a master-slave cluster in one embodiment;

[0034] Figure 3 It is a flowchart of a backup management method of an active-standby cluster in another embodiment;

[0035] Figure 4 It is a structural block diagram of a backup management device of a master-slave cluster in one embodiment;

[0036] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0037] 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.

[0038] The backup management method of the active-standby cluster provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown in the figure, UI (User Interface) 102 communicates with backupd (Backup Daemon) 102 through the network, backupd102 communicates with the active-standby cluster 103 through the network, and the active-standby cluster 103 communicates with the cluster manager 104, the catalog server 105 and the storage server 106 through the network. The active-standby cluster 103 includes four database nodes, namely agent_primary_ep1, agent_standby_ep1, agent_primary_ep2 and agent_standby_ep2, wherein agent_primary_ep1 and agent_standby_ep1 are a group of active-standby sub-clusters, and agent_primary_ep2 and agent_standby_ep2 are another group of active-standby sub-clusters; the two groups of active-standby sub-clusters constitute a DMMPP active-standby cluster (DMPP active-standby cluster). Furthermore, agent_primary_ep1 and agent_standby_ep1 can switch between the primary and standby nodes, and agent_primary_ep2 and agent_standby_ep2 can also switch between the primary and standby nodes.

[0039] Among them, the DMMPP active-standby cluster belongs to a combined cluster: the DMMPP cluster requires multiple nodes to work together to complete the entire DMMPP cluster task, and any single node failure will cause the entire cluster to fail to work. In order to improve the overall fault tolerance of the DMMPP cluster, each node in the DMMPP is composed of active-standby sub-clusters, so that a single node failure does not affect the business of the entire DMMPP active-standby cluster.

[0040] In an exemplary embodiment, Figure 2 As shown, a backup management method for a master-slave cluster is provided, and the method is applied to Figure 1 The active-standby cluster 103 in the example is used for explanation, wherein the active-standby cluster includes at least two active-standby sub-clusters; the active-standby sub-cluster includes at least two database nodes for performing active-standby node switching.

[0041] The embodiment of the present application provides a backup management method for a master-slave cluster, including the following steps 202 to 204. Among them:

[0042] Step 202: In response to obtaining the backup job, the database node sends backup preparation information to the cluster manager; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node.

[0043] Specifically, all database nodes in the active-standby cluster will receive the backup job and send backup preparation information to the cluster manager.

[0044] Among them, the backup preparation information can be the preparations and elements that need to be done before performing the data backup operation to ensure the smooth execution of the backup and the reliability of the backup data. Exemplarily, when receiving the backup job, the database node can first perform the SBT library installation before the backup, and send the installation status of the SBT library to the cluster manager as the backup preparation information. Optionally, the backup preparation information can also include: confirming the backup object, confirming the backup cycle and frequency, confirming the backup medium, checking the backup directory and files, confirming the backup log and report and other information.

[0045] A cluster manager can be a software tool or system for managing and monitoring computer clusters, which is mainly responsible for coordinating, allocating and monitoring the resources and tasks of each node in the cluster (a node can be a physical server or a virtual machine). Exemplarily, the functions of a cluster manager may include: resource scheduling and allocation, fault detection and recovery, task management and scheduling, configuration management and deployment, etc. Optionally, the cluster manager can be used to send the cluster status to each database node, and can also be used to send information such as the cluster resource lock status. Among them, the cluster resource lock can be a cluster resource mutex lock, which is used to resolve conflicts when multiple nodes access a shared resource at the same time.

[0046] Specifically, when a cluster has multiple consecutive backup jobs, the database nodes corresponding to the multiple backup jobs will seize the cluster resource exclusive lock. After obtaining the cluster resource lock, if the job queue wait time is too long and the cluster structure changes (for example, the master and backup switch occurs in the sub-cluster), the entire cluster will fail to back up and the backup job needs to be retried.

[0047] Step 204, when the master node currently serving as the backup entry node obtains the cluster resource lock, executes the backup command in the backup job; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server.

[0048] Among them, the storage server is mainly used to store the backup sets and archive logs of the entire cluster database. Specifically, the DMMPP master-slave cluster only backs up the data of the master nodes in all master-slave subclusters each time. Therefore, when the master node, which is currently the backup entry node, obtains the cluster resource lock, the master node executes the backup command in the backup job; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server.

[0049] Optionally, upon receiving the backup set sent by the master node, the storage server returns the storage result to the master node to ensure that the backup is successful.

[0050] In the above-mentioned backup management method of the master-standby cluster, the database node sends backup preparation information to the cluster manager in response to obtaining the backup job; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node; when the master node, which is currently the backup entry node, obtains the cluster resource lock, the backup command in the backup job is executed; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server, so as to realize the backup of the DMPP master-standby cluster.

[0051] In one of the embodiments, the backup set includes metadata information, and the metadata information is used to record the primary and backup sub-clusters to which the backup set belongs, and to record the database nodes to which the backup set belongs.

[0052] The metadata information of the backup set may be descriptive information and attributes about the backup set generated during the backup operation. Generally speaking, the metadata information records the relevant information of the backup set and can be used for backup management and restore recovery operations. Exemplarily, the metadata information of the backup set may be recorded in a database of a backup management system or backup software and associated with the backup set itself.

[0053] Specifically, the metadata information of each backup set can record the primary and backup sub-clusters to which the backup set belongs, as well as the database node to which the backup set belongs, for subsequent backup recovery, verification, and aggregation.

[0054] For example, the Catalog server is used to store and query the backup jobs of the entire system, including the backup records of the cluster, the backup records of the log, which nodes make up the sub-cluster, and the OGUID (Object GUID, Object Globally Unique Identifier) ​​value of each sub-cluster, and other system metadata information. Among them, the OGUID value is usually used for unique identification and tracking of objects in distributed systems. Each time a cluster is backed up, a cluster backup record is generated, which is used to find available backup sets during recovery, to find the existing basic backup of the system during incremental backup, or to find the required archive logs when downloading archive logs.

[0055] An embodiment of the present application provides a backup management method for a master-slave cluster, which uses an OGUID value to record which master-slave sub-cluster a backup set belongs to, and records which database node a backup set belongs to through metadata, thereby facilitating information identification of the backup set, as well as subsequent backup recovery, verification, and aggregation.

[0056] In one embodiment, a backup management method of a master-slave cluster provided in an embodiment of the present application may further include:

[0057] Read back the backup set. When the current active and standby node information of the active and standby sub-clusters recorded in the metadata information is consistent with the actual information, summarize the node database size of this backup execution and write it to the Catalog server as the total data volume stored in this backup.

[0058] Specifically, since the DMMPP active-standby cluster only backs up the data of the master nodes in all active-standby subclusters at a time, and the master and standby nodes in the active-standby subclusters may switch, if the backup entry is selected in the standby node of the active-standby subcluster, or the master node is switched to the standby node due to the active-standby switch of the subcluster, only the data of the subcluster will be backed up, and the data of the entire combined cluster will not be backed up.

[0059] Therefore, before performing a backup, you can first obtain the current structure of the active and standby clusters in the MPP active and standby clusters, that is, the current active and standby node information of the active and standby sub-clusters. In addition, the current structure information of the active and standby clusters is recorded to the Catalog server as part of the metadata information. After the backup is completed, the backup set is stored on the storage server. The primary node can read back the backup set from the storage server for readback verification to confirm whether the stored metadata is consistent with the information of the multiple backup sets of the actual storage server (if they are inconsistent, there will be problems with recovery, mainly to prevent the cluster structure from changing midway).

[0060] The backup is completed by multiple nodes in the entire cluster. The specific nodes to be selected are determined by the cluster architecture when executing the job. If the verification results are consistent, the database size of the nodes executed in this backup is summarized as the total data volume stored in this backup. Furthermore, the master node writes the verified and summarized backup set to the storage server, and writes the relevant metadata information to the catalog server.

[0061] Optionally, when receiving the summarized backup set, the Catalog server reports the backup record writing status to the primary node to ensure the backup is successful.

[0062] Optionally, the master node as the backup entry reports the backup completion status to the cluster manager so that the cluster manager can reallocate cluster resource locks and start the next backup job when there are multiple backup jobs. Furthermore, the master node is also used to perform finishing work after the backup is completed. Among them, the post-backup finishing work can refer to additional tasks and steps performed after the backup operation is completed to ensure the integrity, availability and security of the backup data. Exemplarily, the finishing work can include: directory and log cleaning, updating backup records and documents, testing the restorability of backup data, storage and protection of backup data, backup monitoring and reporting and other tasks and steps.

[0063] The embodiment of the present application provides a backup management method for a master-slave cluster, which can verify and summarize the current backup set and the historical backup set when the master-slave node in the master-slave sub-cluster switches to ensure the consistency and integrity of the backup set. Furthermore, by reporting the backup completion status to the cluster manager after the backup is completed, the scheduled backup task of the DMPP master-slave cluster is realized, including automatic queuing and automatic execution of multiple tasks.

[0064] In one embodiment, a backup management method of a master-slave cluster provided in an embodiment of the present application obtains a backup job, including:

[0065] The database node receives the backup job sent by backupd; wherein the backup job is determined by backupd according to the backup task input by the user.

[0066] Specifically, the user enters the backup task (also called backup job) through the UI, and the UI passes the backup task to backupd. Backupd divides the backup task into sub-jobs (corresponding to the backup job of each database node) according to the backup task entered by the user, and distributes it to each database node.

[0067] Furthermore, after completing the backup task, the master node can also be used to report the execution status of the backup task to backupd, so that backupd returns the execution status of the backup task to the front-end UI.

[0068] In one embodiment, if Figure 3 As shown, a backup management method of a master-slave cluster provided in an embodiment of the present application may also include:

[0069] Step 302: In response to obtaining the backup and recovery job, the database node searches the Catalog server for the target backup set in the subcluster to which it belongs and the target archive log of each database node, and obtains the backup set address of the target backup set and the log address of the target archive log fed back by the Catalog server.

[0070] Among them, the backup and recovery job can be used to instruct the database node to restore the corresponding data. Specifically, the DMMPP master-slave cluster will generate multiple backup sets during the backup, that is, each master-slave subcluster will generate a backup set. The backup set is generated according to the data of the entire cluster distributed in the subcluster, and the data does not overlap. The backup set in the subcluster can be used to restore or restore the subcluster data, thereby realizing the recovery or restoration of the combined cluster. Each node has its own separate archive log, and even the archive log of the subcluster is invalid if it is used across nodes.

[0071] The target backup set may be a backup set storing data for recovery or cloning. Specifically, a plurality of backup sets are stored in the storage server, and the target backup set in each master-standby subcluster is a backup set obtained by backing up the previous data of the master-standby subcluster. Exemplarily, the target backup set corresponding to the current master-standby subcluster may be determined based on which master-standby subcluster and database node the backup set belongs to as recorded in the metadata information of the backup set. The target archive log may be an archive log corresponding to the database node that currently needs to recover data, and may be used to retain and manage important log information generated by an application or system for the needs of subsequent auditing, troubleshooting, compliance, etc.

[0072] Furthermore, the Catalog server stores the log addresses of the target backup set and the archive logs of the database nodes. By searching the Catalog server for the target backup set in the subcluster and the target archive logs of each database node, the backup set address of the target backup set and the log address of the target archive log fed back by the Catalog server can be obtained.

[0073] Step 304: The database node downloads the target archive log from the storage server based on the log address.

[0074] Specifically, the storage server stores the corresponding archive logs, and based on the corresponding log address, the corresponding target archive logs can be downloaded from the storage server.

[0075] Step 306: The database node restores the data corresponding to the backup set based on the backup set address and the target archive log.

[0076] Specifically, all database nodes in the active-standby cluster perform this step to restore the data corresponding to the backup set based on the backup set address and the target archive log. The target backup sets and archive logs corresponding to different database nodes may be different. Each database node restores the data corresponding to its own active-standby sub-cluster based on its own target backup set and archive log.

[0077] Optionally, the recovery of the DMMPP active-standby cluster requires shutting down the monitoring process of the database service; after the nodes are restored, the databases are started separately, and the databases will automatically detect and synchronize cluster data according to the cluster configuration. The recovery of any single node in the DMMPP active-standby cluster is independent and does not affect each other.

[0078] The embodiment of the present application provides a backup management method for a master-slave cluster, which provides a secure backup and recovery of the DMMPP master-slave cluster database data by obtaining the backup set address of the target backup set and the log address of the target archive log from the Catalog server, and obtaining the target archive log through the storage server, and then restoring the database. When restoring or cloning the cluster, the current combined cluster architecture can be automatically identified, the backup set and archive log that should be restored can be automatically selected, and the database backup set and archive log that have been backed up by the system can be intelligently selected for download.

[0079] In one embodiment, the backup and restore job is determined by backupd according to the backup and restore task input by the user. The method may also include:

[0080] The database node reports the recovery information corresponding to the backup and recovery job to backupd.

[0081] Specifically, after the data recovery is completed, the database nodes in the active and standby clusters all report the recovery information corresponding to the backup recovery job to backupd, so that backupd can return the recovery information and recovery status to the UI front end.

[0082] In order to further explain the solution of the embodiment of the present application, a specific example is given below. Figure 1 As shown in the figure, the backup process of the DMMPP master-slave cluster database includes:

[0083] The UI obtains the backup task input by the user and transmits the backup task to backupd. backupd distributes the sub-jobs corresponding to the backup task to all database nodes. When each database node obtains the sub-job, it installs the SBT library before the backup and reports the preparation status to the cluster manager. After the cluster manager collects cluster information (such as master and standby information), it sends the current cluster status and cluster resource lock information to all database nodes. When the master node, which is the backup entry node, obtains the cluster resource lock, it detects whether the cluster master node has changed and executes the backup command. The backup command is used to instruct all master nodes in the master-standby cluster to store their respective master node data as a backup set to the storage server. When the storage server receives the backup set, it returns the storage result to the corresponding master node. Furthermore, if the backup entry selects the standby node in the master-standby sub-cluster, or the master node is switched to the standby node due to the master-standby switch of the sub-cluster, only the data of the sub-cluster will be backed up, and the data of the entire combined cluster will not be backed up. After the backup is completed, the storage server should be read back to verify the backup set and summarize the backup data. The master node writes the verified and summarized backup set to the Catalog server, and the Catalog server reports the backup set record writing status to the corresponding master node. The master node reports the backup completion status to the cluster manager, and the cluster manager notifies the master node to complete the post-backup work. Furthermore, the master node, as the backup entry node, reports the execution status of the backup job to backupd, and backupd returns the execution status of the backup job to the front-end UI.

[0084] The recovery or cloning process of the DMMPP master-slave cluster database includes:

[0085] The UI obtains the backup and recovery tasks input by the user and transmits the backup and recovery tasks to backupd. backupd distributes the recovery sub-jobs corresponding to the backup and recovery tasks to all database nodes. The database node searches the Catalog server for the appropriate backup set in this subcluster and obtains the backup set address returned by the Catalog server; the database node also searches the Catalog server for the appropriate archive log of a single node in this subcluster and obtains the log address of the archive log returned by the Catalog server. Based on the log address, the database node downloads the specified archive log from the storage server. The backup set combined with the downloaded log can restore the database corresponding to the backup set. After the data recovery is completed, the database node reports the recovery status to backupd so that backupd can return the recovery status to the front-end UI.

[0086] The backup management method of the master-slave cluster provided in the embodiment of the present application can provide secure backup and recovery of the database data of the DMMPP master-slave cluster. When restoring or cloning the cluster, the database backup set and archive logs that have been backed up by the system can be intelligently selected for download. When the time points of each machine in the cluster are synchronized, the scheduled backup task of the DMPP master-slave cluster can be realized, including automatic queuing and automatic execution of multiple tasks.

[0087] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0088] Based on the same inventive concept, the embodiment of the present application also provides a backup management device for a master-standby cluster for implementing the backup management method for the master-standby cluster involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the backup management device for one or more master-standby clusters provided below can refer to the limitations of the backup management method for the master-standby cluster above, and will not be repeated here.

[0089] In an exemplary embodiment, Figure 4 As shown, a backup management device 400 of an active-standby cluster is provided, which is applied to an active-standby cluster, wherein the active-standby cluster includes at least two active-standby sub-clusters; each active-standby sub-cluster includes at least two database nodes that can switch between a primary node and a standby node;

[0090] The backup device 400 includes:

[0091] The backup preparation module 401 is used for the database node to send backup preparation information to the cluster manager in response to obtaining the backup job; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each database node;

[0092] The backup command execution module 402 is used to execute the backup command in the backup job when the master node currently serving as the backup entry node obtains the cluster resource lock; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server.

[0093] In one of the embodiments, the backup set includes metadata information, and the metadata information is used to record the primary and backup sub-clusters to which the backup set belongs, and to record the database nodes to which the backup set belongs.

[0094] In one of the embodiments, it also includes a read-back verification module for reading back the backup set. When the current master and standby node information of the master and standby sub-clusters recorded in the metadata information is consistent with the actual information, the node database size of this backup execution is summarized and written to the Catalog server as the total data volume stored in this backup.

[0095] In one of the embodiments, the backup preparation module is also used for the database node to receive the backup job sent by backupd; wherein the backup job is determined by backupd according to the backup task input by the user.

[0096] In one embodiment, it also includes:

[0097] The backup and recovery preparation module is used for the database node to search the Catalog server for the target backup set in the subcluster to which it belongs and the target archive log of each database node in response to obtaining the backup and recovery job, and obtain the backup set address of the target backup set and the log address of the target archive log fed back by the Catalog server;

[0098] The archive log download module is used for the database node to download the target archive log in the storage server based on the log address;

[0099] The backup and recovery module is used by the database node to restore the data corresponding to the backup set based on the backup set address and the target archive log.

[0100] In one embodiment, the backup and recovery job is determined by backupd according to the backup and recovery task input by the user; the device also includes:

[0101] The recovery information reporting module is used by the database node to report the recovery information corresponding to the backup and recovery job to backupd.

[0102] Each module in the backup management device of the above-mentioned active-standby cluster can be implemented in whole or in part by software, hardware and their combination. Each of 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 each of the above modules.

[0103] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, 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 backup data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a backup management method for a master-slave cluster is implemented.

[0104] Those skilled in the art will understand that Figure 5 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.

[0105] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program.

[0106] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0107] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.

[0108] 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 the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0109] 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.

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

Claims

1. A backup management method for a master-slave cluster, characterized in that: Applied to an active-standby cluster, the active-standby cluster includes at least two active-standby sub-clusters; The active-standby sub-cluster includes at least two database nodes for performing active-standby node switching; The method comprises: In response to obtaining the backup job, the database node sends backup preparation information to the cluster manager; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each of the database nodes; wherein the cluster resource lock information includes a cluster resource mutex lock, which is used to resolve conflicts that occur when multiple nodes access a shared resource at the same time; When the master node currently serving as the backup entry node obtains the cluster resource lock information, the backup command in the backup job is executed; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server; Wherein, the backup set includes metadata information, and the metadata information includes current structure information of the active and standby clusters; The method further comprises: Read back the backup set, and when the current active and standby node information of the active and standby sub-clusters recorded in the metadata information is consistent with the actual information, summarize the node database size executed in this backup, and write it into the Catalog server as the total data volume stored in this backup.

2. The method according to claim 1, characterized in that The metadata information is used to record the active / standby sub-cluster to which the backup set belongs, the database node to which the backup set belongs, and current active / standby node information of the active / standby sub-cluster.

3. The method according to any one of claims 1 to 2, characterized in that: The obtaining of the backup job includes: The database node receives the backup job sent by backupd; wherein the backup job is determined by backupd according to the backup task input by the user.

4. The method according to claim 3, characterized in that Also includes: In response to obtaining the backup and recovery job, the database node searches the catalog server for a target backup set in the subcluster to which it belongs and a target archive log of each of the database nodes, and obtains the backup set address of the target backup set and the log address of the target archive log fed back by the catalog server; The database node downloads the target archive log in the storage server based on the log address; The database node restores the data corresponding to the backup set based on the backup set address and the target archive log.

5. The method according to claim 4, characterized in that The backup and recovery job is determined by the backupd according to the backup and recovery task input by the user; The method further comprises: The database node reports the recovery information corresponding to the backup recovery operation to the backupd.

6. A backup management device for a master-slave cluster, characterized in that: Applied to an active-standby cluster, the active-standby cluster includes at least two active-standby sub-clusters; Each of the active-standby sub-clusters includes at least two database nodes that can switch between a primary node and a standby node; The device comprises: A backup preparation module, used for the database node to send backup preparation information to the cluster manager in response to obtaining a backup job; the backup preparation information is used to instruct the cluster manager to send cluster resource lock information to each of the database nodes; wherein the cluster resource lock information includes a cluster resource mutex lock, which is used to resolve conflicts that occur when multiple nodes access a shared resource at the same time; A backup command execution module, used to execute the backup command in the backup job when the master node currently serving as the backup entry node obtains the cluster resource lock information; the backup command is used to instruct the master node to store the master node data as a backup set to the storage server; Wherein, the backup set includes metadata information, and the metadata information includes current structure information of the active and standby clusters; The device also includes: The read-back verification module is used to read back the backup set. When the current active and standby node information of the active and standby sub-clusters recorded in the metadata information is consistent with the actual information, the node database size executed in this backup is summarized and written into the Catalog server as the total data volume stored in this backup.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. 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 5 are implemented.

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

Citation Information

Patent Citations

  • Data processing method and device of alliance chain, electronic equipment and storage medium

    CN113505024A

  • Database cluster backup system

    CN115202929A