Database management method and device, electronic device and medium

In the replica cluster of the cloud computing database, the checkpoint operation is triggered immediately after the node is added, which solves the problem of restart failure caused by data faults and ensures the normal operation of the node and data consistency.

CN111966532BActive Publication Date: 2024-10-01BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010711736.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-22
Publication Date
2024-10-01
Estimated Expiration
2040-07-22

AI Technical Summary

Technical Problem

In the process of using physical backup data to build a replica cluster of a cloud computing database, data faults may occur, causing nodes to fail to restart and unable to provide services.

Method used

After the node is added to the replica cluster, the replica cluster node is immediately triggered to perform a checkpoint operation to avoid a gap between the generation time of the checkpoint and the generation time of the first synchronization log. By calling the kernel layer of the replica cluster node, Checkpoint operation command interface implementation.

Benefits of technology

This effectively avoids node restart failures, ensures data security and consistency, and ensures that replica cluster nodes can provide services normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966532B_ABST
    Figure CN111966532B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure relate to a management method and device, an electronic device and a medium for a cloud computing database. The method comprises: obtaining physical backup data of a database; copying the physical backup data to a first node; adding the first node to a replica cluster; and, in response to the first node being added to the replica cluster, triggering the replica cluster node to perform a checkpoint operation to write the memory data of the replica cluster node to a disk, wherein the replica cluster node is a node in the replica cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of database technology, and more specifically, to a database management method and device, electronic device, and medium. Background Art

[0002] Cloud computing databases are databases deployed and virtualized in a cloud computing environment, which can achieve advantages such as pay-as-you-go, on-demand expansion, high availability, and storage integration. In cloud computing databases, they can be divided into relational databases and non-relational databases according to the database type.

[0003] Currently, there is physical backup support for cloud computing databases, that is, the folders of cloud computing databases can be directly copied. However, in the process of using physical backup data to build a new replica cluster, data faults may occur, causing the replica cluster nodes to be unable to provide normal services.

[0004] Take MongoDB database as an example. MongoDB is a database based on distributed file storage. It is a product between relational database and non-relational database. It can store relatively complex data types. For MongoDB database, data security and easy migration are very important. There is physical backup support for MongoDB data, that is, the entire folder of MongoDB data can be directly copied. However, in the process of using physical backup data to form a new replica cluster, a node restart may occur. If there is a fault between the oplog log (synchronization log) of the node and the last checkpoint of the node at this time, it may cause the node to fail to restart and fail to provide services.

[0005] Therefore, it is necessary to propose a new database management solution. Summary of the invention

[0006] An object of the present disclosure is to provide a new database management method and device, electronic device and medium.

[0007] According to a first aspect of an embodiment of the present disclosure, there is provided a method for managing a database, comprising:

[0008] Get physical backup data of the database;

[0009] Copying the physical backup data to the first node;

[0010] Joining the first node to the replica cluster; and,

[0011] In response to the first node being added to the replica cluster, triggering the replica cluster node to perform a checkpoint operation to write memory data of the replica cluster node to a disk, the replica cluster node being a node in the replica cluster.

[0012] Optionally, the method further comprises:

[0013] Encapsulate the checkpoint operation command interface in the kernel layer of the replica cluster node in advance;

[0014] Triggering the replica cluster node to perform a checkpoint operation is achieved by calling a checkpoint operation command interface in the kernel layer of the replica cluster node.

[0015] Optionally, adding the first node to the replica cluster includes:

[0016] Start the first node;

[0017] Clearing the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node;

[0018] Add the replica cluster configuration information to the configuration file of the first node;

[0019] restarting the first node; and,

[0020] After restarting the first node, add the first node to the replica cluster.

[0021] Optionally, starting the first node includes:

[0022] Generate a configuration file for the first node that does not contain the replica cluster configuration information;

[0023] Start the first node in non-authentication mode.

[0024] According to a second aspect of an embodiment of the present disclosure, there is provided a database management device, comprising:

[0025] An acquisition module is used to acquire physical backup data of the database;

[0026] A replication module, used for replicating the physical backup data to the first node;

[0027] A building module, used for adding the first node to the replica cluster;

