Database backup method and device, server, medium and program product
By mounting the backup storage space to all nodes as shared sub-storage space in the database cluster, the problem of inability to backup and restore data when the backup storage space node fails, and the high availability and data security of the database cluster when the node fails is achieved is achieved. sex.
Patent Information
- Application Number
- CN202411600481.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-07
AI Technical Summary
The backup solution of an existing database cluster cannot continue to backup and restore data when the backup storage space node fails, resulting in a degradation of the database cluster service performance.
By backing up the preset backup storage space in all nodes in the database cluster, it becomes a shared sub-storage space mounted by each database node, so that data can be backed up and restored in the event of any node failure.
Ensure that backup and recovery services can still be provided normally when any node of the database cluster fails, improving the service performance and data storage security of the database cluster.
Smart Images

Figure CN119396631A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of database backup, and in particular to a database backup method, device, server, medium and program product. Background Art
[0002] In modern database management systems, data reliability and availability are crucial. In order to ensure data security and high system availability, database cluster technology is widely used. A database cluster consists of multiple database nodes that work together to provide higher performance and fault tolerance.
[0003] In a database cluster environment, data backup is a critical task. Backup can prevent data loss and ensure that data can be restored in the event of a failure.
[0004] Traditional backup methods usually involve backing up the data of each database node to a pre-set backup storage space. However, if the node where the backup storage space is located fails, the data of each database node can no longer be backed up, and the backed-up files cannot be restored, which has the technical problem of reducing the service performance of the database cluster. Summary of the invention
[0005] The present application provides a database backup method, device, server, medium and program product, which are used to solve the technical problem that the backup solution of the existing database cluster reduces the service performance of the database cluster. By backing up the preset backup storage space in all nodes in the database cluster, it is ensured that when any node in the database cluster fails, it can continue to provide services normally, thereby improving the service performance of the database cluster.
[0006] In a first aspect, the present application provides a database backup method, which is applied to a database cluster, wherein the database cluster includes a plurality of database nodes; the database cluster is pre-configured with a backup storage space, and the backup storage space is a shared sub-storage space mounted by each of the database nodes;
[0007] The database backup method comprises:
[0008] Determine a backup database node that has physical backup authority to perform physical backup of the database cluster at the current moment;
[0009] In the backup database node, a cluster configuration file and a configuration file acquisition link required for performing a physical backup of the database cluster are obtained according to the shared sub-storage space mounted by the backup database node; the configuration file acquisition link is used to obtain a node configuration file stored in the database node when performing a physical backup of the database cluster in any database node;
[0010] The database cluster is physically backed up according to the cluster configuration file and the node configuration file.
[0011] In some optional implementations, the backup storage space stores a pre-written node configuration file acquisition link and a cluster configuration file;
[0012] According to the shared sub-storage space mounted on the backup database node, a cluster configuration file and a node configuration file required for performing a physical backup of the database cluster are obtained, including:
[0013] Reading data at a first preset storage location of the shared sub-storage space to obtain a cluster configuration file required for performing a physical backup of the database cluster;
[0014] Reading data at a second preset storage location of the shared sub-storage space to obtain a configuration file acquisition link required for performing a physical backup of the database cluster;
[0015] The node configuration file corresponding to the backup database node is obtained according to the configuration file acquisition link.
[0016] In some optional implementations, obtaining a node configuration file corresponding to the backup database node according to the configuration file acquisition link includes:
[0017] When operating the configuration file acquisition link in the backup database node, parsing the configuration file acquisition link to obtain a configuration file acquisition path;
[0018] Data is read in the backup database node according to the configuration file acquisition path to obtain the node configuration file.
[0019] In some optional implementations, determining a backup database node that has physical backup authority to perform physical backup on the database cluster at the current moment includes:
[0020] When there are multiple database nodes that are preparing to physically back up the database cluster at the current moment, a backup database node that has physical backup authority at the current moment is obtained according to a preset backup node screening rule.
[0021] In some optional embodiments, the method further comprises:
[0022] For any database node, determining at least one node configuration item required for performing physical backup on the database node according to the called physical backup tool and the preset backup strategy;
[0023] Obtaining node configuration data corresponding to the node configuration item, writing the node configuration item and the node configuration data into the local sub-storage space of the database node accordingly, and obtaining a node configuration file corresponding to the database node;
[0024] A configuration file acquisition link corresponding to the node configuration file is generated according to the storage path of the node configuration file in the local sub-storage space, and the configuration file acquisition link is written to the shared sub-storage space mounted on the database node.
[0025] In some optional embodiments, the method further comprises:
[0026] Determine, according to the called physical backup tool and the preset backup strategy, at least one cluster configuration item required for performing physical backup of the database cluster;
[0027] In any database node, cluster configuration data corresponding to the cluster configuration item is obtained, and the cluster configuration item and the cluster configuration data are correspondingly written into the shared sub-storage space mounted by the database node to obtain a cluster configuration file.
[0028] In a second aspect, the present application provides a database backup device, comprising:
[0029] Applied to a database cluster, the database cluster includes a plurality of database nodes; the database cluster is pre-configured with a backup storage space, the backup storage space is a shared sub-storage space mounted by each of the database nodes;
[0030] The database backup device comprises:
[0031] A backup node determination module, used to determine a backup database node that has physical backup authority to perform physical backup on the database cluster at the current moment;
[0032] A configuration file acquisition module is used to obtain, at the backup database node, a cluster configuration file and a configuration file acquisition link required for performing a physical backup of the database cluster through a shared sub-storage space mounted by the backup database node; the configuration file acquisition link is used to obtain a node configuration file stored in the database node when performing a physical backup of the database cluster in any database node;
[0033] The backup module is used to perform physical backup of the database cluster according to the cluster configuration file and the node configuration file.
[0034] In a third aspect, the present application provides a server, comprising: a processor, and a memory communicatively connected to the processor;
[0035] The memory stores computer-executable instructions;
[0036] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0038] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0039] The database backup technical solution provided by the present application is applied to a database cluster, wherein the database cluster includes multiple database nodes; the database cluster is pre-set with a backup storage space, and the backup storage space is a shared sub-storage space mounted by each of the database nodes; the above technical solution determines a backup database node that has the physical backup authority to physically back up the database cluster at the current moment; in the backup database node, according to the shared sub-storage space mounted by the backup database node, a cluster configuration file and a configuration file acquisition link required for physically backing up the database cluster are obtained; the configuration file acquisition link is used to obtain a node configuration file stored in the database node when physically backing up the database cluster in any database node; the database cluster is physically backed up according to the cluster configuration file and the node configuration file; in this way, in the event that any node in the database cluster fails, the data in the cluster can also be backed up to the backup storage space through other database nodes in the cluster, and data can also be restored from the backup storage space through any other database node, so that the server cluster can provide data services normally even when a node fails, providing the security of cluster data storage and improving cluster service performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] Figure 1 An application scenario diagram of the database backup method provided in this application;
[0042] Figure 2 A flowchart of a database backup method provided in an embodiment of the present application;
[0043] Figure 3A schematic diagram of the structure of a database backup device provided in an embodiment of the present application;
[0044] Figure 4 It is a block diagram of a server shown in an embodiment of the present application.
[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0047] In actual applications, in a database cluster, there are usually multiple nodes that jointly provide database services, so data security and availability are crucial. In order to prevent data loss, database administrators usually perform database backup operations regularly. Physical backup is a commonly used backup method, which involves copying the physical files of the database (such as data files, log files, etc.) to a safe backup storage space. The backup storage space can be located in a database node in the cluster, that is, the database node is used as a backup storage node, or a service node is dedicated as a backup storage node.
[0048] The above physical backup deployment method has the risk of single point failure: once the node where the physical backup is stored fails, the node can no longer provide backup services, and the data previously backed up by the node cannot be restored.
[0049] Generally, when a backup storage node in a database cluster fails, other nodes in the database cluster will be selected as new backup storage nodes, and the storage devices used to store backup data in the previous backup storage nodes will be inserted or linked to the new backup storage nodes, so that data can be restored and physical backup can continue on the new backup storage nodes. The above processing method requires plugging and unplugging the storage devices storing backup data, which causes security risks to cluster data storage. In addition, the above processing requires manual processing, which is inefficient, affects the normal data service provided by the cluster, and reduces the service performance of the cluster.
[0050] The database backup method provided by the present application is intended to solve the above technical problems of the prior art. Specifically, by mounting the backup storage space set in the backup node to all nodes of the database cluster, the backup storage space is used as a backup storage space shared by all database nodes in the database cluster; in this way, in the event of a failure in any node in the database cluster, the data in the cluster can be backed up to the backup storage space through other database nodes in the cluster, and data can also be restored from the backup storage space through any other database node, so that the server cluster can provide data services normally even when a node fails, providing the security of cluster data storage and improving cluster service performance.
[0051] Figure 1 An application scenario diagram of the database backup method provided in this application. The technical solution provided in this application has a wide range of application scenarios, especially in environments with high availability, data integrity and rapid recovery. For example, in enterprise-level applications, the core business systems of large enterprises (such as ERP, CRM) usually require high availability and data security. Database cluster backup can ensure that these critical systems can be quickly restored in the event of a failure, reducing business interruptions; for example, in an e-commerce platform, e-commerce websites need to process a large amount of transaction data and user information. Database cluster backup can ensure data integrity and availability under high traffic and high transaction volume.
[0052] With the development of technology, the application scenarios of data backup technology solutions will become more extensive and in-depth, which will be explained one by one here.
[0053] For ease of understanding, the following combination Figure 1 The application scenarios to which the embodiments of the present application are applicable are described. Figure 1 The technical solution in this application is applied to a database cluster. Specifically, the database cluster includes multiple database nodes. The database cluster is pre-set with a backup storage space, which is a shared sub-storage space mounted by each database node; each database node also includes a local sub-storage space.
[0054] The database administrator can operate any database node in the database cluster through the user interaction device to complete the physical backup of the database cluster.
[0055] Specifically, for any database node, when it is determined that the database node is a backup database node that has the physical backup permission for physically backing up the database cluster at the current moment, a cluster configuration file acquisition link required for physically backing up the database cluster is obtained through the shared sub-storage space mounted in the backup database node, that is, the backup storage space; and then the node configuration file required for physically backing up the data cluster is obtained through the configuration file acquisition link; on this basis, the physical backup of the database cluster is completed according to the cluster configuration file and the node configuration file, so that when any node in the database cluster fails, the data in the cluster can be backed up to the backup storage space through other database nodes in the cluster, and data can also be restored from the backup storage space through any other database node, so that the server cluster can provide data services normally when a node fails, providing the security of cluster data storage and improving cluster service performance.
[0056] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0057] Figure 2 The flowchart of a database backup method provided in an embodiment of the present application is shown in FIG. The method can be executed by a database backup device, which can be a server. The following description takes the server as an example. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware, such as Figure 2 As shown, the method includes the following steps.
[0058] S201. Determine a backup database node that has physical backup authority to perform physical backup on a database cluster at the current moment.
[0059] In the present application, there are multiple database nodes in the database cluster. Since each database node is mounted with a shared sub-storage space, ie, the backup storage space of the database cluster, the database cluster can be physically backed up in any database node in the database cluster.
[0060] It can be explained that since physical backup of a database cluster is to back up the data of at least one node in the cluster to the backup storage space, if multiple database nodes are used for backup at the same time, the backup data will be stored repeatedly in the backup storage space, resulting in a waste of storage resources and also a waste of system resources of the database nodes in the cluster.
[0061] In order to avoid the above situation, the technical solution of the present application will pre-determine the database node that performs the current backup task before performing a physical backup of the database cluster, that is, determine the backup database node that has the physical backup authority to perform a physical backup of the database cluster at the current moment, and then use the backup database node to perform the current backup task.
[0062] Optionally, it can be achieved by setting a mutex lock, setting a flag file in the backup storage space, etc. to ensure that only one database node is allowed to perform physical backup of the database cluster at the same time.
[0063] In an optional implementation, determining a backup database node that has physical backup permissions for performing physical backup of a database cluster at the current moment may include: when there are multiple database nodes that are expected to perform physical backup of the database cluster at the current moment, obtaining a backup database node that has physical backup permissions at the current moment according to a preset backup node screening rule.
[0064] It should be understood that the present application may perform the process of determining the backup database node in the master node in the database cluster, or may perform the process of determining the backup database node in a control node separately provided in the database cluster, and this is not limited.
[0065] Specifically, if there are multiple database administrators who send requests for physical backup of the database cluster through each database node, node selection can be performed on each database node that sends the request based on the node resource status of each node (such as node load status, node operation status, etc.) or the backup priority strategy of each node to determine the backup database node that has physical backup authority at the current moment.
[0066] S202: In the backup database node, according to the shared sub-storage space mounted on the backup database node, obtain a cluster configuration file and a configuration file acquisition link required for performing a physical backup of the database cluster.
[0067] In this application, the configuration file acquisition link is used to obtain the node configuration file stored in the database node when performing a physical backup of the database cluster in any database node.
[0068] It can be explained that when the backup tool that performs the backup task backs up the data of multiple nodes, it needs to obtain the configuration data corresponding to the preset configuration items in each node, and then implement the backup task according to the configuration data. Since the present application mounts the backup storage space in multiple database nodes at the same time, there may be data conflicts caused by the configuration items of multiple database nodes corresponding to multiple configuration data, which will affect the smooth execution of the backup task.
[0069] In order to avoid the occurrence of the above situation, the technical solution provided in this application divides the configuration items required for the execution of the backup task into two parts, namely, the cluster configuration items that will not cause data conflicts during the execution of the backup task, and the node configuration items that may cause data conflicts during the execution of the backup task. The configuration data of each database node for the above two configuration items is obtained respectively to obtain the cluster configuration file and the node configuration file.
[0070] Specifically, in this application, for cluster configuration items, since no data conflicts will occur, in order to quickly read data when the backup task is executed, the configuration data of the cluster configuration items of each database node can be written together to obtain a cluster configuration file, and stored in the backup storage space to facilitate subsequent execution of backup tasks.
[0071] At the same time, for node configuration items, since data conflicts may occur, the configuration data of each database node for the node configuration items can be written into the local storage space of each node to generate a node configuration file. In order to facilitate the acquisition of the node configuration file during the execution of subsequent backup tasks, a configuration file acquisition link can be generated based on the storage path of the node configuration file in the local storage space, and the configuration file acquisition link can be stored in the backup storage space, so that it can be acquired together with the cluster configuration file during the execution of subsequent backup tasks.
[0072] Therefore, based on the storage of pre-written node configuration file acquisition links and cluster configuration files in the backup storage space, the present application can obtain the cluster configuration file and node configuration file required for physical backup of the database cluster according to the shared sub-storage space mounted on the backup database node, which may include: reading data at the first preset storage location of the shared sub-storage space to obtain the cluster configuration file required for physical backup of the database cluster; reading data at the second preset storage location of the shared sub-storage space to obtain the configuration file acquisition link required for physical backup of the database cluster; and obtaining the node configuration file corresponding to the backup database node according to the configuration file acquisition link.
[0073] In the process of executing the backup task in the backup database node, the configuration file is obtained from the backup storage space mounted on the backup database node by executing the preset file acquisition command in the pre-selected physical backup tool. Since the backup storage space does not store all configuration files, the cluster configuration file and the configuration file acquisition link stored therein can be obtained, and then the node configuration file can be obtained through the configuration file acquisition link to obtain the complete configuration file and realize the execution of the backup task.
[0074] Specifically, when the backup storage space receives the instruction corresponding to the file acquisition command, it reads data from the storage location storing the cluster configuration file, that is, reads data from the first preset storage location, obtains the cluster configuration file, and feeds back the cluster configuration file to the physical backup tool for backup.
[0075] At the same time, data is read from the storage location of the storage configuration file acquisition link, that is, data is read from the second preset storage location to obtain the configuration file acquisition link; then data is read in the local sub-storage space of the backup database node according to the configuration file acquisition link to obtain the node configuration file, and the node configuration file is fed back to the physical backup tool for backup.
[0076] Optionally, obtaining a node configuration file corresponding to a backup database node according to a configuration file acquisition link may include: when operating the configuration file acquisition link in the backup database node, parsing the configuration file acquisition link to obtain a configuration file acquisition path; and reading data in the backup database node according to the configuration file acquisition path to obtain a node configuration file.
[0077] Specifically, the configuration file acquisition link obtained in the backup storage space is parsed to obtain the storage path contained in the link. According to the storage path, a location search is performed in the local sub-storage space of the backup database node to determine the storage location of the node configuration file, and data is read in the storage location to obtain the node configuration file, and then the node configuration file is fed back to the physical backup tool for backup.
[0078] S203. Perform a physical backup of the database cluster according to the cluster configuration file and the node configuration file.
[0079] In this application, based on the cluster configuration file and the node configuration file, backup processing is performed according to the backup strategies such as the backup frequency, the source database node to be backed up, the target database node after backup (backup storage space), etc. contained in the configuration file to complete the physical backup of the database cluster.
[0080] The above technical solution is applied to a database cluster, which includes multiple database nodes; the database cluster is pre-set with a backup storage space, which is a shared sub-storage space mounted by each database node; the above technical solution determines the backup database node that has the physical backup authority to physically back up the database cluster at the current moment; in the backup database node, according to the shared sub-storage space mounted by the backup database node, the cluster configuration file and the configuration file acquisition link required for physically backing up the database cluster are obtained; the configuration file acquisition link is used to obtain the node configuration file stored in the database node when physically backing up the database cluster in any database node; the database cluster is physically backed up according to the cluster configuration file and the node configuration file; in this way, in the event that any node in the database cluster fails, the data in the cluster can also be backed up to the backup storage space through other database nodes in the cluster, and data can also be restored from the backup storage space through any other database node, so that the server cluster can provide data services normally even when a node fails, providing the security of cluster data storage and improving cluster service performance.
[0081] Before executing the above physical backup task, the database cluster needs to be initialized, that is, an environment for physical backup needs to be built. Specifically, the initialization process can be understood as the process of generating and storing configuration files. In the technical solution of this application, the initialization of configuration files includes the initialization of cluster configuration files and the initialization of node configuration files.
[0082] Optionally, initialization of the node configuration file may include: for any database node, determining at least one node configuration item required for physical backup of the database node based on the physical backup tool called; obtaining node configuration data corresponding to the node configuration item, and writing the node configuration item and the node configuration data correspondingly into the local sub-storage space of the database node to obtain a node configuration file corresponding to the database node; generating a configuration file acquisition link corresponding to the node configuration file based on the storage path of the node configuration file in the local sub-storage space, and writing the configuration file acquisition link to the shared sub-storage space mounted on the database node.
[0083] Since different backup strategies require different configuration data during the execution of backup tasks, different configuration items can be pre-set according to different backup strategies, and corresponding configuration data can be obtained according to each configuration item to generate a configuration file.
[0084] Furthermore, if different backup tools are selected when executing the backup task, the configuration data that may cause data conflicts will also be different. Therefore, the cluster configuration items and node configuration items in the above configuration items may be determined based on the physical backup tool.
[0085] On this basis, taking any database node in the database cluster as an example, the initialization process of the grounding configuration data is introduced. Specifically, in the current database node, the configuration data is filled in by the database administrator or by reading data in the database node to obtain the configuration data corresponding to the node configuration item, that is, the node configuration data; the node configuration item and the corresponding node configuration data are correspondingly written into the preset file of the local sub-storage space in the node database, and the node configuration file is generated according to the file with written data; according to the storage path of the node configuration file in the local sub-storage space, a configuration file acquisition link for obtaining the node configuration file is generated; the configuration file acquisition link is stored in the shared sub-storage space mounted in the internal database cluster, that is, the backup storage space, so that when the backup task is subsequently executed in the database node, the required configuration data can be quickly returned from the backup storage space and the backup task can be quickly completed.
[0086] Optionally, initialization of the cluster configuration file may include: determining at least one cluster configuration item required for physical backup of the database cluster according to a preset backup strategy; obtaining cluster configuration data corresponding to the cluster configuration item in any database node, and writing the cluster configuration item and the cluster configuration data correspondingly into a shared sub-storage space mounted on the database node to obtain the cluster configuration file.
[0087] In the present application, the configuration data of the cluster configuration item may be written in any database node, or the data may be written in different database nodes respectively to obtain a cluster configuration file corresponding to the cluster configuration item, and no specific limitation is made to this.
[0088] In some optional implementations, the cluster configuration items and the corresponding cluster configuration files can be written into the local sub-storage space of each database node and stored together with the node configuration file, and a configuration file acquisition link corresponding to the corresponding cluster configuration file is generated and written into the backup storage space. This facilitates the modification of the configuration data in the configuration file and ensures that the configuration file obtained during the execution of the backup task is the latest data, thereby ensuring the reliability of the configuration file acquisition.
[0089] In some optional implementations, the cluster configuration file may be directly written into the backup storage space and stored together with the configuration file acquisition link; thus, during the configuration file acquisition process, data acquisition operations may be reduced, data acquisition efficiency may be improved, and backup efficiency may be further improved.
[0090] Figure 3 A schematic diagram of the structure of a database backup device provided in an embodiment of the present application. Figure 3, applied to a database cluster, the database cluster includes multiple database nodes; the database cluster is pre-set with a backup storage space, the backup storage space is a shared sub-storage space mounted by each database node;
[0091] The database backup device 30 comprises:
[0092] The backup node determination module 301 is used to determine the backup database node that has the physical backup authority to perform physical backup on the database cluster at the current moment;
[0093] The configuration file acquisition module 302 is used to obtain the cluster configuration file and the configuration file acquisition link required for performing physical backup of the database cluster through the shared sub-storage space mounted by the backup database node at the backup database node; the configuration file acquisition link is used to obtain the node configuration file stored in the database node when performing physical backup of the database cluster in any database node;
[0094] The backup module 303 is used to perform physical backup of the database cluster according to the cluster configuration file and the node configuration file.
[0095] In an optional implementation, the backup storage space stores a pre-written node configuration file acquisition link and a cluster configuration file;
[0096] The configuration file acquisition module 302 includes:
[0097] A cluster configuration file obtaining submodule, used to read data from a first preset storage location in the shared sub-storage space to obtain a cluster configuration file required for physical backup of the database cluster;
[0098] A configuration file acquisition link acquisition submodule is used to read data from a second preset storage location in the shared sub-storage space to obtain a configuration file acquisition link required for performing a physical backup of the database cluster;
[0099] The node configuration file acquisition submodule is used to obtain a link according to the configuration file to obtain the node configuration file corresponding to the backup database node.
[0100] In an optional implementation, the node configuration file obtains a submodule including:
[0101] A configuration file acquisition path acquisition unit is used to parse the configuration file acquisition link to obtain the configuration file acquisition path when operating the configuration file acquisition link in the backup database node;
[0102] The node configuration file obtaining unit is used to read data in the backup database node according to the configuration file obtaining path to obtain the node configuration file.
[0103] In an optional implementation, the backup node determination module 301 includes:
[0104] The backup node determination submodule is used to obtain a backup database node with physical backup authority at the current moment according to a preset backup node screening rule when there are multiple database nodes that are scheduled to perform physical backup on the database cluster at the current moment.
[0105] In an optional embodiment, the device further comprises:
[0106] A node configuration item determination module is used to determine, for any database node, at least one node configuration item required for performing physical backup on the database node according to the called physical backup tool and the preset backup strategy;
[0107] The node configuration file acquisition module is used to obtain the node configuration data corresponding to the node configuration item, write the node configuration item and the node configuration data into the local sub-storage space of the database node accordingly, and obtain the node configuration file corresponding to the database node;
[0108] The configuration file acquisition link acquisition module is used to generate a configuration file acquisition link corresponding to the node configuration file according to the storage path of the node configuration file in the local sub-storage space, and write the configuration file acquisition link to the shared sub-storage space mounted by the database node.
[0109] In an optional embodiment, the device further comprises:
[0110] A cluster configuration item determination module, used to determine at least one cluster configuration item required for performing physical backup of the database cluster according to the called physical backup tool and the preset backup strategy;
[0111] The cluster configuration file acquisition module is used to obtain cluster configuration data corresponding to cluster configuration items in any database node, and write the cluster configuration items and cluster configuration data into the shared sub-storage space mounted by the database node to obtain the cluster configuration file.
[0112] Figure 4 It is a block diagram of a server shown in an embodiment of the present application, and the server may be a computer, etc.
[0113] See also Figure 4 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .
[0114] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0115] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0116] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0117] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0118] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0119] The input / output interface 812 provides an interface between the processing component 802 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0120] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a solid image (Complementary Metal Oxide Semiconductor, CMOS) sensor or a semiconductor image (Charge-coupled Device, CCD) sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0121] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0122] In an exemplary embodiment, the device 800 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0123] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0124] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a server, enables the server to execute the above database backup method.
[0125] The embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the database backup method in the above embodiment.
[0126] The embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed on a computer, the computer executes the technical solution of the database backup method of the above embodiment.
[0127] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the database backup method in the above embodiment can be implemented.
[0128] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0129] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0130] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0131] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A database backup method, characterized in that: Applied to a database cluster, the database cluster includes a plurality of database nodes; the database cluster is pre-configured with a backup storage space, the backup storage space is a shared sub-storage space mounted by each of the database nodes; The database backup method comprises: Determine a backup database node that has physical backup authority to perform physical backup of the database cluster at the current moment; In the backup database node, a cluster configuration file and a configuration file acquisition link required for performing a physical backup of the database cluster are obtained according to the shared sub-storage space mounted by the backup database node; the configuration file acquisition link is used to obtain a node configuration file stored in the database node when performing a physical backup of the database cluster in any database node; The database cluster is physically backed up according to the cluster configuration file and the node configuration file.
2. The method according to claim 1, characterized in that The backup storage space stores a pre-written node configuration file acquisition link and a cluster configuration file; According to the shared sub-storage space mounted on the backup database node, a cluster configuration file and a node configuration file required for performing a physical backup of the database cluster are obtained, including: Reading data at a first preset storage location of the shared sub-storage space to obtain a cluster configuration file required for performing a physical backup of the database cluster; Reading data at a second preset storage location of the shared sub-storage space to obtain a configuration file acquisition link required for performing a physical backup of the database cluster; The node configuration file corresponding to the backup database node is obtained according to the configuration file acquisition link.
3. The method according to claim 2, characterized in that Obtaining a node configuration file corresponding to the backup database node according to the configuration file acquisition link includes: When operating the configuration file acquisition link in the backup database node, parsing the configuration file acquisition link to obtain a configuration file acquisition path; Data is read in the backup database node according to the configuration file acquisition path to obtain the node configuration file.
4. The method according to any one of claims 1 to 3, characterized in that: Determining a backup database node that has physical backup authority for physically backing up the database cluster at the current moment includes: When there are multiple database nodes that are preparing to physically back up the database cluster at the current moment, a backup database node that has physical backup authority at the current moment is obtained according to a preset backup node screening rule.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: For any database node, determining at least one node configuration item required for performing physical backup on the database node according to the called physical backup tool and the preset backup strategy; Obtaining node configuration data corresponding to the node configuration item, and writing the node configuration item and the node configuration data into the local sub-storage space of the database node accordingly, to obtain a node configuration file corresponding to the database node; A configuration file acquisition link corresponding to the node configuration file is generated according to the storage path of the node configuration file in the local sub-storage space, and the configuration file acquisition link is written to the shared sub-storage space mounted on the database node.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Determine, according to the called physical backup tool and the preset backup strategy, at least one cluster configuration item required for performing physical backup of the database cluster; In any database node, cluster configuration data corresponding to the cluster configuration item is obtained, and the cluster configuration item and the cluster configuration data are correspondingly written into the shared sub-storage space mounted by the database node to obtain a cluster configuration file.
7. A database backup device, characterized in that: Applied to a database cluster, the database cluster includes a plurality of database nodes; the database cluster is pre-configured with a backup storage space, the backup storage space is a shared sub-storage space mounted by each of the database nodes; The database backup device comprises: A backup node determination module, used to determine a backup database node that has physical backup authority to perform physical backup on the database cluster at the current moment; A configuration file acquisition module is used to obtain, at the backup database node, a cluster configuration file and a configuration file acquisition link required for performing a physical backup of the database cluster through a shared sub-storage space mounted by the backup database node; the configuration file acquisition link is used to obtain a node configuration file stored in the database node when performing a physical backup of the database cluster in any database node; The backup module is used to perform physical backup of the database cluster according to the cluster configuration file and the node configuration file.
8. A server, characterized in that: include: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When executing the computer-executable instruction, the processor is used to implement the database backup method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the database backup method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when the computer program is executed by a processor.