Cluster data recovery method and device, server, medium and product
By users selecting backup data and recovery targets and automatically performing data recovery, combined with parallel data recovery and multi-thread replication technology, the problem of low efficiency in relational database cluster data recovery in the existing technology is solved, and more efficient cluster data recovery is achieved.
Patent Information
- Application Number
- CN202310336225.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
The data recovery efficiency of existing relational database clusters in disaster, failure, migration and other scenarios is low, requiring operation and maintenance personnel to manually synchronize data, and the recovery process is cumbersome.
Provide a cluster data recovery method that allows users to select backup data and recovery targets on the front-end display interface, automatically perform data recovery in the order of cluster master nodes and slave nodes, and use parallel data recovery methods and multi-thread replication technology to generate restored data The cluster master node and slave node, and re-establish the Pgpool cluster.
It improves the data recovery efficiency of relational database clusters, reduces the manual operations of operation and maintenance personnel, and improves recovery speed and efficiency.
Smart Images

Figure CN118733333A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a cluster data recovery method, device, server, medium and product. Background Art
[0002] Object-relational databases such as PostgreSQL are widely used, and cluster deployment is the main method of actual use. There are many ways to build PostgreSQL, and Pgpool middleware is generally used. Currently, the industry has the following problems when recovering data in disaster, failure, migration and other scenarios for relational database clusters - Pgpool clusters: only backup data can be used to restore to the master node first, and then the operation and maintenance personnel manually synchronize the master node data to each slave node, and finally build the cluster, and the cluster recovery efficiency is very low.
[0003] Therefore, the current data recovery method for relational database clusters is inefficient. Summary of the invention
[0004] The present invention provides a cluster data recovery method, device, server, medium and product, which are used to solve the problem of low efficiency of the current data recovery method of relational database cluster.
[0005] A first aspect of an embodiment of the present invention provides a cluster data recovery method, the method is applied to a cluster data recovery server, the cluster data recovery server is communicatively connected to a cluster of data to be recovered, the cluster includes: a cluster master node and a cluster slave node, the method includes:
[0006] In response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data and data recovery target are determined; the data recovery target at least includes: the cluster master node and at least one cluster slave node;
[0007] Performing data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second, to generate a cluster master node and cluster slave nodes after data recovery;
[0008] The cluster master node and the cluster slave nodes after data recovery are subjected to cluster reconstruction processing to complete cluster data recovery.
[0009] Optionally, in the method described above, the cluster is a Pgpool cluster; the cluster master node and the cluster slave node both include a PostgreSQL database; there are multiple cluster slave nodes;
[0010] The performing data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second to generate the cluster master node and cluster slave node after data recovery includes:
[0011] Restoring the backup data to the PostgreSQL database of the cluster master node to generate a cluster master node after data restoration;
[0012] The backup data is restored to the PostgreSQL database of all cluster slave nodes using a parallel data recovery method to generate cluster slave nodes after data recovery.
[0013] Optionally, in the method as described above, the method of restoring the backup data to the PostgreSQL database of all cluster slave nodes in a parallel data recovery manner to generate cluster slave nodes after data recovery includes:
[0014] The backup data is transmitted to all the cluster slave nodes by using a parallel data recovery method;
[0015] The multi-threaded replication function of each of the cluster slave nodes is called to restore the backup data to the PostgreSQL database of each of the cluster slave nodes in a multi-threaded replication manner, thereby generating a cluster slave node after data restoration.
[0016] Optionally, in the method as described above, the cluster master node and the cluster slave node both further include: a Pgpool application;
[0017] The performing cluster reconstruction processing on the cluster master node and the cluster slave node after the data recovery to complete the cluster data recovery includes:
[0018] Call the cluster rebuild function of the Pgpool application in the cluster master node and cluster slave node after data recovery to re-establish the Pgpool cluster and complete cluster data recovery.
[0019] Optionally, in the above method, in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface, determining the corresponding backup data and data recovery target includes:
[0020] In response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data is determined from the backup database, and the corresponding data recovery target is determined from the preset database; the backup database stores the mapping relationship between the backup data component and the backup data, and the preset database stores the mapping relationship between the data recovery target component and the data recovery target.
[0021] Optionally, in the method as described above, after performing cluster reconstruction processing on the cluster master node and the cluster slave node after the data recovery and completing the cluster data recovery, the method further includes:
[0022] Send the cluster data recovery completion message to the user terminal.
[0023] A second aspect of an embodiment of the present invention provides a cluster data recovery device, the device is located in a cluster data recovery server, the cluster data recovery server is communicatively connected to a cluster of data to be recovered, the cluster includes: a cluster master node and a cluster slave node, the device includes:
[0024] A determination module, configured to determine the corresponding backup data and data recovery target in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface; the data recovery target at least includes: the cluster master node and at least one cluster slave node;
[0025] A generation module, configured to perform data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second, and generate a cluster master node and cluster slave nodes after data recovery;
[0026] The reconstruction module is used to perform cluster reconstruction processing on the cluster master node and cluster slave nodes after the data is recovered, so as to complete cluster data recovery.
[0027] Optionally, in the device as described above, the cluster is a Pgpool cluster; the cluster master node and the cluster slave node both include a PostgreSQL database; there are multiple cluster slave nodes;
[0028] The generating module is specifically used for:
[0029] The backup data is restored to the PostgreSQL database of the cluster master node to generate the cluster master node after data restoration; the backup data is restored to the PostgreSQL database of all cluster slave nodes using a parallel data restoration method to generate the cluster slave nodes after data restoration.
[0030] Optionally, in the above-described device, when the generation module restores the backup data to the PostgreSQL database of all cluster slave nodes in a parallel data recovery manner to generate the cluster slave nodes after data recovery, it is specifically used to:
[0031] The backup data is transmitted to all the cluster slave nodes by parallel data recovery; the multi-threaded replication function of each cluster slave node is called to restore the backup data to the PostgreSQL database of each cluster slave node by multi-threaded replication, and the cluster slave node after data recovery is generated.
[0032] Optionally, in the above device, the cluster master node and the cluster slave node both further include: a Pgpool application;
[0033] The reconstruction module is specifically used for:
[0034] Call the cluster rebuild function of the Pgpool application in the cluster master node and cluster slave node after data recovery to re-establish the Pgpool cluster and complete cluster data recovery.
[0035] Optionally, in the above device, the determining module is specifically used for:
[0036] In response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data is determined from the backup database, and the corresponding data recovery target is determined from the preset database; the backup database stores the mapping relationship between the backup data component and the backup data, and the preset database stores the mapping relationship between the data recovery target component and the data recovery target.
[0037] Optionally, the device as described above further comprises:
[0038] The sending module is used to send the information that the cluster data recovery is completed to the user terminal.
[0039] A third aspect of an embodiment of the present invention provides a cluster data recovery server, comprising: a processor and a memory connected to each other;
[0040] The memory stores computer-executable instructions;
[0041] The processor executes the computer-executable instructions stored in the memory to implement the cluster data recovery method as described in any one of the first aspects.
[0042] A fourth aspect of an embodiment of the present invention 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 cluster data recovery method described in any one of the first aspects.
[0043] A fifth aspect of an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the cluster data recovery method described in any one of the first aspects.
[0044] The embodiment of the present invention provides a cluster data recovery method, device, server, medium and product, the method is applied to a cluster data recovery server, the cluster data recovery server is connected to the cluster of data to be recovered, the cluster includes: a cluster master node and a cluster slave node, the method includes: in response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, determining the corresponding backup data and data recovery target; the data recovery target at least includes: the cluster master node and at least one cluster slave node; in the order of the cluster master node in front and the cluster slave node in the back, performing data recovery processing on the data recovery target based on the backup data to generate the cluster master node and cluster slave node after data recovery; performing cluster reconstruction processing on the cluster master node and cluster slave node after data recovery to complete cluster data recovery. The cluster data recovery method of the embodiment of the present invention can determine the corresponding backup data and data recovery target according to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, and at the same time, automatically perform data recovery processing on the data recovery target, and perform cluster reconstruction processing on the cluster master node and cluster slave node after data recovery to complete cluster data recovery. Compared with the manual data recovery method performed by operation and maintenance personnel, data recovery is more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] Figure 1 A scene diagram of a cluster data recovery method that can implement an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of the process of the cluster data recovery method provided by the present invention Figure 1 ;
[0048] Figure 3 A schematic diagram of the process of the cluster data recovery method provided by the present invention Figure 2 ;
[0049] Figure 4 A schematic diagram of the architecture of the cluster data recovery method provided by the present invention;
[0050] Figure 5 A schematic diagram of the structure of the cluster data recovery device provided by the present invention Figure 1 ;
[0051] Figure 6 A schematic diagram of the structure of the cluster data recovery device provided by the present invention Figure 2 ;
[0052] Figure 7 This is a structural schematic diagram of the data recovery server provided by the present invention.
[0053] The above drawings have shown clear embodiments of the present invention, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0054] 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 embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0055] The technical solution of the present invention is described in detail with specific embodiments below. 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 invention will be described below in conjunction with the accompanying drawings.
[0056] In order to clearly understand the technical solution of the present application, the solution of the prior art is first introduced in detail. The PostgreSQL database is an object-relational database of free software with very complete features. Object-relational databases are widely used, and cluster deployment is the main method for actual use by users. PostgreSQL officially recommends that the Pgpool middleware be used to build a Pgpool cluster. When the Pgpool cluster performs data recovery in scenarios such as disasters, failures, and migrations, it can only restore a single master node first, and then the operation and maintenance personnel manually restore the slave nodes one by one, and finally build the cluster. The cluster recovery efficiency is very low.
[0057] Therefore, in order to solve the problem of low efficiency of data recovery methods for relational database clusters in the prior art, the inventors have discovered through research that the cluster data recovery process can be executed in an automated manner, and users only need to perform selection operations, thereby improving the data recovery efficiency of the relational database cluster.
[0058] Specifically, in response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data and data recovery target are determined. The data recovery target includes at least: a cluster master node and at least one cluster slave node. Data recovery processing is performed on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node last, and the cluster master node and cluster slave node after data recovery are generated. Cluster reconstruction processing is performed on the cluster master node and cluster slave node after data recovery to complete cluster data recovery. Thereby, data recovery efficiency is improved.
[0059] Based on the above creative findings, the inventor proposed the technical solution of the present application.
[0060] The following describes the application scenarios of the cluster data recovery method provided by the embodiment of the present invention. Figure 1 As shown, 1 is a data recovery server, 2 is a cluster, 3 is a backup database, and 4 is a user. In this embodiment, the network structure is: data recovery server 1, cluster 2, and backup database 3. Cluster 2 includes a cluster master node and a cluster slave node, wherein two cluster slave nodes are used for exemplary illustration. The cluster slave node can be two or more than two, or a single one, which is not limited in this embodiment. User 4 can be an operation and maintenance personnel or other staff. Backup database 3 stores backup data corresponding to cluster 2.
[0061] In this embodiment, when data recovery is required, such as when a disaster, failure, migration, etc. occurs in cluster 2, user 4 selects the backup data component and the data recovery target component in the front-end display page of the data recovery server 1. For example, the backup data component includes backup data component A, backup data component B...backup data component N, etc., and the data recovery target component includes a cluster master node component and a cluster slave node component. User 4 selects backup data component A and backup data component B, and at the same time, selects the cluster master node component and all cluster slave node components in cluster 2. In response to the selection operation of user 4, the data recovery server 1 determines the backup data A and backup data B corresponding to the backup data component A and backup data component B, as well as the cluster master node corresponding to the cluster master node component and the cluster slave node corresponding to the cluster slave node component. The backup data A and the backup data B can be determined from the backup database 3, and the determined cluster master node and cluster slave node can include information such as the cluster master node identifier, the cluster slave node identifier, the cluster master node address, and the cluster slave node address.
[0062] The data recovery server 1 performs data recovery processing on the cluster master node and the cluster slave node based on the backup data A and the backup data B in the order of the cluster master node first and the cluster slave node last, and generates the cluster master node and the cluster slave node after data recovery. At the same time, the data recovery server 1 performs cluster reconstruction processing on the cluster master node and the cluster slave node after data recovery to complete cluster data recovery. After completing cluster data recovery, the data recovery server 1 can inform the user 4 of the data recovery progress by displaying a message that the data recovery has been completed, or by sending a message that the data recovery has been completed to the user terminal.
[0063] The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0064] Figure 2 A schematic diagram of the process of the cluster data recovery method provided by the present invention Figure 1 ,like Figure 2 As shown, in this embodiment, the execution subject of the embodiment of the present invention is a cluster data recovery device, which can be integrated in a data recovery server. The cluster data recovery server of this embodiment is connected to the cluster of data to be recovered, and the cluster includes: a cluster master node and a cluster slave node. The cluster data recovery method provided by this embodiment includes the following steps:
[0065] Step S101, in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data and data recovery target are determined. The data recovery target includes at least: a cluster master node and at least one cluster slave node.
[0066] In this embodiment, the backup data component and the data recovery target component are components displayed in the front-end display interface. The backup data component has a mapping relationship with the corresponding backup data, and the data recovery target component has a mapping relationship with the corresponding data recovery target.
[0067] Exemplarily, the backup data component includes backup data component a, backup data component b, and backup data component c, and each backup data component can be checked by the user by clicking, thereby selecting the backup data component. After the user selects the backup data component, the corresponding backup data can be determined according to the mapping relationship between the backup data component and the corresponding backup data. If the user selects the backup data component a, the backup data a can be determined according to the mapping relationship between the backup data component a and the backup data a. The specific determination method can be to determine from the backup database storing the backup data.
[0068] The data recovery target includes a cluster master node and at least one cluster slave node, and the number of cluster slave nodes can be determined according to the cluster slave nodes that actually experience disasters, failures, migrations, etc. The determined data recovery target may include information such as a data recovery target identifier and a data recovery target address.
[0069] Step S102 , performing data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node later, and generating a cluster master node and cluster slave nodes after data recovery.
[0070] In this embodiment, since the cluster master node has a higher priority, data recovery is performed on the cluster master node first, and then data recovery is performed on the cluster slave nodes.
[0071] Step S103, performing cluster reconstruction processing on the cluster master node and cluster slave nodes after data recovery, to complete cluster data recovery.
[0072] In this embodiment, cluster reconstruction processing of the cluster master node and the cluster slave node can be completed by calling the cluster reconstruction function of the cluster, thereby realizing cluster data recovery.
[0073] A cluster data recovery method provided by an embodiment of the present invention includes: in response to a user's selection operation of a backup data component and a data recovery target component in a front-end display interface, determining corresponding backup data and a data recovery target. The data recovery target includes at least a cluster master node and at least one cluster slave node. Data recovery processing is performed on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node later, and a cluster master node and a cluster slave node after data recovery are generated. Cluster reconstruction processing is performed on the cluster master node and the cluster slave node after data recovery to complete cluster data recovery.
[0074] The cluster data recovery method of the embodiment of the present invention can determine the corresponding backup data and data recovery target according to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, and automatically perform data recovery processing on the data recovery target, and perform cluster reconstruction processing on the cluster master node and cluster slave node after data recovery to complete cluster data recovery. Compared with the manual data recovery method performed by the operation and maintenance personnel, the data recovery efficiency is higher.
[0075] Figure 3 A schematic diagram of the process of the cluster data recovery method provided by the present invention Figure 2 ,like Figure 3 As shown, in this embodiment, the cluster is a Pgpool cluster. The cluster master node and the cluster slave node both include a PostgreSQL database. There are multiple cluster slave nodes. The cluster data recovery method provided in this embodiment includes the following steps:
[0076] Step S201, in response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data is determined from the backup database, and the corresponding data recovery target is determined from the preset database. The backup database stores the mapping relationship between the backup data component and the backup data, and the preset database stores the mapping relationship between the data recovery target component and the data recovery target.
[0077] In this embodiment, by storing the mapping relationship between the backup data component and the backup data and storing the backup data in the backup database, the corresponding backup data can be directly obtained from the backup database when the backup data is needed, thereby improving the efficiency of obtaining the backup data. The preset database can also store information such as the identification, address, and status of the data recovery target.
[0078] Step S202, restore the backup data to the PostgreSQL database of the cluster master node, and generate the cluster master node after data restoration.
[0079] In this embodiment, after the backup data is restored to the PostgreSQL database of the cluster master node, the cluster master node can escape from the disaster, failure and other states and complete data recovery.
[0080] When the master node of the cluster recovers data, a concurrent mechanism can be used, that is, data recovery is performed through multi-threaded replication to improve data recovery efficiency.
[0081] Step S203: Restore the backup data to the PostgreSQL database of all cluster slave nodes by using a parallel data recovery method, and generate cluster slave nodes after data recovery.
[0082] In the prior art, data recovery of multiple cluster slave nodes in a Pgpool cluster is performed serially, and there is a lack of a parallel processing mechanism for data recovery of multiple slave nodes. When the amount of data is large, data recovery takes a long time.
[0083] This embodiment sets a concurrent processing mechanism for the cluster slave nodes, that is, adopts a parallel data recovery method, which can not only improve the data recovery efficiency when the data volume is large, but also improve the data recovery efficiency to a certain extent compared with the serial processing mechanism when the data volume is small. Therefore, compared with the serial processing method commonly used in the prior art, the data recovery speed and data recovery efficiency of the Pgpool cluster are improved.
[0084] Optionally, in this embodiment, step S203 may specifically be:
[0085] Use parallel data recovery to transfer backup data to all cluster slave nodes.
[0086] The multi-threaded replication function of each cluster slave node is called to restore the backup data to the PostgreSQL database of each cluster slave node in a multi-threaded replication mode, and generate a cluster slave node after data recovery.
[0087] At present, when a single cluster slave node performs data recovery, it is processed through a single thread. The data recovery of a single node lacks concurrent processing capabilities. When the amount of data to be processed is large, data recovery takes a long time. Therefore, in this embodiment, a multi-thread mechanism is adopted for a single cluster slave node, and the backup data is restored to the PostgreSQL database of each cluster slave node through multi-thread replication, thereby improving the data recovery efficiency. At the same time, combined with the parallel data recovery method, the overall recovery efficiency of multiple cluster slave nodes is improved.
[0088] It should be noted that both the cluster master node and the cluster slave node also include: Pgpool application.
[0089] Step S204, calling the cluster reconstruction function of the Pgpool application in the cluster master node and the cluster slave node after data recovery to re-establish the Pgpool cluster and complete cluster data recovery.
[0090] In this embodiment, the Pgpool cluster can be rebuilt through the cluster reconstruction function in the Pgpool application. The Pgpool application is set in the cluster master node and the cluster slave node, and a connection relationship between the PostgreSQL database and the Pgpool server can be established.
[0091] Step S205: Sending information indicating that cluster data recovery is complete to the user terminal.
[0092] By sending the cluster data recovery completion information to the user terminal, the user can be informed that the cluster data recovery is completed, so that the user can perform other subsequent operations according to the cluster data recovery completion information, such as using the cluster data.
[0093] In order to further illustrate the cluster data recovery method of this embodiment in detail, it will be further described below with reference to the accompanying drawings. Figure 4 A schematic diagram of the architecture of the cluster data recovery method provided by the present invention.
[0094] like Figure 4 As shown in the figure, the cluster master node is referred to as the master node, the cluster slave node is referred to as the slave node, the Pgpool service refers to the service function of the Pgpool application, and the proxy service in the master node and the slave node refers to the proxy service function in the client on the master node and the slave node set by the data recovery server.
[0095] In the figure, the line marked with icon “①” (solid arrow) is the process of the data recovery server scheduling each node to perform data recovery tasks through the proxy service. Multiple slave nodes can perform data recovery in parallel.
[0096] The line (dotted arrow) marked by icon “②” is a process of restoring backup data to each node database through the proxy service, and performing data recovery using multi-threaded replication on a single node.
[0097] The line marked with icon "③" (a dotted arrow consisting of points and line segments) is the interaction process between the Pgpool service and the PostgreSQL database service on each node in the Pgpool cluster.
[0098] When the operation and maintenance personnel use the data recovery server to recover the PostgreSQL database deployed in the Pgpool cluster, they select the backup data and data recovery target on the front-end display interface of the data recovery server. The server generates the data recovery scheduling task of the Pgpool cluster according to the data recovery target and the backup data configuration. When executing the data recovery scheduling task, the backup data is first restored to the master node through the proxy service of the master node, and then the backup data is restored to multiple slave nodes in parallel through the proxy service. When each node executes the data recovery task through the proxy service, the backup data is restored by multi-threaded replication. After the data recovery is completed, the Pgpool service is started through the proxy service to re-establish the Pgpool cluster, and finally the data recovery task of the Pgpool cluster is completed.
[0099] Figure 5 A schematic diagram of the structure of the cluster data recovery device provided by the present invention Figure 1 ,like Figure 5 As shown, in this embodiment, the cluster data recovery device 300 is located in the cluster data recovery server, and the cluster data recovery server is connected to the cluster of data to be recovered. The cluster includes: a cluster master node and a cluster slave node. The cluster data recovery device 300 includes:
[0100] The determination module 301 is used to determine the corresponding backup data and data recovery target in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface. The data recovery target at least includes: a cluster master node and at least one cluster slave node.
[0101] The generation module 302 is used to perform data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node later, and generate the cluster master node and cluster slave node after data recovery.
[0102] The reconstruction module 303 is used to perform cluster reconstruction processing on the cluster master node and the cluster slave nodes after data recovery to complete cluster data recovery.
[0103] The cluster data recovery device provided in this embodiment can execute Figure 2 The technical solution of the method embodiment shown in the figure has the same implementation principle and technical effect as Figure 2 The method embodiments shown are similar and will not be described in detail here.
[0104] Figure 6 A schematic diagram of the structure of the cluster data recovery device provided by the present invention Figure 2 ,like Figure 6 As shown, the cluster data recovery device provided by the present invention is further refined on the basis of the cluster data recovery device provided by the previous embodiment. In order to distinguish it from the previous embodiment in description, the cluster data recovery device of this embodiment is described using cluster data recovery device 400, which specifically includes:
[0105] Optionally, in this embodiment, the cluster is a Pgpool cluster. The cluster master node and the cluster slave node both include a PostgreSQL database. There are multiple cluster slave nodes.
[0106] The generating module 302 is specifically used for:
[0107] Restore the backup data to the PostgreSQL database of the cluster master node to generate the cluster master node after data recovery. Use parallel data recovery to restore the backup data to the PostgreSQL database of all cluster slave nodes to generate the cluster slave nodes after data recovery.
[0108] Optionally, in this embodiment, when the generation module 302 restores the backup data to the PostgreSQL database of all cluster slave nodes in a parallel data recovery manner and generates the cluster slave nodes after data recovery, it is specifically used to:
[0109] The backup data is transferred to all cluster slave nodes by parallel data recovery. The multi-threaded replication function of each cluster slave node is called to restore the backup data to the PostgreSQL database of each cluster slave node by multi-threaded replication to generate the cluster slave node after data recovery.
[0110] Optionally, in this embodiment, both the cluster master node and the cluster slave node further include: a Pgpool application.
[0111] The reconstruction module 303 is specifically used for:
[0112] Call the cluster rebuild function of the Pgpool application in the cluster master node and cluster slave node after data recovery to re-establish the Pgpool cluster and complete cluster data recovery.
[0113] Optionally, in this embodiment, the determining module 301 is specifically used for:
[0114] In response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data is determined from the backup database, and the corresponding data recovery target is determined from the preset database. The backup database stores the mapping relationship between the backup data component and the backup data, and the preset database stores the mapping relationship between the data recovery target component and the data recovery target.
[0115] Optionally, in this embodiment, the cluster data recovery device 400 further includes:
[0116] The sending module 401 is used to send the information that the cluster data recovery is completed to the user terminal.
[0117] The cluster data recovery device provided in this embodiment can execute Figure 2-Figure 4 The technical solution of the method embodiment shown in the figure has the same implementation principle and technical effect as Figure 2-Figure 4 The method embodiments shown are similar and will not be described in detail here.
[0118] According to an embodiment of the present invention, the present invention also provides a cluster data recovery server, a computer-readable storage medium and a computer program product.
[0119] like Figure 7 As shown, Figure 7 1 is a schematic diagram of the structure of the cluster data recovery server provided by the present invention. The cluster data recovery server is intended for various forms of electronic devices, such as tablet computers and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0120] like Figure 7 As shown, the cluster data recovery server includes: a processor 501 and a memory 502. Therefore, the cluster data recovery server has edge computing capabilities, which can be used to decide the communication resource allocation method. The various components are connected to each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor 501 can process instructions executed in the electronic device.
[0121] The memory 502 is a non-transient computer-readable storage medium provided by the present invention. The memory stores instructions executable by at least one processor to enable at least one processor to execute the cluster data recovery method provided by the present invention. The non-transient computer-readable storage medium of the present invention stores computer instructions, which are used to enable a computer to execute the cluster data recovery method provided by the present invention.
[0122] The memory 502 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the cluster data recovery method in the embodiment of the present invention (for example, the attached Figure 5 The processor 501 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 502, that is, the cluster data recovery method in the above method embodiment is implemented.
[0123] At the same time, this embodiment also provides a computer product. When the instructions in the computer product are executed by the processor of the cluster data recovery server, the cluster data recovery server can execute the cluster data recovery method of the above embodiment.
[0124] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed in this application. The present invention is intended to cover any variations, uses, or adaptations of the embodiments of the present invention, which follow the general principles of the embodiments of the present invention and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present invention. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the embodiments of the present invention are indicated by the claims.
[0125] It should be understood that the embodiments of the present invention are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present invention is limited only by the appended claims.
Claims
1. A cluster data recovery method, characterized in that: The method is applied to a cluster data recovery server, the cluster data recovery server is in communication connection with a cluster of data to be recovered, the cluster includes: a cluster master node and a cluster slave node, the method includes: In response to the user's selection operation of the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data and data recovery target are determined; the data recovery target at least includes: the cluster master node and at least one cluster slave node; Performing data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second, to generate a cluster master node and cluster slave nodes after data recovery; The cluster master node and the cluster slave nodes after data recovery are subjected to cluster reconstruction processing to complete cluster data recovery.
2. The method according to claim 1, characterized in that The cluster is a Pgpool cluster; the cluster master node and the cluster slave node both include a PostgreSQL database; there are multiple cluster slave nodes; The performing data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second to generate the cluster master node and cluster slave node after data recovery includes: Restoring the backup data to the PostgreSQL database of the cluster master node to generate a cluster master node after data restoration; The backup data is restored to the PostgreSQL database of all cluster slave nodes using a parallel data recovery method to generate cluster slave nodes after data recovery.
3. The method according to claim 2, characterized in that The method of restoring the backup data to the PostgreSQL database of all cluster slave nodes by using a parallel data recovery method to generate cluster slave nodes after data recovery includes: The backup data is transmitted to all the cluster slave nodes by using a parallel data recovery method; The multi-threaded replication function of each of the cluster slave nodes is called to restore the backup data to the PostgreSQL database of each of the cluster slave nodes in a multi-threaded replication manner, thereby generating a cluster slave node after data restoration.
4. The method according to claim 3, characterized in that The cluster master node and the cluster slave node both further include: a Pgpool application; The performing cluster reconstruction processing on the cluster master node and the cluster slave node after the data recovery to complete the cluster data recovery includes: Call the cluster rebuild function of the Pgpool application in the cluster master node and cluster slave node after data recovery to re-establish the Pgpool cluster and complete cluster data recovery.
5. The method according to claim 4, characterized in that The step of determining the corresponding backup data and data recovery target in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface includes: In response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface, the corresponding backup data is determined from the backup database, and the corresponding data recovery target is determined from the preset database; the backup database stores the mapping relationship between the backup data component and the backup data, and the preset database stores the mapping relationship between the data recovery target component and the data recovery target.
6. The method according to claim 4, characterized in that After performing cluster reconstruction processing on the cluster master node and the cluster slave node after the data recovery, and completing the cluster data recovery, the method further includes: Send the cluster data recovery completion message to the user terminal.
7. A cluster data recovery device, characterized in that: The device is located in a cluster data recovery server, the cluster data recovery server is connected to a cluster of data to be recovered, the cluster includes: a cluster master node and a cluster slave node, the device includes: A determination module, configured to determine the corresponding backup data and data recovery target in response to the user's selection operation on the backup data component and the data recovery target component in the front-end display interface; the data recovery target at least includes: the cluster master node and at least one cluster slave node; A generation module, configured to perform data recovery processing on the data recovery target based on the backup data in the order of the cluster master node first and the cluster slave node second, and generate a cluster master node and cluster slave nodes after data recovery; The reconstruction module is used to perform cluster reconstruction processing on the cluster master node and cluster slave nodes after the data is recovered, so as to complete cluster data recovery.
8. A cluster data recovery server, characterized in that: include: Interconnected processors and memories; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the cluster data recovery 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 cluster data recovery method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the cluster data recovery method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Database cluster recovery method and related equipment
CN121301086A
Database cluster recovery methods and related equipment
CN121301086B