[0028] The trigger module is used to trigger the replica cluster node to perform a checkpoint operation in response to the first node being added to the replica cluster, so as to write the memory data of the replica cluster node to the disk, and the replica cluster node is a node in the replica cluster.

[0029] Optionally, the trigger module triggers the replica cluster node to perform a checkpoint operation by calling a checkpoint operation command interface pre-encapsulated in the kernel layer of the replica cluster node.

[0030] Optionally, the building block includes:

[0031] A startup module, used for starting the first node;

[0032] A clearing module, used to clear the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node;

[0033] A configuration file modification module, used to add replica cluster configuration information to the configuration file of the first node;

[0034] A restart module, used to restart the first node;

[0035] The joining module is used to join the first node to the replica cluster after the restart module restarts the first node.

[0036] Optionally, the startup module includes:

[0037] A configuration file generation module, used to generate a configuration file of the first node that does not contain the replica cluster configuration information;

[0038] The non-identity authentication mode startup module is used to start the first node in a non-identity authentication mode.

[0039] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any of the methods described above is implemented.

[0040] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, any of the methods described above is implemented.

[0041] The database management method and apparatus, electronic device and medium of the embodiments of the present disclosure, during the process of forming a replica cluster after physical backup, immediately trigger the replica cluster node to perform a checkpoint operation after the node is added to the replica cluster, so as to avoid a situation where there is a gap between the generation time of the checkpoint and the generation time of the first synchronization log, resulting in a restart failure.

[0042] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0044] Figure 1 is a schematic diagram of an electronic device that can be used to implement an embodiment of the present disclosure.

[0045] Figure 2 It is a flowchart of the database management method provided by the embodiment of the present disclosure.

[0046] Figure 3 It is a block diagram of a database management device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0047] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0048] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0049] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0050] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0051] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0052] <Hardware Configuration>

[0053] Figure 1 The hardware configuration of an electronic device that can be used to implement an embodiment of the present disclosure is shown.

[0054] See also Figure 1 , the electronic device 1000 includes a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500 and an input device 1600. The processor 1100 may be, for example, a central processing unit CPU, a microcontroller unit MCU, etc. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 may include, for example, a USB interface, a serial interface, etc. The communication device 1400 may be, for example, a wired network card or a wireless network card. The display device 1500 may be, for example, a liquid crystal display screen or a touch screen. The input device 1600 may include, for example, a touch screen, a keyboard, a mouse, a microphone, etc.

[0055] In the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store instructions, which are used to control the processor 1100 to operate to support the method of implementing any embodiment of the present disclosure. Technicians can design instructions according to the scheme disclosed in the present disclosure. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.

[0056] It should be understood by those skilled in the art that although Figure 1 , multiple devices of the electronic device 1000 are shown; however, the electronic device 1000 of the embodiment of the present disclosure may only involve some of the devices, for example, only the processor 1100, the memory 1200 and the communication device 1400.

[0057] In this embodiment, the electronic device 1000 is, for example, a database management server.

[0058] Figure 1 The hardware configuration shown is merely illustrative and is in no way intended to limit the present disclosure, its application, or uses.

[0059] <Method Example>

[0060] In cloud computing databases, physical backup is achieved by directly copying the folders of cloud computing databases to achieve rapid database migration, which is suitable for scenarios with large amounts of data.

[0061] After physically backing up the cloud computing database, you need to use the physical backup data to restore the replica cluster, that is, to re-establish a new replica cluster. All nodes in the replica cluster are equal, and there is no fixed "master node". The cluster will select a "master node". When it hangs up, other nodes will be selected from the remaining slave nodes as "master nodes".

[0062] According to the scheduled checkpoint mechanism of cloud computing database, the node will automatically trigger a checkpoint operation every preset time (for example, 60 seconds). The checkpoint operation can write the data in the node memory to the disk. Each checkpoint operation will generate a checkpoint with a generation timestamp that can be used for data recovery.

[0063] In addition, the node uses the oplog log (synchronization log) to record the data synchronization operation between the node and other nodes in the replica cluster. Each oplog log also carries a generation timestamp. The node writes the oplog log in the memory to the disk at a very high frequency (for example, every 100 milliseconds), that is, writes the oplog log to the disk's WAL temporary file.

