Data backup rule allocation method, node, system and storage medium
Subscribing to node events and locking mechanisms through the information center, data backup rules are automatically transferred to healthy nodes, which solves the high availability problem when the backup rule initiator node goes down and ensures the stability of the data backup system.
Patent Information
- Application Number
- CN202210102796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-01-27
AI Technical Summary
In the data backup system, when the initiator node of the backup rules goes down, the data backup rules cannot be automatically transferred, resulting in insufficient high availability guarantee.
Subscribe to node registration events and downtime events through the information center, check whether there is a downtime node based on locks as a data backup rule for the initiating node, and assign it to registered healthy nodes in the cluster.
It implements data backup rules initiated by other healthy nodes when a node goes down, ensuring high availability of the system and data security.
Smart Images

Figure CN114490186B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a data backup rule allocation method, node, system and storage medium. Background Art
[0002] In order to avoid single point failure, data backup systems have begun to use cluster technology to achieve high availability of backup nodes. When the target end of a data backup rule is a cluster, the initiator of the rule can select a healthy node in the target cluster to perform the backup.
[0003] The selection process of backup cluster nodes is embedded in the rule execution process, so the rules must be initiated or executed by an initiator. However, when the initiator of the rule itself goes down, the rule has no initiator to execute, so it cannot cope with the downtime, resulting in the lack of high availability guarantee at the initiator of the rule. Summary of the invention
[0004] The embodiment of the present invention provides a data backup rule allocation method, node, system and storage medium, which ensures that when a node goes down, other healthy nodes can initiate the data backup rules that the down node is responsible for, thereby ensuring high availability.
[0005] In a first aspect, an embodiment of the present invention provides a data backup rule allocation method, which is applied to each node in a cluster, and the method includes:
[0006] Subscribe to node registration events and node downtime events from the information center;
[0007] If the node downtime event is received, check based on the lock whether there is a data backup rule with the downtime node as the initiating node;
[0008] If yes, the data backup rule is assigned to a healthy node in the cluster that has been registered with the information center.
[0009] In a second aspect, an embodiment of the present invention further provides a node, the node comprising:
[0010] one or more processors;
[0011] A storage device for storing one or more programs;
[0012] When the one or more programs are executed by the one or more processors, the one or more processors implement the data backup rule allocation method as described in the first aspect.
[0013] In a third aspect, an embodiment of the present invention provides a data backup rule distribution system, the data backup rule distribution system comprising an information center, a control machine, and a cluster consisting of a plurality of nodes as described in the first aspect;
[0014] The control machine is used to form the multiple nodes into a cluster according to user instructions, and the cluster is the initiator of the data backup rule;
[0015] The control machine is also used to query the initiating node of the data backup rule and display the execution status or execution log of the data backup rule;
[0016] The information center is used to record the real-time information related to the data backup rules and the cluster.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data backup rule allocation method provided in the embodiment of the first aspect of the present invention.
[0018] The embodiment of the present invention discloses a data backup rule allocation method, node, system and storage medium, the method comprising: subscribing to node registration events and node downtime events from an information center; if the node downtime event is received, checking based on a lock whether there is a data backup rule with the downtime node as the initiating node; if so, assigning the data backup rule to a healthy node in the cluster that has been registered with the information center. The technical solution provided by the embodiment of the present invention subscribes to node registration events and node downtime events from an information center. When the initiating node of the data backup rule goes down, the data backup rule is assigned to a healthy node in the cluster that has been registered with the information center, ensuring that when a node goes down, other healthy nodes can initiate the data backup rule that the downtime node is responsible for, thereby ensuring high availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a data backup rule allocation method provided in Embodiment 1 of the present invention;
[0020] Figure 2 A schematic diagram of information stored in an information center provided in Embodiment 1 of the present invention;
[0021] Figure 3 A schematic diagram of node downtime event processing provided in Embodiment 1 of the present invention;
[0022] Figure 4 A schematic diagram of high availability logic of data backup rules is provided for the first embodiment of the present invention;
[0023] Figure 5 A schematic diagram of the structure of a node provided in Embodiment 2 of the present invention;
[0024] Figure 6 A structural diagram of a data backup rule distribution system provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.
[0026] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0027] The terms "first" and "second" and the like in the description, claims and drawings of the embodiments of the present invention are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0028] Embodiment 1
[0029] Figure 1 The present invention provides a flowchart of a method for allocating data backup rules in accordance with the first embodiment of the present invention. The system is applicable to the case of high availability of data backup rules when a node is down. The method can be executed by any node in the cluster. Figure 1 As shown, the method specifically comprises the following steps:
[0030] S110 . Subscribe to node registration events and node downtime events from the information center.
[0031] It is clear that this method can be applied to each node in the cluster, and each node in the cluster can execute this method, thereby ensuring that the data backup rules can be reliably distributed to healthy nodes in the end. When a node downtime event occurs, the node downtime event can be obtained to determine whether the initiating node of the data backup rule has downtime. If the initiating node has downtime, other healthy nodes can initiate the data backup rules that the downtime node is responsible for, ensuring high availability.
[0032] In this embodiment, the information center can be used as an independent process and run in a container. The information center is used to receive registration requests from each initiator cluster node, record and update the cluster node list information; when the cluster node has not sent a keep-alive message for a long time, the node is determined to be down. The information center stores node registration events and node downtime events, and publishes node registration events and node downtime events to all subscribers. The information center can also contain other information. Exemplarily, the information center records the following real-time information in the form of key-value pairs: the initiator cluster identifier (ID) corresponding to each data backup rule, the identifier of each data backup rule, the initiator node of each data backup rule, the target end of each data backup rule, the shared replication volume identifier involved in each data backup rule, the mounter of each shared replication volume, and the Internet Small Computer System Interface (ISCSI) protocol information.
[0033] Among them, subscription can be specifically understood as the node subscribing to the events of interest to the node to the information center through this operation. It can be known that in this embodiment, the events of interest to the node include node registration events and node downtime events. By obtaining the node registration events, the nodes that have been registered in the information center can be known, which is used to subsequently allocate data backup to other healthy nodes that have registered in the information center; by obtaining the node downtime events, it can be known whether there is a node downtime event, which is used to subsequently determine whether the node is down.
[0034] Among them, all nodes in the backup initiator cluster will register "themselves" to the information center when they start up, forming a node registration event, which can record relevant information about the node registration, such as the node ID, registration time, etc. When a node goes down, a node downtime event will be formed, which can record relevant information about the node downtime, where downtime can also be understood as shutdown, which means that the node cannot work normally, for example, the relevant information can include the node ID, the time when the node went down, etc.
[0035] For the purpose of more clearly describing the embodiments of the present invention, Figure 2 This is a schematic diagram of information stored in the information center provided in the first embodiment of the present invention. Figure 2As shown in the figure, the information center records real-time information in the form of key-value pairs: the initiator cluster identifier corresponding to each data backup rule, the identifier of each data backup rule, the initiator node of each data backup rule, the target end of each data backup rule, the shared replication volume identifier involved in each data backup rule, the mounter of each shared replication volume, etc. As can be seen from the figure, the information center stores real-time information of multiple data backup rules, replication volumes, and nodes, among which data backup rule 1 (referred to as rule 1) is used as an example for description. The relevant information contained in rule 1 includes that the initiator cluster is cluster 1, the initiator node is node 1, the data location is replication volume 1 (referred to as volume 1), and the target cluster is cluster 2. The relevant information of volume 1 includes information such as the mounter cluster is cluster 1, the mounting node is node 1, and the storage pool. The relevant information of node 1 includes information such as the cluster to which node 1 belongs, cluster 1, and the address. It can be seen that nodes 1, 2, and 3 all send daily keep-alive messages, and volume 1 is mounted to node 1. It can be seen that the information center contains a large amount of real-time information.
[0036] Specifically, the node registration event and node downtime event are subscribed from the information center. When a node is registered, a node registration event is generated and published to the subscriber by the information center. Similarly, when a node is down, a node downtime event is generated and published to the subscriber by the information center. If the node does not receive the node downtime event, the data backup rule can be assigned normally; if the node downtime event is received, it is necessary to determine whether the downtime node is the initiating node corresponding to the data backup rule.
[0037] S120: If a node downtime event is received, check based on the lock whether there is a data backup rule that uses the downtime node as the initiating node.
[0038] Among them, the function of the lock can be understood as being used to lock the object, preventing multiple nodes from operating on the same data at the same time. Because there are multiple nodes in the cluster, if two or more nodes operate on the same data at the same time, there will be unsafe conditions in the data operation. In order to solve this problem, a lock mechanism is used. That is, when a node operates a piece of data, the lock will lock the resource, and other nodes cannot perform any operations on the data before submission, which can greatly ensure the security of the data. For example, a node wants to assign rule 1 to node 1. If it is not locked, other nodes may also read this rule 1 and want to assign it to node 2, which will cause a conflict. When based on the lock mechanism, the node can assign rule 1 to node 1, and it will not be read or operated by other nodes.
[0039] In this embodiment, the initiator node can be specifically understood as the initiator when the data backup rule is executed. When the data backup rule is executed, an initiator and a target end are required. The initiator can access the backed up data, execute the data backup rule, find and connect to the target end, and transmit the backed up data to the target end. In this embodiment, multiple initiator nodes can form an initiator cluster.
[0040] The information center records and updates the cluster-related instant information of each data backup rule in the form of key-value pairs. Each data backup rule has its own key-value pair, which includes the initiator cluster identifier corresponding to each data backup rule, the identifier of each data backup rule, the initiator node of each data backup rule, the target end of each data backup rule, and the shared replication volume identifier involved in each data backup rule. The data backup rules can be specifically understood as the rules followed for data backup. For example, they can also include which data to back up, how often to back up, etc. They can also include the initiator node (identifier) and the target node (identifier). Data backup rules can be divided into scheduled data backup rules and immediately executed data backup rules.
[0041] Specifically, when a node downtime event is received, the node downtime event contains the node identifier of the downtime, so that it is possible to know which node has experienced the downtime; by traversing the real-time information recorded by the information center, based on the initiator cluster identifier corresponding to each data backup rule stored in the key-value pair, the identifier of each data backup rule and the initiating node of each data backup rule, it is determined whether the downtime node is the initiating node of a certain data backup rule.
[0042] S130: If yes, assign the data backup rule to a healthy node in the cluster that has been registered in the information center.
[0043] Specifically, based on the judgment result of step S120, if there is a data backup rule with the downtime node as the initiating node, the downtime node cannot work, and other healthy nodes need to initiate the data backup rule that the downtime node is responsible for. It is clear that the nodes registered in the information center will generate node registration events. By subscribing to the node registration events from the information center, the information of other nodes in the cluster where the downtime node is located can be obtained. By traversing other nodes in the cluster, the data backup rule can be assigned to any healthy node, and the selected healthy node is responsible for the data backup rule that the downtime node is responsible for.
[0044] For the purpose of more clearly describing the embodiments of the present invention, Figure 3 Schematic diagram of node downtime event processing provided by Embodiment 1 of the present invention; Figure 3As shown in FIG, when a node downtime event is received, a lock is used to check whether there is a data backup rule that uses the downtime node as the initiating node. Figure 3 It can be seen that node 1 is a down node. From the information center, it can be obtained that the initiating node of data backup rule 1 (referred to as rule 1) is node 1, so the data backup rule is assigned to the healthy node in the cluster that has been registered in the information center. It can be seen that data backup rule 1 is reassigned to node 2, and the initiating node of data backup rule 1 is updated to node 2 in the information center. Similarly, the mounter of replication volume 1 (referred to as volume 1) also needs to be changed from down node 1 to healthy node 2.
[0045] The embodiment of the present invention discloses a data backup rule allocation method, node, system and storage medium, the method comprising: subscribing to node registration events and node downtime events from an information center; if a node downtime event is received, checking based on a lock whether there is a data backup rule with the downtime node as the initiating node; if so, assigning the data backup rule to a healthy node in the cluster that has been registered in the information center. The technical solution provided by the embodiment of the present invention subscribes to node registration events and node downtime events from an information center, and when the initiating node of the data backup rule goes down, the data backup rule is assigned to a healthy node in the cluster that has been registered in the information center, ensuring that when a node goes down, other healthy nodes can initiate the data backup rule that the downtime node is responsible for, thereby ensuring high availability.
[0046] Optionally, the method further includes: maintaining a list of healthy nodes in the cluster based on node registration events and node downtime events.
[0047] The directory can be specifically understood as a list that records whether the nodes are healthy, and can include information such as the node identifier and health status. Specifically, when there is a node registration event, it means that a new node has been registered, and the new registered node can be updated to the list of healthy nodes in the cluster. When there is a node downtime event, it means that a node in the list is down and cannot work normally, and the downtime node is deleted from the list of healthy nodes in the cluster. This operation can ensure that the list of healthy nodes in the cluster is real-time and valid.
[0048] As an optional embodiment of the embodiment of the present invention, based on the above embodiment, the method further includes:
[0049] If the initiator of the data backup rule created by the user is a cluster, the data backup rule will be sent to all healthy nodes in the cluster that have been registered in the information center, and the data backup rule will be assigned to the healthy nodes in the cluster that have been registered in the information center.
[0050] It is clear that data backup rules are created by users according to their own needs, and the rules can include the clusters that users want to use. When users create data backup rules, as long as they choose to initiate the rule from the cluster, the data backup rules will be sent to all healthy nodes of the initiator cluster. The data backup rules will be perceived by every healthy node in the initiator cluster and attempted to be executed. To this end, the process of sending rules from the console to the background nodes must be enhanced. Of course, in order to avoid data conflicts, only one node, that is, the current initiating node of the rule, will actually execute the logic of data backup; other nodes usually only execute the high availability logic for the rule.
[0051] Specifically, this step is executed when the user creates a data backup rule. If the initiator of the data backup rule created by the user is a cluster, the data backup rule is sent to all healthy nodes in the cluster that have been registered with the information center, and the data backup rule is assigned to a healthy node in the cluster that has been registered with the information center. It should be noted that all healthy nodes registered with the information center can be assigned data backup rules, on this basis, the high availability of nodes in the cluster can be guaranteed; in addition, multiple data backup rules can be evenly distributed to each healthy node in the cluster to maintain the stability of the cluster.
[0052] In this embodiment, each data backup rule is assigned to a healthy node, and all healthy nodes receive each data backup rule. For data backup rules, each data backup rule has a copy in all healthy nodes, but it will only be executed in its initiator node (i.e., the assigned healthy node); for nodes in the cluster, each healthy node will receive a copy of all data backup rules, but each healthy node will only execute the data backup rules assigned to itself. Such a mechanism allows each healthy node in the initiator cluster to know how many data backup rules there are in the cluster; it can also go to the information center to check whether the initiator node of each data backup rule is running normally by traversing the copies of all data backup rules.
[0053] Preferably, allocating the data backup rule to a healthy node in the cluster that has been registered in the information center includes: allocating the data backup rule to a healthy node in the cluster that has been registered in the information center and has the lightest load.
[0054] The weight of the load determines the processing efficiency of the node. A heavy load indicates that the node needs to process more events, while a light load indicates that the node needs to process fewer events. In order to improve the efficiency of data backup and consider the load balance, these nodes will allocate the data backup rule to a healthy node with the lightest load that has been registered in the information center based on lock allocation. This node becomes the "initiating node" of this data backup rule.
[0055] The above embodiment is to ensure high availability when a node crash occurs. In order to enhance high availability, the following embodiment is a pre-step, which can read the data backup rules in advance and determine whether reallocation is required, providing double protection.
[0056] As an optional embodiment of the embodiment of the present invention, based on the above embodiment, it also includes:
[0057] a1) Read the initiating node of the data backup rule from the information center.
[0058] Specifically, before the data backup rule is executed, it is executed by all nodes of the initiating cluster. The information center records the following real-time information in the form of key-value pairs, including the identifier of the data backup rule, the initiating node of the data backup rule, etc. According to the identifier of the data backup rule, the current initiating node corresponding to the data backup rule is read from the information center.
[0059] b1) If the initiating node is this node, data backup is performed according to the data backup rules.
[0060] Specifically, if the data backup rule read from the information center corresponds to the current initiating node being the current node (ie, "itself"), since the current node is a healthy node, data backup can be performed according to the data backup rule.
[0061] c1) If the initiating node is not the current node, determine whether the initiating node is a healthy node based on the list of healthy nodes.
[0062] Specifically, if the data backup rule read from the information center corresponds to the current initiating node which is not the current node (i.e. not "itself"), it is necessary to determine whether the current initiating node is a healthy node, which can be determined based on whether the current initiating node is included in the list of healthy nodes in the cluster. Since the list of healthy nodes is updated in real time, if the current initiating node is included in the list of healthy nodes, it means that the current initiating node is a healthy node, and the process ends. If the current initiating node is not included in the list of healthy nodes, it means that the current initiating node is not a healthy node, and the current initiating node cannot perform subsequent data backup.
[0063] d1) If not, the data backup rule is assigned to a healthy node in the cluster that has been registered with the information center based on the lock.
[0064] Data backup rules can be divided into scheduled backup rules and immediate backup rules. In either case, all nodes in the initiating cluster will first execute the high availability logic related to the rule: determine the health status of the current initiating node, and take the lock to reallocate the rule when necessary. After the high availability logic, the actual execution phase of the rule will begin. However, if the rule initiating node of the information center is not the current node at this time, the data backup rule execution will be skipped.
[0065] Specifically, if the current initiating node is not a healthy node, you need to take the lock to assign the data backup rule to a healthy node in the cluster that has been registered in the information center. Similarly, you can assign the data backup rule to a healthy node in the cluster that has been registered in the information center with the lightest load, and then write the new node as the new initiating node of the rule to the information center and release the lock. If the data allocation rule is assigned to this node, data backup will be executed again.
[0066] For the purpose of more clearly describing the embodiments of the present invention, Figure 4 The schematic diagram of the high availability logic of the data backup rule is provided for the first embodiment of the present invention. Figure 4 As shown, the initiating node of the data backup rule is read from the information center. As shown in the figure, if node 2 reads from the information center that the initiating node of data backup rule 1 (referred to as rule 1) is node 2, it can be known that the initiating node is the current node, and data backup is performed according to the data backup rule. If node 3 reads from the information center that the initiating node of data backup rule 1 (referred to as rule 1) is node 2, it can be known that the initiating node is not the current node, and then judge whether the initiating node is a healthy node based on the list of healthy nodes. If it is a healthy node, skip it; if it is not a healthy node, assign the data backup rule to the healthy nodes in the cluster that have been registered in the information center based on the lock.
[0067] As an optional embodiment of the present invention, a high availability logic is added as a pre-step of the data backup rule to determine whether the initiating node of the data backup rule is the current node, and further determine whether it is a healthy node, thereby ensuring that the data backup rule is assigned to a healthy node to ensure high availability. The technical solution provided by this embodiment can read the data backup rule in advance and determine whether it needs to be reallocated, and is used together with the above embodiment to ensure high availability when a node downtime event occurs, providing double protection.
[0068] As an optional embodiment of the embodiment of the present invention, based on the above embodiment, the data backup rule is assigned to a healthy node in the cluster that has been registered in the information center, including:
[0069] a2) If the data backup rule is stored in a shared replication volume in the cluster, the node where the shared replication volume is currently mounted is read from the information center, and the data backup rule is assigned to the currently mounted node.
[0070] Specifically, a shared replicated volume can be understood as a virtual space that is logically continuous and physically distributed on one or more storage devices. The information center records the cluster-related real-time information of the shared replicated volume in the form of key-value pairs. The key-value pair of the shared replicated volume can be located through the shared replicated volume identifier, which contains the initiator cluster identifier, the shared replicated volume identifier, the mounter of the shared replicated volume, and various information required by the ISCSI protocol.
[0071] Specifically, if the data source of a data backup rule is a shared replication volume stored on the rule initiator, then when reallocating the data backup rule, first read who currently mounts the shared replication volume from the information center. It is clear that the information center stores information such as the initiator cluster ID, the shared replication volume ID, and the mounter of the shared replication volume, and then allocates the data backup rule to the node where the replication volume is currently mounted, rather than selecting a node based on load severity.
[0072] b2) If the shared replication volume is not currently mounted to any node, the data backup rule is assigned to a healthy node in the cluster that has been registered with the information center, and the shared replication volume is mounted by the healthy node.
[0073] Specifically, if the shared replication volume has not been mounted to any node, you can select a node according to the load, assign data backup rules, and then let the new node perform the mount, and then write the new mount node of the shared replication volume to the information center. Similarly, in order to improve data backup efficiency, assign the data backup rule to a healthy node in the cluster with the lightest load that has been registered in the information center.
[0074] As an optional embodiment of the present invention, in the technical solution provided by this embodiment, when the nodes in the data backup rule initiator cluster reallocate rules, they will give priority to the migration of the involved replication volumes. Because some replication volumes cannot be mounted by multiple nodes at the same time, when an initiator node mounts a replication volume and acts as the initiator of multiple rules related to this replication volume, these rules must all be assigned to the same new initiator node.
[0075] According to the technical solution provided by the embodiment of the present invention, each node of the initiating end cluster will pay attention to all data backup rules related to the cluster, and try to execute the high availability logic related to the data backup rule. When the initiator of the rule in the information center is itself, the data backup rule will be executed. That is to say, before the rule is executed, all nodes may be the initiator of the rule, so they must try to execute it; at the same time, the aforementioned nodes monitor each other and the logic of rule redistribution ensures that the initiating node in the information center is healthy and unique. In this way, even if the previously assigned initiating node is down, there will be no problem of failure to execute the rule.
[0076] Embodiment 2
[0077] Figure 5 A schematic diagram of a node structure provided in the second embodiment of the present invention is shown in FIG. Figure 5 As shown, the node includes a processor 21, a memory 22, an input device 23 and an output device 24; the number of processors 21 in the node can be one or more. Figure 5 A processor 21 is taken as an example; the processor 21, memory 22, input device 23 and output device 24 in the node can be connected by a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0078] Specifically, in the embodiment, when the processor 21 executes one or more programs stored in the memory 22, the following operations can be implemented: subscribing to node registration events and node downtime events from the information center; if the node downtime event is received, checking based on the lock whether there is a data backup rule with the downed node as the initiating node; if so, assigning the data backup rule to the healthy nodes in the cluster that have been registered with the information center.
[0079] The memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0080] The input device 23 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 24 may include a display device such as a display screen.
[0081] Embodiment 3
[0082] Figure 6 A structural diagram of a data backup rule distribution system provided in Embodiment 3 of the present invention is shown in FIG. Figure 6 As shown, the data backup rule distribution system includes: an information center 31, a control machine 32, and a cluster 33 composed of multiple nodes as in the above-mentioned embodiment.
[0083] The control machine 32 is used to organize multiple nodes into a cluster 33 according to user instructions. The cluster 33 is the initiator of the data backup rule. The control machine 32 is also used to query the initiator node of the data backup rule and display the execution status or execution log of the data backup rule. The information center 31 is used to record real-time information related to the data backup rule and the cluster.
[0084] Specifically, the user organizes a number of appropriate nodes into a cluster 33 of the data backup rule initiator on the control machine 32 interface. At the same time, the control machine 32 can also be a website (web) server, providing a browser-based web page. The user can query the initiator node of the data backup rule on the web page, and the execution status or execution log of the data backup rule can be displayed on the interface.
[0085] In the prior art, the console logic is to query the rule initiator for the execution status and execution log of the rule. Because the initiator is transformed into a cluster, the console must first query the information center for the current initiating node of the rule before knowing which node to query for status and log information.
[0086] Furthermore, the information center records the following real-time information in the form of key-value pairs: the initiator cluster identifier corresponding to each data backup rule, the identifier of each data backup rule, the initiator node of each data backup rule, the target end of each data backup rule, the shared replication volume identifier involved in each data backup rule, the mounter of each shared replication volume, and ISCSI protocol information.
[0087] Embodiment 4
[0088] Embodiment 4 of the present invention also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a data backup rule allocation method, the method comprising: subscribing to node registration events and node downtime events from an information center; if the node downtime event is received, checking based on a lock whether there is a data backup rule with the downed node as the initiating node; if so, allocating the data backup rule to a healthy node in the cluster that has been registered with the information center.
[0089] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the data backup rule allocation method provided in any embodiment of the present invention.
[0090] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0091] It is worth noting that in the embodiment of the above-mentioned data backup rule allocation system, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0092] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data backup rule allocation method, characterized in that: Applied to each node in the cluster, the method includes: Subscribe to node registration events and node downtime events from the information center; If the node downtime event is received, a lock-based check is performed to determine whether there is a data backup rule with the downtime node as the initiating node; wherein the initiating node is the initiator when the data backup rule is executed, the node downtime event includes the node identifier of the downtime node, and the information center records the real-time information in the form of a key-value pair; when the node downtime event is received, by traversing the real-time information recorded by the information center, according to the initiating end cluster identifier corresponding to each data backup rule stored in the key-value pair, the identifier of each data backup rule and the initiating node of each data backup rule, it is determined whether the downtime node is the initiating node of a certain data backup rule; If yes, assigning the data backup rule to a healthy node in the cluster that has been registered at the information center; The method further includes: the node reads the initiating node of the data backup rule from the information center, and determines whether the initiating node of the data backup rule is the current node; if the initiating node is the current node, the data backup is performed according to the data backup rule; if the initiating node is not the current node, the initiating node is determined to be a healthy node according to the list of healthy nodes; if not, the data backup rule is assigned to a healthy node in the cluster that has been registered in the information center based on the lock, and the healthy node is written into the information center as a new initiating node of the data backup rule; Allocating the data backup rule to a healthy node in the cluster that has been registered in the information center includes: If the data backup rule is stored in a shared replication volume in the cluster, the node where the shared replication volume is currently mounted is read from the information center, and the data backup rule is assigned to the node where the shared replication volume is currently mounted; If the shared replication volume is not currently mounted to any node, the data backup rule is assigned to a healthy node in the cluster that has been registered in the information center, and the shared replication volume is mounted by the healthy node, and the newly mounted node of the shared replication volume is written to the information center.
2. The method according to claim 1, characterized in that Also includes: A list of healthy nodes in the cluster is maintained according to the node registration event and the node downtime event.
3. The method according to claim 1, characterized in that Also includes: If the initiator of the data backup rule created by the user is the cluster, the data backup rule will be sent to all healthy nodes in the cluster that have been registered in the information center, and the data backup rule will be assigned to a healthy node in the cluster that has been registered in the information center; wherein each healthy node in the cluster will receive a copy of all data backup rules, and each healthy node will only execute the data backup rule assigned to it.
4. The method according to claim 1, characterized in that: Allocating the data backup rule to a healthy node in the cluster that has been registered in the information center includes: If the shared replication volume is not currently mounted to any node, the data backup rule is assigned to a healthy node in the cluster that has been registered in the information center and has the lightest load.
5. A node, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data backup rule allocation method as described in any one of claims 1-4.
6. A data backup rule distribution system, characterized in that: A cluster comprising an information center, a control machine and a plurality of nodes as claimed in claim 5; The control machine is used to form a cluster of the plurality of nodes according to user instructions, and the cluster is the initiator of the data backup rule; The control machine is also used to query the initiating node of the data backup rule and display the execution status or execution log of the data backup rule; The information center is used to record the real-time information related to the data backup rules and the cluster.
7. The system according to claim 6, characterized in that The information center records the following real-time information in the form of key-value pairs: The initiator cluster identifier corresponding to each data backup rule, the identifier of each data backup rule, the initiator node of each data backup rule, the target end of each data backup rule, the shared replication volume identifier involved in each data backup rule, the mounter of each shared replication volume, and the small computer system interface ISCSI protocol information.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data backup rule allocation method as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Configuration node fault transfer method and system in SVC cluster
CN102035862A
Distributed task processing method and device
CN105760240A
Fault node isolation method and cluster system
CN107947976A
Node crash take-over method and apparatus, and node cluster system
CN108063782A
Node fault processing method and device, storage medium and electronic equipment
CN111787113A
