Database disaster recovery method, device, system, and storage medium
AssigneeCloud Intelligence Assets Holding (Singapore) Private Limited
InventorsJie ZHOU, Jiawei XU, Yingqiang ZHANG, Guangqing DONG
Life of this patent
Estimating the term…
Abstract
Embodiments of the present application provide a database disaster recovery method, a device, a system, and a storage medium. In the embodiments of the present application, a primary node and a standby node are respectively registered as a holder and a registrant in a storage protocol. In this way, when the primary node is abnormal, the standby node may preempt a write permission of a cloud disk based on the storage protocol supported by the cloud disk, and switch to be the primary node, thereby implementing disaster recovery processing of a database based on support of the cloud disk.
Claims20
A database disaster recovery method, wherein a database system comprises:
- computing nodes and a cloud disk configured in a target mode;
- wherein a holder in a storage protocol supported by the cloud disk has a read-write permission on the cloud disk in the target mode;
- wherein a registrant in the storage protocol has a read-only permission on the cloud disk in the target mode;
- wherein the computing nodes comprise a primary node registered as the holder and a standby node registered as the registrant, and the method comprises:
- detecting, by the standby node, validity of lease information in a heartbeat file stored in the cloud disk, wherein the primary node maintains a primary node state by modifying the lease information;
- in response to detecting that the lease information is invalid, preempting, by the standby node, a write permission of the cloud disk based on the storage protocol, to register the standby node as a new holder;
- and
- switching a node state of the standby node to the primary node state.
A database system, comprising a plurality of computing nodes and a cloud disk;
- wherein the plurality of computing nodes share the cloud disk, and the cloud disk is configured in a target mode and stores a heartbeat file;
- wherein a holder in a storage protocol has a read-write permission on the cloud disk in the target mode;
- wherein a registrant in the storage protocol has a read-only permission on the cloud disk in the target mode;
- and
- a computing device is configured to perform following steps:
- detecting validity of lease information in a heartbeat file stored in the cloud disk, wherein a primary node in the database system maintains a primary node state by modifying the lease information;
- in response to detecting that the lease information is invalid, preempting a write permission of the cloud disk based on the storage protocol, to register the computing device as a new holder;
- and
- switching a node state of the computing device to the primary node state.
A computing device, wherein the computing device is implemented as a computing node in a database system;
- wherein the database system further comprises a cloud disk configured in a target mode;
- wherein a holder in a storage protocol supported by the cloud disk has a read-write permission on the cloud disk in the target mode;
- wherein a registrant in the storage protocol has a read-only permission on the cloud disk in the target mode;
- and
- the computing device comprises a memory and a processor, wherein the memory is configured to store a computer program;
- and the processor is coupled to the memory, and is configured to execute the computer program, to perform following steps:
- detecting validity of lease information in a heartbeat file stored in the cloud disk, wherein a primary node in the database system maintains a primary node state by modifying the lease information;
- in response to detecting that the lease information is invalid, preempting a write permission of the cloud disk based on the storage protocol, to register the computing device as a new holder;
- and
- switching a node state of the computing device to the primary node state.
Dependencies are inferred from the claim text.