[0064] After the node is restarted, the oplog log in the memory will be lost. It is necessary to restore the oplog log after the last checkpoint from the WAL temporary file to the memory. For the security and consistency of data, the database kernel mechanism requires that the generation time of the last checkpoint is not earlier than the generation time of the first oplog log. If the generation time of the last checkpoint is earlier than the generation time of the first oplog log, the system will think that there is a fault between the last checkpoint and the first oplog log. The memory data changes during the fault period may be lost, and the node may not be able to provide services. It is necessary to start the self-check program for self-check, which will cause the restart to fail.

[0065] When restoring a replica cluster using physical backup data, multiple node restarts may occur. There are many reasons that may cause node restarts, such as power outages, manual restarts, and restarts due to failures.

[0066] When a node is added to a replica cluster, the first oplog is created. If a node needs to be restarted after it is added to the replica cluster but before a checkpoint operation is triggered, the above fault will occur, causing the restart to fail.

[0067] The replica cluster formation method of the embodiment of the present disclosure immediately forces the nodes in the replica cluster to perform a checkpoint operation after the node is added to the replica cluster to ensure that the timestamp of the last checkpoint is not earlier than the timestamp of the first oplog log, thereby avoiding the situation where the node restart fails. This forced checkpoint operation is independent of the scheduled checkpoint mechanism and does not affect the established operation of the scheduled checkpoint mechanism.

[0068] Reference below Figure 2 As shown, the database management method of the embodiment of the present disclosure is described in detail. The method includes steps S202-S208.

[0069] S202: Obtain physical backup data of the database.

[0070] In a specific example, the database service is suspended, and then the database folder is copied to obtain physical backup data.

[0071] S204: Copy the physical backup data to the first node.

[0072] In a specific example, after obtaining the physical backup data of the database, if you want to restore it into a replica cluster with N nodes, you can copy the physical backup data to the N nodes respectively, where N≥1 and N is an integer.

[0073] S206: Add the first node to the replica cluster.

[0074] The first node may be any node among the N nodes. The process of adding the first node to the replica cluster includes steps S302-S310.

[0075] S302: Start the first node.

[0076] In a specific example, the process of starting the first node includes: generating a configuration file of the first node, the configuration file of the first node does not contain replica cluster configuration information, and the directory of the configuration file of the first node corresponds to the physical backup data directory of the first node. Then, starting the first node in a non-authentication mode (noauth mode).

[0077] S304: Clear the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node.

[0078] In a specific example, the local.replset.minvalid table that records the replica cluster member data and the local.system.replset table that records the replica cluster synchronization data can be directly deleted, or the contents of the local.replset.minvalid table and the local.system.replset table can be cleared.

[0079] S306: Add the replica cluster configuration information to the configuration file of the first node.

[0080] S308. Restart the first node with a new configuration file.

[0081] S310: After restarting the first node, add the first node to the replica cluster.

[0082] In a specific example, the first node is added to the replica cluster by executing the rs.config() command.

[0083] S208. In response to the first node being added to the replica cluster, trigger the replica cluster node to perform a checkpoint operation to write the memory data of the replica cluster node to the disk. The replica cluster node here includes all nodes in the replica cluster.

[0084] That is, after the first node is added to the replica cluster, each node in the replica cluster (including the first node) will be triggered to perform a checkpoint operation.

[0085] In a specific example, the checkpoint operation command interface is pre-encapsulated in the kernel layer of the replica cluster node. In step S208, triggering the replica cluster node to perform the checkpoint operation may be achieved by calling the checkpoint operation command interface of the replica cluster node.

[0086] In a specific example, in response to the first node being added to the replica cluster, triggering the replica cluster node to perform a checkpoint operation may be performed by a user. After the first node is successfully added to the replica cluster, the user immediately calls the checkpoint operation command interface of each node of the replica cluster to control each node of the replica cluster to perform a checkpoint operation respectively.

[0087] In a specific example, in response to the first node being added to the replica cluster, triggering the nodes in the replica cluster to perform a checkpoint operation can be automatically performed by the management system of the cloud computing database. After the first node is added to the replica cluster, the management system of the cloud computing database automatically triggers each node in the replica cluster to perform a checkpoint operation.

[0088] The following is an example of a specific MongoDB database. After physically backing up the MongoDB database, you want to restore it to a replica cluster with three nodes, namely a, b, and c. The process of building a replica cluster includes:

[0089] S501. Copy the physical backup data to nodes a, b, and c respectively.

[0090] S502. Write a configuration file confa1 for node a. The directory of the configuration file confa1 corresponds to the physical backup data directory of node a. Write a configuration file confb1 for node b. The directory of the configuration file confb1 corresponds to the physical backup data directory of node b. Write a configuration file confc1 for node c. The directory of the configuration file confc1 corresponds to the physical backup data directory of node c. There is no replica cluster configuration in the configuration files confa1, confb1, and confc1, that is, no replica cluster configuration information is contained.

[0091] S503, respectively start nodes a, b, and c in a non-identity authentication mode (noauth mode).

[0092] S504 , respectively clearing the replica cluster member data and the replica cluster synchronization data in the physical backup data of nodes a, b, and c, that is, respectively deleting or clearing the local.replset.minvalid table and the local.system.replset table of nodes a, b, and c.

[0093] S505 . Add replica cluster configuration information to the configuration files of nodes a, b, and c respectively.

[0094] S506: After adding the replica cluster configuration information, restart nodes a, b, and c.

[0095] S507: Add node a to the replica cluster.

[0096] S508. In response to node a being added to the replica cluster, all nodes in the replica cluster, that is, node a, are triggered to perform a checkpoint operation to write the data in the memory of node a to the disk.

[0097] S509: Add node b to the replica cluster.

[0098] S510, in response to node b being added to the replica cluster, trigger all nodes in the replica cluster, that is, node a and node b, to perform checkpoint operations respectively to write the data in the memory of node a and node b to the disk respectively.

[0099] S511. Add node c to the replica cluster.

[0100] S512, in response to node c being added to the replica cluster, trigger all nodes in the replica cluster, that is, node a, node b and node c, to perform checkpoint operations respectively to write the data in the memory of node a, node b and node c to the disk respectively.

[0101] The database management method of the embodiment of the present disclosure, in the process of forming a replica cluster after physical backup, immediately triggers the replica cluster node to perform a checkpoint operation after the node is added to the replica cluster, so as to avoid a gap between the generation time of the checkpoint and the generation time of the first synchronization log, resulting in a restart failure.

[0102] The database of the embodiment of the present disclosure may be a cloud computing database. The database of the embodiment of the present disclosure may be a MongoDB data database.

[0103] <Device Example>

[0104] See also Figure 3 As shown, the embodiment of the present disclosure also provides a database management device. The database management device 10 includes the following modules:

[0105] The acquisition module 12 is used to acquire physical backup data of the database.

[0106] The replication module 14 is used to replicate the physical backup data to the first node.

[0107] The assembly module 16 is used to add the first node to the replica cluster.

[0108] The trigger module 18 is configured to trigger the replica cluster node to perform a checkpoint operation in response to the first node being added to the replica cluster, so as to write the memory data of the replica cluster node to the disk. The replica cluster node is a node in the replica cluster.

[0109] In a specific example, the trigger module 18 triggers the replica cluster node to perform a checkpoint operation by calling a checkpoint operation command interface pre-encapsulated in the kernel layer of the replica cluster node.

[0110] In a specific example, the component module 16 includes a startup module, a clear module, a configuration file modification module, a restart module, and a join module.

[0111] The startup module is used to start the first node.

[0112] The clearing module is used to clear the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node.

[0113] The configuration file modification module is used to add the replica cluster configuration information to the configuration file of the first node.

[0114] The restart module is used to restart the first node.

[0115] The joining module is used to join the first node to the replica cluster after the restart module restarts the first node.

[0116] In a specific example, the startup module includes a configuration file generation module and a non-identity authentication startup module.

[0117] The configuration file generation module is used to generate a configuration file of the first node that does not contain the replica cluster configuration information.

[0118] The non-identity authentication mode startup module is used to start the first node in a non-identity authentication mode.

[0119] The database management device of the embodiment of the present disclosure, during the process of forming a replica cluster after physical backup, immediately triggers the replica cluster node to perform a checkpoint operation after the node is added to the replica cluster, so as to avoid a gap between the generation time of the checkpoint and the generation time of the first synchronization log, which may lead to a restart failure.

[0120] The database of the embodiment of the present disclosure may be a cloud computing database. The database of the embodiment of the present disclosure may be a MongoDB data database.

[0121] <Electronic Equipment Embodiment>

[0122] An embodiment of the present disclosure further provides an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method disclosed in any of the aforementioned embodiments is implemented.

[0123] The electronic device may be a management server of a cloud computing database. The electronic device may be a management server of a MongoDB database.

[0124] <Computer Readable Storage Medium>

[0125] An embodiment of the present disclosure further provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the method disclosed in any of the aforementioned embodiments is implemented.

[0126] The present disclosure may be a method, an apparatus, an electronic device, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0127] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0128] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0129] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0130] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0131] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0132] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0133] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0134] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims

1. A method for managing a database, characterized in that: include: Get physical backup data of the database; Copying the physical backup data to the first node; Add the first node to the replica cluster; as well as, In response to a first node being added to a replica cluster, the replica cluster node is triggered to perform a checkpoint operation to write memory data of the replica cluster node to a disk; wherein the nodes performing the checkpoint operation include all nodes in the replica cluster including the first node; and the checkpoint operation does not affect the established operation of a scheduled checkpoint mechanism.

2. The method according to claim 1, further comprising: Encapsulate the checkpoint operation command interface in the kernel layer of the replica cluster node in advance; Triggering the replica cluster node to perform a checkpoint operation is achieved by calling a checkpoint operation command interface in the kernel layer of the replica cluster node.

3. The method according to claim 1, wherein adding the first node to the replica cluster comprises: Start the first node; Clearing the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node; Add the replica cluster configuration information to the configuration file of the first node; Restart the first node; as well as, After restarting the first node, add the first node to the replica cluster.

4. The method according to claim 3, wherein starting the first node comprises: Generate a configuration file for the first node that does not contain the replica cluster configuration information; Start the first node in non-authentication mode.

5. A database management device, characterized in that: include: An acquisition module is used to acquire physical backup data of the database; A replication module, used for replicating the physical backup data to the first node; A building module, used for adding the first node to the replica cluster; A trigger module is used to trigger the replica cluster node to perform a checkpoint operation in response to the first node being added to the replica cluster, so as to write the memory data of the replica cluster node to the disk; wherein the nodes performing the checkpoint operation include all nodes in the replica cluster including the first node; and the checkpoint operation does not affect the established operation of the scheduled checkpoint mechanism.

6. The device according to claim 5, wherein the trigger module triggers the replica cluster node to perform a checkpoint operation by calling a checkpoint operation command interface pre-encapsulated in the kernel layer of the replica cluster node.

7. The device according to claim 5, wherein the building module comprises: A startup module, used for starting the first node; A clearing module, used to clear the replica cluster member data and the replica cluster synchronization data in the physical backup data of the first node; A configuration file modification module, used to add replica cluster configuration information to the configuration file of the first node; A restart module, used to restart the first node; The joining module is used to join the first node to the replica cluster after the restart module restarts the first node.

8. The device according to claim 7, wherein the startup module comprises: A configuration file generation module, used to generate a configuration file of the first node that does not contain the replica cluster configuration information; The non-identity authentication mode startup module is used to start the first node in a non-identity authentication mode.

9. An electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions implement the method according to any one of claims 1 to 4 when executed by a processor.

Citation Information

Patent Citations

  • Data processing method and device for shared storage database, equipment and medium

    CN111046024A

  • Method and system for providing cluster replicated checkpoint services

    US20020032883A1

  • System for maintaining consistency across a decentralized database cluster and method therefor

    US20170083598A1

  • Checkpoints for document store

    US20190324866A1

  • Systems and methods for backing-up an eventually-consistent database in a production cluster

    WO2019183423A1