CN112596948A - Database cluster data backup method, device, equipment and storage medium - Google Patents
Database cluster data backup method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112596948A CN112596948A CN202011523078.3A CN202011523078A CN112596948A CN 112596948 A CN112596948 A CN 112596948A CN 202011523078 A CN202011523078 A CN 202011523078A CN 112596948 A CN112596948 A CN 112596948A
- Authority
- CN
- China
- Prior art keywords
- data
- backup
- volume
- database
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1479—Generic software techniques for error detection or fault masking
- G06F11/1482—Generic software techniques for error detection or fault masking by means of middleware or OS functionality
- G06F11/1484—Generic software techniques for error detection or fault masking by means of middleware or OS functionality involving virtual machines
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention belongs to the technical field of computers, and discloses a database cluster data backup method, a device, equipment and a storage medium. The invention determines system volume information, data volume information and hardware configuration information by scanning the database cluster; determining system backup data according to the system volume information, and determining database backup data according to the data volume information; creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine; and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information. The data of the database cluster is divided into system backup data and database backup data by scanning, so that the method can adapt to complex scenes, and then the database backup data is converted into data volume backup data convenient to read, so that the cluster backup data can be used for quick reconstruction.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a database cluster data backup method, apparatus, device, and storage medium.
Background
At present, two data backup methods for a database cluster are mainly used, one is to backup data through a database backup interface, corresponding database software is installed on a prepared target computer when a service is to be restored, and then the service data is restored to the database software of the target computer. Another method is to perform a whole computer backup, backup the operating system, application program, service data and partition, volume, file system metadata of the disk, and the like of the computer, and when a service is required to be restored, restore the backed-up data to the target computer as a whole to realize the quick reconstruction of the service system, although this method can simply and quickly realize the reconstruction of the service system, the following problems exist:
1. data cannot be normally backed up in a complex scene, for example, complex multipath storage equipment exists;
2. too much data related to a non-business system is integrally backed up, so that resources are wasted, for example, the space of a database table is large, but actual data is few;
3. the backup of partial data cannot be realized, and the method is not flexible enough.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a database cluster data backup method, a database cluster data backup device and a database cluster data backup storage medium, and aims to solve the technical problem that the conventional database cluster data backup method cannot provide backup data which is suitable for complex scenes and can quickly realize business system reconstruction.
To achieve the above object, the present invention provides a method comprising the steps of:
scanning the database cluster to determine system volume information, data volume information and hardware configuration information;
determining system backup data according to the system volume information, and determining database backup data according to the data volume information;
creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine;
and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information.
Optionally, the step of scanning the database cluster to determine the system volume information, the data volume information, and the hardware configuration information includes:
scanning the database cluster to acquire disk information and hardware configuration information;
removing the duplication of the disk information according to the disk identification in the disk information to determine physical disk information;
and determining system volume information and data volume information according to the physical disk information.
Optionally, the step of determining system volume information and data volume information according to the physical disk information includes:
acquiring block equipment in a database cluster according to the physical disk information;
analyzing the metadata of the block devices to determine respective volume devices;
and acquiring the use of each volume device and dividing each data volume into a system volume or a data volume according to the use of the volume device so as to acquire system volume information and data volume information.
Optionally, the step of determining system backup data according to the system volume information and determining database backup data according to the data volume information includes:
determining each system volume according to the system volume information, and carrying out full backup on the data of each system volume to obtain system backup data;
and determining each data volume according to the data volume information, and exporting the data of each data volume to obtain database backup data.
Optionally, the step of creating a data synthesis virtual machine according to the hardware configuration information and the system backup data includes:
determining the hardware configuration of a target computer node in the database cluster according to the hardware configuration information;
determining system data of the target computer node according to the system backup data;
and creating a data synthesis virtual machine according to the hardware configuration and the system data.
Optionally, the step of obtaining the backup data of the data volume according to the backup data of the database by the data synthesis virtual machine includes:
formatting a virtual disk in the data synthesis virtual machine according to the hardware configuration information, and reconstructing a database cluster in the data synthesis virtual machine according to the hardware configuration information;
when the virtual disk formatting is finished, starting a database instance in the data synthesis virtual machine;
and importing the database backup data into the database instance through a data import interface to obtain the data volume backup data.
Optionally, after the step of constructing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data, and the hardware configuration information, the method further includes:
when the database cluster is detected to be abnormal, cluster backup point data corresponding to the database cluster is obtained;
and rapidly reconstructing a database cluster on a target computer cluster according to the cluster backup point data.
In addition, in order to achieve the above object, the present invention further provides a database cluster data backup apparatus, where the database cluster data backup apparatus includes the following modules:
the information determining module is used for scanning the database cluster to determine system volume information, data volume information and hardware configuration information;
the data backup module is used for determining system backup data according to the system volume information and determining database backup data according to the data volume information;
the data synthesis module is used for creating a data synthesis virtual machine according to the hardware configuration information and the system backup data and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine;
and the backup construction module is used for constructing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information.
In addition, to achieve the above object, the present invention further provides a database cluster data backup device, where the database cluster data backup device includes: a memory, a processor and a database cluster data backup program stored on the memory and executable on the processor, the database cluster data backup program when executed by the processor implementing the steps of the database cluster data backup method as described above.
In addition, in order to achieve the above object, the present invention further provides a computer-readable storage medium, on which a database cluster data backup program is stored, and when the database cluster data backup program is executed, the steps of the database cluster data backup method as described above are implemented.
The invention determines system volume information, data volume information and hardware configuration information by scanning the database cluster; determining system backup data according to the system volume information, and determining database backup data according to the data volume information; creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine; and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information. The data of the database cluster is divided into system backup data and database backup data by scanning, so that the method can adapt to complex scenes, and then the database backup data is converted into data volume backup data convenient to read, so that the cluster backup data can be used for quick reconstruction.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a database cluster data backup method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a database cluster data backup method according to a second embodiment of the present invention;
fig. 4 is a block diagram illustrating a first embodiment of a database cluster data backup apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a database cluster data backup device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a database cluster data backup program.
In the electronic apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be arranged in a database cluster data backup device, and the electronic device calls a database cluster data backup program stored in the memory 1005 through the processor 1001 and executes the database cluster data backup method provided in the embodiment of the present invention.
An embodiment of the present invention provides a database cluster data backup method, and referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a database cluster data backup method according to the present invention.
In this embodiment, the database cluster data backup method includes the following steps:
step S10: the database cluster is scanned to determine system volume information, data volume information, and hardware configuration information.
It should be noted that, the execution main body of this embodiment may be the database cluster data backup device, and the database cluster data backup device may be an electronic device such as a personal computer, a server, and the like, and may also be other devices that can achieve the same or similar functions.
It should be noted that the database cluster may be a cluster composed of a plurality of computer nodes, for example: an Oracle real application cluster (Oracle RAC) of an Oracle database is formed by a plurality of computer nodes, and provides database service to the outside of the cluster, data is stored in shared storage, and the cluster can normally provide the database service to the outside as long as all the computer nodes on the cluster are not down. The system volume information may include information such as the size of each system volume, the identity of the system volume, the access path of the system volume, etc. The data volume information may include information such as the size of each data volume, the identity of the data volume, the access path of the data volume, etc. The hardware configuration information may include hardware configuration information of each computer node in the database cluster, such as: the number of network cards, MAC address information, the number of CPUs, the size of the memory and the like.
Further, in order to obtain the system volume information, the data volume information, and the hardware configuration information, step S10 of this embodiment may include:
step S101: and scanning the database cluster to acquire disk information and hardware configuration information.
It should be noted that the disk information may include information such as the size of a disk and a disk identifier of each computer node in the database cluster. The disk identifier may be a unique value obtained by performing a hash operation on metadata written in a specific area of the disk (for example, a head area and a tail area of the disk or a head area and a tail area of a disk partition) when the disk performs initialization, and the disk identifiers are different for different disks.
Step S102: and removing the duplication of the disk information according to the disk identification in the disk information to determine the physical disk information.
It should be noted that, in the database cluster, the disks are divided into two types: the shared disk is a disk shared by a plurality of computer nodes, and the shared disk repeatedly scanned when each computer node is scanned can be deduplicated according to the disk identification to determine the physical disk information. And after the disk information is subjected to deduplication according to the disk identification, the obtained disk information is the physical disk information.
For example: scanning 3 disk information on a computer node A, wherein corresponding disk identifiers are respectively '1111', 'aaaa' and 'bbbb', scanning 3 disk information on a settlement node B, wherein corresponding disk identifiers are respectively '2222', 'aaaa' and 'bbbb', so that the disks corresponding to the disk identifiers 'aaaa' and 'bbbb' are shared disks, the disks corresponding to the disk identifiers '1111' and '2222' are built-in disks, the total number of the scanned disk information is 6, and after deduplication is performed according to the disk identifiers, the total number of the disk information is 4, namely the disk information corresponding to the disk identifiers '1111', '2222', 'aaaa' and 'bbbb', namely the physical disk information.
Step S103: and determining system volume information and data volume information according to the physical disk information.
The volume device may be a computing storage area, the volume device may be one disk partition, or may be a combination of a plurality of disk partitions, after the volume device is acquired, the volume device may be divided into a system volume and a data volume according to different applications of the volume device, and the system volume information and the data volume information may be acquired according to the divided system volume and data volume. The system volume information may include information such as the size of the system volume, the amount of data in the system volume, the identity of the system volume, etc. The volume information may include information such as the size of the volume, the amount of data in the volume, the identity of the volume, etc.
Further, in order to determine the system volume information and the data volume information according to the physical disk information, step S103 of this embodiment may include:
acquiring block equipment in a database cluster according to the physical disk information; analyzing the metadata of the block devices to determine respective volume devices; and acquiring the use of each volume device and dividing each data volume into a system volume or a data volume according to the use of the volume device so as to acquire system volume information and data volume information.
It should be noted that the block device may be a device that stores data in units of blocks in a computer, the block device may be one partition in a disk, or may be an entire disk (when there is only one partition in the disk), the metadata in the block device may be data stored in a specific area (a head area or a tail area) of the block device, and the metadata records information such as a use of the block device, and therefore, the metadata in the block device may be analyzed to determine each volume device. The volume device is divided into a system volume or a data volume according to the use of the volume device, for example: volume devices storing system files are divided into system volumes, and volume devices storing non-system files are divided into data volumes.
Step S20: and determining system backup data according to the system volume information, and determining database backup data according to the data volume information.
It should be noted that the system backup data may be backup data generated according to data in the system volume, and the database backup data may be backup data generated according to data in the data volume.
Further, in order to adapt to various complex situations, step S20 of the present embodiment may include:
determining each system volume according to the system volume information, and carrying out full backup on the data of each system volume to obtain system backup data; and determining each data volume according to the data volume information, and exporting the data of each data volume to obtain database backup data.
It should be noted that, the full backup is also called a whole backup, and may be to use target data, such as: and all metadata such as an operating system, an application program, service data, a disk partition, a volume, a file system and the like are backed up to generate backup data. The system backup data may be backup data obtained by performing full backup on data in the system volume. The database backup data may be backup data obtained by exporting data in the data volume through a backup interface, the database backup data may include cluster data and database data, the cluster data may include shared storage configuration information and cluster configuration information, the shared storage configuration information may be exported through an sql plus command, for example, "create file"/tmp/asm. The database data may include data such as data files, parameter files, control files, and fixed logs, and may be exported using a backup interface, for example: the database data is exported using the rman (recovery manager) interface.
In actual use, according to actual needs, when exporting data in a data volume using a backup interface, the data may also be screened, for example: the data volume contains data of 3 departments of an IT department, a legal department and a financial department, only the data of the IT department and the data of the financial department are allowed to be backed up according to actual needs, at the moment, the data of the legal department can be screened out, and only a backup interface is used for exporting the data of the IT department and the data of the financial department.
Step S30: and creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine.
It should be noted that the data synthesis virtual machine may be a virtual machine established according to the hardware configuration information and used for synthesizing the database backup data into the data volume backup data. The exported database backup data can be converted into data volume backup data convenient to read through the data synthesis virtual machine.
Further, in order to facilitate data synthesis, the step of creating a data synthesis virtual machine according to the hardware configuration information and the system backup data in this embodiment may include:
determining the hardware configuration of a target computer node in the database cluster according to the hardware configuration information; determining system data of the target computer node according to the system backup data; and creating a data synthesis virtual machine according to the hardware configuration and the system data.
It should be noted that the target computer node may be a randomly selected computer node among the computer nodes in the database cluster. The system data may include metadata such as an operating system, an application program, service data, a disk partition, a volume, a file system, and the like in the computer node, and the hardware configuration may include hardware information such as the number of disks, the size of the disks, the type of the disks, the number of CPUs, the size of the memory, and the like.
For example: there are A, B, C computer nodes in the database cluster, and the hardware configuration of each computer node is: 2 network cards, 8 CPUs (central processing units), 32G memories, 1 block of a 500GB built-in disk and 3 blocks of a 1024GB shared disk. Any one of the three computer nodes can be selected as a target computer node, and assuming that a computer node B is selected as the target computer node, 1 block of 500GB virtual built-in disk and 3 blocks of 1024GB virtual shared disk can be created according to hardware configuration, a virtual machine is constructed according to the created 4 virtual disks in total, system data of the computer node B is acquired from system backup data, and the system data is written into the virtual built-in disk of the virtual machine, so that creation of a data synthesis virtual machine can be completed.
Further, to illustrate how to synthesize the data volume backup data, the step of obtaining the data volume backup data according to the database backup data by the data synthesis virtual machine in this embodiment may include:
formatting a virtual disk in the data synthesis virtual machine according to the hardware configuration information, and reconstructing a database cluster in the data synthesis virtual machine according to the hardware configuration information; when the virtual disk formatting is finished, starting a database instance in the data synthesis virtual machine; and importing the database backup data into the database instance through a data import interface to obtain the data volume backup data.
It should be noted that, data on the virtual built-in disk in the data synthesis virtual machine is consistent with data in the built-in disk of the target computer node, that is, data on the disk structure, the volume, and the like in the data synthesis virtual machine are consistent with the target computer node, so that the operating system can be started normally after the virtual machine is started, but data on the virtual shared disk in the data synthesis virtual machine is empty, so that neither the database cluster nor the database, and the like can work, and database cluster reconstruction needs to be performed in the data synthesis virtual machine.
In actual use, the data synthesis virtual machine may be started, the virtual shared disk in the data synthesis virtual machine is formatted into a format that can be identified by the database Cluster, the Cluster Service in the data synthesis virtual machine is stopped, and then the crs Service (Oracle Cluster Ready Service) is started in an exclusive mode, that is, the database Cluster reconstruction may be completed in the data synthesis virtual machine.
For example: starting the DATA synthesis virtual machine, firstly reconstructing a disk group (the name can be consistent with that in a target price computer node, such as + DATA), formatting a virtual shared disk in the DATA synthesis virtual machine into a format recognizable by a database cluster, and using sqlplus statements, such as 'create distribution DATA NORMAL reproduction disk'/dev/sdb ',' dev/sdc ',' dev/sdd 'attribute' compatible.asm '═ 11.2'; and then using an sql plus command to import the shared storage configuration information into the cluster, such as "create spfile" + DATA "from pffile"/tmp/asm. pffile' ", and finally importing the configuration information of the cluster, which can be executed using an ocrconfig command, such as" ocrconfig-restore/tmp/ocr.cfg ", and finally reconfiguring the election disk to be placed on the created disk group (+ DATA), and using a crsctl command, such as: "crsctl replace votedisk + DATA". And at this point, rebuilding the database cluster in the data synthesis virtual machine.
It should be noted that, because the virtual shared disk is just created and has no data, starting a database service in a database cluster reconstructed in the data synthesis virtual machine may fail, at this time, an empty database instance may be started first, and then the database backup data is imported into the database instance through the import interface, that is, data is written into the virtual shared disk, and after the data is written, the data in the virtual shared disk may be used as the data volume backup data.
In actual use, the import interface can use a rman interface to write the data files, the parameter files and the control files in the database backup data into the database instance. If a plurality of databases exist, the same operation can be performed on each database, and according to actual needs, the database backup data can be screened, so that the database backup data which are not needed are screened out.
Step S40: and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information.
It can be understood that the complete backup data of the database cluster, i.e., the cluster backup point data, can be obtained by combining the system backup data, the data volume backup data, and the hardware configuration information. Because the database backup data is converted into the data volume backup data which is convenient to read when the cluster backup point data is constructed, the constructed cluster backup point data can be used for quickly reconstructing the database cluster.
In this embodiment, the database cluster is scanned to determine system volume information, data volume information, and hardware configuration information; determining system backup data according to the system volume information, and determining database backup data according to the data volume information; creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine; and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information. The data of the database cluster is divided into system backup data and database backup data by scanning, so that the method can adapt to complex scenes, and then the database backup data is converted into data volume backup data convenient to read, so that the cluster backup data can be used for quick reconstruction.
Referring to fig. 3, fig. 3 is a flowchart illustrating a database cluster data backup method according to a second embodiment of the present invention.
Based on the first embodiment, after step S40, the database cluster data backup method in this embodiment further includes:
step S50: and when the database cluster is detected to be abnormal, acquiring cluster backup point data corresponding to the database cluster.
It can be understood that, when the database cluster is abnormal and cannot run, the database cluster needs to be quickly reconstructed and restored as soon as possible to provide services. At this time, cluster backup point data corresponding to the database cluster can be searched, and the database cluster is quickly reconstructed according to the cluster backup point data.
Step S60: and rapidly reconstructing a database cluster on a target computer cluster according to the cluster backup point data.
The target computer cluster may be a cluster formed by the computer nodes of the original database cluster, or may be a new cluster having the same configuration as the computer nodes of the original database cluster.
In practical use, any computer on a target computer cluster can be selected as a target recovery node, any computer node in an original database cluster is selected as an initial recovery node, system volume data corresponding to the initial recovery node is extracted from cluster backup point data, starting data necessary for starting the system is extracted from the system volume data, the starting data is pushed to the target recovery node to ensure that an operating system of the target recovery node can be started normally, a reduction detection program pre-installed in the target recovery node is started along with the starting of the target recovery node, the reduction detection program can capture all disk read-write operations of the system and judge whether the data of a disk area corresponding to the disk read-write operations are reduced, if the data are not reduced, the data are read from database cluster data backup equipment and written into a disk, and then, the disk read-write operation is released, so that the service can be normally provided no matter whether the data on the disk is restored or not. When the system disk is free to read and write, the restoration detection program actively scans the data on the disk, reads the data of the unreduced area from the database cluster data backup device, retrieves the data, writes the data into the disk, and can rebuild other nodes in the target computer cluster after the data in the target recovery node is restored. And when all the nodes in the target computer cluster are recovered, finishing the reconstruction of the whole service system.
In this embodiment, when the database cluster is detected to be abnormal, cluster backup point data corresponding to the database cluster is obtained; and rapidly reconstructing a database cluster on a target computer cluster according to the cluster backup point data. Because the cluster backup point data corresponding to the database cluster is obtained at the first time when the database cluster is detected to be abnormal and the database cluster is reconstructed on the selected target computer cluster, the database cluster can be ensured to be quickly recovered and corresponding service can be provided, the service interruption time is reduced, and the service continuity is improved.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a database cluster data backup program, and the database cluster data backup program, when executed by a processor, implements the steps of the database cluster data backup method described above.
Referring to fig. 4, fig. 4 is a block diagram illustrating a first embodiment of a database cluster data backup apparatus according to the present invention.
As shown in fig. 4, the database cluster data backup apparatus according to the embodiment of the present invention includes:
an information determining module 401, configured to scan the database cluster to determine system volume information, data volume information, and hardware configuration information;
a data backup module 402, configured to determine system backup data according to the system volume information, and determine database backup data according to the data volume information;
a data synthesis module 403, configured to create a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtain data volume backup data according to the database backup data through the data synthesis virtual machine;
a backup construction module 404, configured to construct cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data, and the hardware configuration information.
In this embodiment, the database cluster is scanned to determine system volume information, data volume information, and hardware configuration information; determining system backup data according to the system volume information, and determining database backup data according to the data volume information; creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine; and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information. The data of the database cluster is divided into system backup data and database backup data by scanning, so that the method can adapt to complex scenes, and then the database backup data is converted into data volume backup data convenient to read, so that the cluster backup data can be used for quick reconstruction.
Further, the information determining module 401 is further configured to scan the database cluster to obtain disk information and hardware configuration information; removing the duplication of the disk information according to the disk identification in the disk information to determine physical disk information; and determining system volume information and data volume information according to the physical disk information.
Further, the information determining module 401 is further configured to obtain a block device in a database cluster according to the physical disk information; analyzing the metadata of the block devices to determine respective volume devices; and acquiring the use of each volume device and dividing each data volume into a system volume or a data volume according to the use of the volume device so as to acquire system volume information and data volume information.
Further, the data backup module 402 is further configured to determine each system volume according to the system volume information, and perform full backup on data of each system volume to obtain system backup data; and determining each data volume according to the data volume information, and exporting the data of each data volume to obtain database backup data.
Further, the data synthesis module 403 is further configured to determine the hardware configuration of the target computer node in the database cluster according to the hardware configuration information; determining system data of the target computer node according to the system backup data; and creating a data synthesis virtual machine according to the hardware configuration and the system data.
Further, the data synthesis module 403 is further configured to format a virtual disk in the data synthesis virtual machine according to the hardware configuration information, and reconstruct a database cluster in the data synthesis virtual machine according to the hardware configuration information; when the virtual disk formatting is finished, starting a database instance in the data synthesis virtual machine; and importing the database backup data into the database instance through a data import interface to obtain the data volume backup data.
Further, the backup construction module 404 is further configured to, when detecting that the database cluster is abnormal, obtain cluster backup point data corresponding to the database cluster; and rapidly reconstructing a database cluster on a target computer cluster according to the cluster backup point data.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may be referred to a database cluster data backup method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A database cluster data backup method is characterized by comprising the following steps:
scanning the database cluster to determine system volume information, data volume information and hardware configuration information;
determining system backup data according to the system volume information, and determining database backup data according to the data volume information;
creating a data synthesis virtual machine according to the hardware configuration information and the system backup data, and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine;
and establishing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information.
2. The database cluster data backup method of claim 1, wherein said step of scanning the database cluster to determine system volume information, data volume information, and hardware configuration information comprises:
scanning the database cluster to acquire disk information and hardware configuration information;
removing the duplication of the disk information according to the disk identification in the disk information to determine physical disk information;
and determining system volume information and data volume information according to the physical disk information.
3. The database cluster data backup method according to claim 2, wherein said step of determining system volume information and data volume information based on said physical disk information comprises:
acquiring block equipment in a database cluster according to the physical disk information;
analyzing the metadata of the block devices to determine respective volume devices;
and acquiring the use of each volume device and dividing each data volume into a system volume or a data volume according to the use of the volume device so as to acquire system volume information and data volume information.
4. The database cluster data backup method of any of claims 1-3, wherein the step of determining system backup data based on the system volume information and determining database backup data based on the data volume information comprises:
determining each system volume according to the system volume information, and carrying out full backup on the data of each system volume to obtain system backup data;
and determining each data volume according to the data volume information, and exporting the data of each data volume to obtain database backup data.
5. The database cluster data backup method of any of claims 1-3, wherein the step of creating a data composition virtual machine based on the hardware configuration information and the system backup data comprises:
determining the hardware configuration of a target computer node in the database cluster according to the hardware configuration information;
determining system data of the target computer node according to the system backup data;
and creating a data synthesis virtual machine according to the hardware configuration and the system data.
6. The database cluster data backup method according to any of claims 1-3, wherein said step of obtaining data volume backup data from said database backup data by said data synthesis virtual machine comprises:
formatting a virtual disk in the data synthesis virtual machine according to the hardware configuration information, and reconstructing a database cluster in the data synthesis virtual machine according to the hardware configuration information;
when the virtual disk formatting is finished, starting a database instance in the data synthesis virtual machine;
and importing the database backup data into the database instance through a data import interface to obtain the data volume backup data.
7. The database cluster data backup method according to any of claims 1-3, wherein after the step of constructing cluster backup point data corresponding to the database cluster based on the system backup data, the data volume backup data, and the hardware configuration information, further comprising:
when the database cluster is detected to be abnormal, cluster backup point data corresponding to the database cluster is obtained;
and rapidly reconstructing a database cluster on a target computer cluster according to the cluster backup point data.
8. The database cluster data backup device is characterized by comprising the following modules:
the information determining module is used for scanning the database cluster to determine system volume information, data volume information and hardware configuration information;
the data backup module is used for determining system backup data according to the system volume information and determining database backup data according to the data volume information;
the data synthesis module is used for creating a data synthesis virtual machine according to the hardware configuration information and the system backup data and obtaining data volume backup data according to the database backup data through the data synthesis virtual machine;
and the backup construction module is used for constructing cluster backup point data corresponding to the database cluster according to the system backup data, the data volume backup data and the hardware configuration information.
9. A database cluster data backup device, characterized in that the database cluster data backup device comprises: memory, processor and database cluster data backup program stored on the memory and executable on the processor, which when executed by the processor performs the steps of the database cluster data backup method according to any of claims 1-7.
10. A computer-readable storage medium, having stored thereon a database cluster data backup program which, when executed, performs the steps of the database cluster data backup method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011523078.3A CN112596948B (en) | 2020-12-21 | 2020-12-21 | Database cluster data backup method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011523078.3A CN112596948B (en) | 2020-12-21 | 2020-12-21 | Database cluster data backup method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112596948A true CN112596948A (en) | 2021-04-02 |
CN112596948B CN112596948B (en) | 2024-04-02 |
Family
ID=75199837
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011523078.3A Active CN112596948B (en) | 2020-12-21 | 2020-12-21 | Database cluster data backup method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112596948B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2025130133A1 (en) * | 2023-12-22 | 2025-06-26 | 杭州阿里云飞天信息技术有限公司 | Data processing method, system and apparatus |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100115332A1 (en) * | 2008-11-06 | 2010-05-06 | Weimin Zheng | Virtual machine-based on-demand parallel disaster recovery system and the method thereof |
US20120072685A1 (en) * | 2010-09-16 | 2012-03-22 | Hitachi, Ltd. | Method and apparatus for backup of virtual machine data |
CN103810058A (en) * | 2012-11-12 | 2014-05-21 | 华为技术有限公司 | Backup method, equipment and system for virtual machine |
CN104239166A (en) * | 2014-09-11 | 2014-12-24 | 武汉噢易云计算有限公司 | Method for realizing file backup for running virtual machine |
CN107133131A (en) * | 2017-05-31 | 2017-09-05 | 广州鼎甲计算机科技有限公司 | A kind of virtual machine synthesized backup method based on VMware |
CN107783826A (en) * | 2016-08-26 | 2018-03-09 | 北京金山云网络技术有限公司 | A kind of virtual machine migration method, apparatus and system |
CN107908501A (en) * | 2017-10-26 | 2018-04-13 | 南京壹进制信息技术股份有限公司 | A kind of VMware virtual machine synthesized backup methods based on index |
CN108804248A (en) * | 2017-04-28 | 2018-11-13 | 南京壹进制信息技术股份有限公司 | A kind of automatic Verification method of volume real-time guard data |
CN110941515A (en) * | 2019-12-04 | 2020-03-31 | 深圳市科力锐科技有限公司 | Host backup reconstruction method, device, server and storage medium |
CN111651305A (en) * | 2020-08-05 | 2020-09-11 | 腾讯科技(深圳)有限公司 | Virtual machine backup method, virtual machine backup assembly and cloud computing system |
-
2020
- 2020-12-21 CN CN202011523078.3A patent/CN112596948B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100115332A1 (en) * | 2008-11-06 | 2010-05-06 | Weimin Zheng | Virtual machine-based on-demand parallel disaster recovery system and the method thereof |
US20120072685A1 (en) * | 2010-09-16 | 2012-03-22 | Hitachi, Ltd. | Method and apparatus for backup of virtual machine data |
CN103810058A (en) * | 2012-11-12 | 2014-05-21 | 华为技术有限公司 | Backup method, equipment and system for virtual machine |
CN104239166A (en) * | 2014-09-11 | 2014-12-24 | 武汉噢易云计算有限公司 | Method for realizing file backup for running virtual machine |
CN107783826A (en) * | 2016-08-26 | 2018-03-09 | 北京金山云网络技术有限公司 | A kind of virtual machine migration method, apparatus and system |
CN108804248A (en) * | 2017-04-28 | 2018-11-13 | 南京壹进制信息技术股份有限公司 | A kind of automatic Verification method of volume real-time guard data |
CN107133131A (en) * | 2017-05-31 | 2017-09-05 | 广州鼎甲计算机科技有限公司 | A kind of virtual machine synthesized backup method based on VMware |
CN107908501A (en) * | 2017-10-26 | 2018-04-13 | 南京壹进制信息技术股份有限公司 | A kind of VMware virtual machine synthesized backup methods based on index |
CN110941515A (en) * | 2019-12-04 | 2020-03-31 | 深圳市科力锐科技有限公司 | Host backup reconstruction method, device, server and storage medium |
CN111651305A (en) * | 2020-08-05 | 2020-09-11 | 腾讯科技(深圳)有限公司 | Virtual machine backup method, virtual machine backup assembly and cloud computing system |
Non-Patent Citations (3)
Title |
---|
JOHN PATRICK BARROWCLOUGH等: "Securing Cloud Hypervisors:A Survey of the Threats, Volnerabilities, and Countermeasures", 《SECURITY AND COMMUNICATION NETWORKS》, 11 January 2018 (2018-01-11), pages 1 - 21 * |
王晋明等: "一种改进的持续数据保护系统远程恢复方法", 《现代计算机》, no. 04, 15 February 2016 (2016-02-15), pages 54 - 58 * |
魏强: "一种网络备份系统的存储优化研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 03, 15 March 2012 (2012-03-15), pages 138 - 115 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2025130133A1 (en) * | 2023-12-22 | 2025-06-26 | 杭州阿里云飞天信息技术有限公司 | Data processing method, system and apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN112596948B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102591982A (en) | Method and system of performing incremental sql server database backups | |
CN108984343B (en) | A virtual machine backup and storage management method based on content analysis | |
CN111414362A (en) | Data reading method, device, equipment and storage medium | |
CN110647425A (en) | Database recovery method and device | |
CN114924914B (en) | Disk partition table information backup and recovery method and system | |
CN109947712A (en) | Automatically merge method, system, equipment and the medium of file in Computational frame | |
CN114153690B (en) | Program memory monitoring method, device, computer equipment and storage medium | |
CN112596948B (en) | Database cluster data backup method, device, equipment and storage medium | |
CN105574026A (en) | Method and device for service supporting by using non-relational database | |
CN112596954B (en) | Data backup and reconstruction method, device, equipment and storage medium | |
CN108228611B (en) | Document information copying method and device | |
CN108681494B (en) | Backup data restoration method and device, user equipment and storage medium | |
CN109324867A (en) | A virtual machine temporary storage method, recovery method and device | |
CN114722261B (en) | Resource processing method and device, electronic equipment and storage medium | |
CN111176901A (en) | HDFS deleted file recovery method, terminal device and storage medium | |
CN111786808A (en) | Cloud system migration method, device and hybrid cloud system | |
CN113505026B (en) | Method, device and equipment for verifying backup data and storage medium | |
CN117112305A (en) | Test data recovery method, device, equipment, medium and product | |
CN111399774B (en) | Data processing method and device based on snapshot under distributed storage system | |
CN113467997A (en) | Data recovery method and device, mobile device and storage medium | |
CN112860694A (en) | Method, device and equipment for processing service data | |
CN119179605B (en) | A method and related device for saving and restoring snapshots of electromagnetic transient simulation operation state | |
CN111240873A (en) | Code error record management method and device | |
US20230068819A1 (en) | Environment construction support device and environment construction support method | |
CN113553329A (en) | Data integration system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |