CN117201489A - Cloud node recovery method, device, equipment and medium based on double-node cluster - Google Patents

Cloud node recovery method, device, equipment and medium based on double-node cluster Download PDF

Info

Publication number
CN117201489A
CN117201489A CN202310928559.XA CN202310928559A CN117201489A CN 117201489 A CN117201489 A CN 117201489A CN 202310928559 A CN202310928559 A CN 202310928559A CN 117201489 A CN117201489 A CN 117201489A
Authority
CN
China
Prior art keywords
node
cloud
cloud node
cluster
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310928559.XA
Other languages
Chinese (zh)
Inventor
兰天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Cloud Computing Technology Co ltd
Original Assignee
Zhongdian Cloud Computing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Cloud Computing Technology Co ltd filed Critical Zhongdian Cloud Computing Technology Co ltd
Priority to CN202310928559.XA priority Critical patent/CN117201489A/en
Publication of CN117201489A publication Critical patent/CN117201489A/en
Pending legal-status Critical Current

Links

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The embodiment of the disclosure relates to a cloud node recovery method, device, equipment and medium based on a dual-node cluster, and relates to the technical field of cloud, wherein the method comprises the following steps: under the condition that connection between the first cloud node and the second cloud node is interrupted, if the first cloud node is a main node, the cloud primary data in the first cloud node are backed up, and backup data are obtained; the first cloud node and the second cloud node are two cloud nodes contained in the initial double-node cluster; and establishing a single node cluster comprising the first cloud node according to the backup data. According to the embodiment of the disclosure, under the condition that connection between two cloud nodes in the dual-node cluster is interrupted, the first cloud node serving as the main node is backed up, and the single-node cluster containing the main node is established based on the backup data, and can provide services similar to those of the original dual-node cluster, so that the rapid automatic recovery of the dual-node cluster function is realized, and the retention of the cloud primary data is improved.

Description

Cloud node recovery method, device, equipment and medium based on double-node cluster
Technical Field
The disclosure relates to the field of cloud technology, and in particular relates to a cloud node recovery method, device, equipment and medium based on a dual-node cluster.
Background
With the development of cloud technology, the application of the cloud cluster is becoming wider, and the cloud cluster may include 1 cloud node or a plurality of cloud nodes.
In the related art, for a cloud cluster composed of 1 or more than 3 cloud nodes, a corresponding automatic recovery scheme is provided. However, for a cloud cluster consisting of 2 cloud nodes, there is no corresponding automated recovery scheme.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the disclosure provides a cloud node recovery method, a device, equipment and a medium based on a dual-node cluster.
The embodiment of the disclosure provides a cloud node recovery method based on a dual-node cluster, which is applied to a first cloud node and comprises the following steps:
under the condition that connection between the first cloud node and the second cloud node is interrupted, if the first cloud node is a main node, the cloud primary data in the first cloud node are backed up, and backup data are obtained; the first cloud node and the second cloud node are two cloud nodes contained in an initial double-node cluster;
and establishing a single-node cluster containing the first cloud node according to the backup data.
The embodiment of the disclosure also provides a cloud node recovery device based on the dual-node cluster, which is applied to a first cloud node and comprises:
the backup module is used for backing up the cloud primary data in the first cloud node to obtain backup data if the first cloud node is a master node under the condition that the connection between the first cloud node and the second cloud node is interrupted; the first cloud node and the second cloud node are two cloud nodes contained in an initial double-node cluster;
and the operation module is used for establishing a single-node cluster containing the first cloud node according to the backup data.
The embodiment of the disclosure also provides an electronic device, which comprises: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instruction from the memory, and execute the instruction to implement a cloud node recovery method based on a dual node cluster according to an embodiment of the disclosure.
The embodiment of the disclosure also provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is used for executing the cloud node recovery method based on the dual node cluster.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: the cloud node recovery scheme based on the dual-node cluster provided by the embodiment of the disclosure comprises the following steps: under the condition that connection between the first cloud node and the second cloud node is interrupted, if the first cloud node is a main node, the cloud primary data in the first cloud node are backed up, and backup data are obtained; the first cloud node and the second cloud node are two cloud nodes contained in the initial double-node cluster; and establishing a single node cluster comprising the first cloud node according to the backup data. By adopting the technical scheme, under the condition that the connection between two cloud nodes in the dual-node cluster is interrupted, the first cloud node which is the main node is backed up, and the single-node cluster containing the main node is established based on the backup data, and the single-node cluster can provide similar service as the original dual-node cluster based on the original cloud primary data, so that the rapid automatic recovery of the dual-node cluster function is realized, and the retention of the cloud primary data is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a cloud node recovery method based on a dual node cluster according to an embodiment of the disclosure;
fig. 2 is a flow chart of another cloud node recovery method based on a dual node cluster according to an embodiment of the disclosure;
fig. 3 is a flow chart of another cloud node recovery method based on a dual node cluster according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of a cloud node recovery device based on a dual-node cluster according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
With the development of cloud technology, the application of the cloud cluster is becoming wider, and the cloud cluster may include 1 cloud node or a plurality of cloud nodes.
In the related art, for a cloud cluster composed of 1 or more than 3 cloud nodes, a corresponding automatic recovery scheme is provided. For a cloud cluster consisting of 2 cloud nodes, the 2 cloud nodes are required to be used as independent single-node clusters respectively, and for the two single-node clusters, a user needs to manually synchronize data so that the two single-node clusters are mutually backed up, and under the condition of failure, the two single-node clusters are restored by a basic unit of the single-node cluster.
The above solution is still essentially a recovery of a single-node cluster, and it can be seen that there is no corresponding automated recovery solution for a cloud cluster consisting of 2 cloud nodes.
In order to solve the above-mentioned problems, the embodiments of the present disclosure provide a cloud node recovery method based on a dual node cluster, and the method is described below with reference to specific embodiments.
Fig. 1 is a schematic flow chart of a cloud node recovery method based on a dual-node cluster, which is provided in an embodiment of the present disclosure, and the cloud node recovery method based on the dual-node cluster may be applied to a first cloud node in the dual-node cluster, or the cloud node recovery method based on the dual-node cluster may be applied to a cloud node recovery device based on the dual-node cluster, and the cloud node recovery device based on the dual-node cluster may be implemented by using software and/or hardware, and the cloud node recovery device based on the dual-node cluster may be generally integrated in an electronic device. As shown in fig. 1, the cloud node recovery method based on the dual-node cluster includes:
step 101, under the condition of connection interruption between a first cloud node and a second cloud node, if the first cloud node is a main node, backing up cloud primary data in the first cloud node to obtain backup data; the first cloud node and the second cloud node are two cloud nodes contained in the initial double-node cluster.
The cloud node may be a server node constructed based on a cloud technology, and the functions implemented by the cloud node are various, which is not limited in this embodiment, for example, the functions implemented by the cloud node may include: a data storage function and/or a computing function. A dual node cluster (cluster) may be a cloud native cluster comprising a number of cloud nodes of 2, which may be a cluster built based on cloud native Kubernetes (K8 s). The initial dual-node cluster may be a dual-node cluster constructed based on the first cloud node and the second cloud node before connection between the first cloud node and the second cloud node is broken.
The first cloud node and the second cloud node may be different cloud nodes in a dual node cluster. For example, the first cloud node may be any one cloud node in the dual-node cluster, and the second cloud node may be another cloud node in the dual-node cluster other than the first cloud node. There are various types of connection between the first cloud node and the second cloud node, and the present embodiment is not limited. The connection may be, for example, a wired connection or a wireless connection. The functions realized by this connection are various, and the present embodiment is not limited, and for example, the functions realized by this connection may be network connections for realizing communication functions. In an alternative embodiment, the connection may be a direct connection between the first cloud node and the second cloud node, i.e. the connection is a connection directly from the first cloud node to the second cloud node, the connection not being via other preset network devices.
The master node is also called a master node, which can be a node for managing the dual-node cluster, and the slave node is also called a backup node, which can be a node for receiving instructions of the master node and performing related work. In the event of a connection break between the first cloud node and the second cloud node, one of the first cloud node and the second cloud node is determined as a master node, and the other master node is determined as a slave node, respectively. The cloud native data may be DataBase (DB) data of a distributed key value DataBase (etcd). The backup data may be copy data of cloud-native data, the differences from the cloud-native data including differences in storage paths.
In the embodiment of the disclosure, due to a cloud node fault, a network fault between a first cloud node and a second cloud node, and the like, communication between the first cloud node and the second cloud node cannot be directly performed. Thus, the dual-node cluster cannot function properly and the dual-node cluster cannot provide service out of the home normally. And judging whether the first cloud node is a master node or not through an application program pre-installed in the first cloud node, and if the first cloud node is the master node, backing up the cloud primary data in the first cloud node to obtain backup data.
In some embodiments of the present disclosure, backing up cloud primary data in a first cloud node to obtain backup data includes:
and copying the cloud primary data under the preset cloud primary data path to a preset backup path through a node recovery program operated in the first cloud node to obtain backup data.
The node recovery program may be a preset program for recovering the normal operation of the cloud node. The preset cloud primary data path may be a path preset for storing cloud primary data, and the preset cloud primary data path may be set according to a data storage plan in a cloud node, and the embodiment is not limited. For example, the preset distribution path may be/var/lib/etcd/membrane/snap/. The preset backup path may be a preset path for backing up the cloud primary data, and the preset backup path may be set according to a user requirement, etc., which is not limited in this embodiment. For example, the preset backup path may be/backup/db.
In this embodiment, a node recovery program is run in the first cloud node, and the node recovery program detects whether the first cloud node is a master node, and if so, further copies the cloud primary data under the preset distribution path to the preset backup path through the node recovery program to obtain the backup data under the preset backup path.
According to the scheme, the cloud primary data can be timely copied through the node recovery program, and the probability of damage to the stored data caused by the abnormality of the cloud nodes is reduced.
In some embodiments of the present disclosure, the first cloud node and the second cloud node are both connected to a preset network device, where the preset network device may be a preset device for implementing network connection, and the preset network device is multiple, and the embodiment is not limited, and for example, the preset network device may be a gateway. In this embodiment, the first cloud node and the second cloud node have both direct connection and indirect connection through the preset network device. Based on the connection between the first cloud node and the second cloud node, there are various methods for determining whether the first cloud node is the master node, and this embodiment is not limited, and examples are as follows:
in an optional implementation manner, if communication between the first cloud node and the preset network device is normal, and communication abnormality information between the second cloud node and the preset network device is received, the first cloud node is determined to be the master node.
The communication abnormality information may be information indicating abnormality such as interruption of communication between the second cloud node and the preset network device.
In this embodiment, under the condition that it is determined that the direct connection between the first cloud node and the second cloud node is interrupted, the first cloud node may send first test information to the preset network device to determine a communication condition between the first cloud node and the preset network device, and if the preset network device can return, for the first test information, acknowledgement information corresponding to the test information, it is indicated that the communication between the first cloud node and the preset network device is normal. And the first cloud node can send second test information for acquiring the communication condition between the preset network device and the second cloud node to the preset network device, and if the preset network device returns communication abnormality information aiming at the second test information, the communication abnormality between the second cloud node and the preset network device is indicated. Further, the first cloud node is determined to be a master node.
In another optional implementation manner, if communication between the first cloud node and the preset network device is normal, and communication normal information between the second cloud node and the preset network device is received, whether the first cloud node is a master node is determined according to a preset node weight corresponding to the first cloud node.
The communication normal information may be information indicating that no abnormality occurs in communication between the second cloud node and the preset network device. The preset node weight may be a preset value representing the importance of the node, and the preset node weight may be set according to a user requirement, etc., which is not limited in this embodiment. For example, the sum of the preset node weight of the first cloud node and the preset node weight of the second cloud node may be 100, and if the importance of the first cloud node is high, the preset node weight of the first cloud node may be a value greater than 50.
In this embodiment, under the condition that it is determined that the direct connection between the first cloud node and the second cloud node is interrupted, the first cloud node may send first test information to the preset network device to determine a communication condition between the first cloud node and the preset network device, and if the preset network device can return, for the first test information, acknowledgement information corresponding to the test information, it is indicated that the communication between the first cloud node and the preset network device is normal. And the first cloud node can send second test information for acquiring the communication condition between the preset network device and the second cloud node to the preset network device, and if the preset network device returns communication normal information aiming at the second test information, the communication between the second cloud node and the preset network device is normal. Further, comparing the preset node weight of the first cloud node with a preset weight threshold, and if the preset node weight of the first cloud node is greater than the preset weight threshold, determining that the first cloud node is a master node.
In yet another alternative embodiment, a switching mechanism (keep) program and a load balancing (haproxy) program may be pre-installed in the first cloud node and the second cloud node, respectively, through which one master node and one slave node exist in the first cloud node and the second cloud node, and provision of a virtual internet protocol (Internet Protocol, IP) address may be implemented.
In the above scheme, whether the first cloud node is the master node can be automatically judged. And the recovery efficiency of the cloud node is improved.
Step 102, a single node cluster including the first cloud node is established according to the backup data.
The single-node cluster may be a cluster mode including 1 number of cloud nodes.
In this embodiment, after the first cloud node determines the backup data, the first cloud node constructs a single node cluster including the first cloud node itself based on the backup data, and operates the single node cluster to implement service to the outside.
In some embodiments of the present disclosure, establishing a single-node cluster including a first cloud node according to backup data includes: if the data volume of the backup data is kept unchanged within the preset duration, running a preset recovery command to restore the backup data to a preset cloud primary data path, and injecting preset single-node cluster information in the preset recovery command into the first cloud node; and running a preset single-node cluster pull-up command to establish a single-node cluster containing the first cloud node based on the backup data and the preset single-node cluster information.
The preset duration may be set according to a user requirement, etc., and the embodiment is not limited, for example, the preset duration may be 5 seconds. The preset restoration command may be a preset cloud technology command for restoring the cloud node, and the preset restoration command may be a restore command. The preset single-node cluster information may be preset information for establishing a single-node cluster including a single cloud node, and the preset single-node information may be various and may be set according to a user requirement, etc., which is not limited in this embodiment. For example, the preset single-node information may include: token information and/or address information, etc. The address information may be information of an address of data exchange with the first cloud node. The preset single-node cluster pulling command may be a preset cloud technology command for pulling up a single-node cluster, and the preset single-node cluster pulling command may be an etcd command.
In this embodiment, the preset restore command and the preset single-node cluster pull-up command may be sequentially pre-recorded in a first text written in a markup language. And the first cloud node judges whether the data volume of the backup data is continuously unchanged within a preset time period, if so, the backup of the cloud primary data is finished, and the backup data is complete cloud primary data. Further, the commands in the first text are sequentially executed. Firstly, executing a preset recovery command in a first text, copying backup data to a preset cloud primary data path after executing the preset recovery command, and injecting preset single-node cluster information carried in the preset recovery command into the first cloud node. Therefore, basic conditions are created for the establishment of the subsequent single-node cluster model.
Further, a preset single-node cluster pulling command in the first text is operated to pull up the single-node cluster containing the first cloud node based on backup data under the preset cloud primary data path and preset single-node cluster information already injected into the first cloud node. Because the single-node cluster is established based on the cloud native data of the initial double-node cluster, the single-node cluster can continue to serve the initial double-node cluster, and the single-node cluster can realize all or part of functions of the initial double-node cluster.
The cloud node recovery method based on the dual-node cluster provided by the embodiment of the disclosure comprises the following steps: under the condition that connection between the first cloud node and the second cloud node is interrupted, if the first cloud node is a main node, the cloud primary data in the first cloud node are backed up, and backup data are obtained; the first cloud node and the second cloud node are two cloud nodes contained in the initial double-node cluster; and establishing a single node cluster comprising the first cloud node according to the backup data. By adopting the technical scheme, under the condition that the connection between two cloud nodes in the dual-node cluster is interrupted, the first cloud node which is the main node is backed up, and the single-node cluster containing the main node is established based on the backup data, and the single-node cluster can provide similar service as the original dual-node cluster based on the original cloud primary data, so that the rapid automatic recovery of the dual-node cluster function is realized, and the retention of the cloud primary data is improved.
In some embodiments of the present disclosure, the cloud node recovery method based on the dual node cluster further includes: if the first cloud node is a slave node, setting the first cloud node to be in a dormant state, and generating node abnormality prompt information; and responding to the node recovery completion operation, and sending first recovery information to the second cloud node.
The sleep state is also called sleep state. The node abnormality prompt information may be information for prompting that an abnormality occurs in a node, and the display form of the node abnormality prompt information is various, which is not limited in this embodiment. For example, the node abnormality prompt information may be displayed in a popup text and/or a voice prompt. The node recovery completion operation may be an operation for characterizing that the user completes recovery of the first cloud node, and it may be understood that after the node recovery completion operation, the first cloud node can operate normally.
In this embodiment, if the first cloud node is a slave node, the second cloud node is a master node, sets the state of the first cloud node to be a dormant state, and displays node abnormality prompting information to a user, so as to remind the user that the first cloud node is faulty, and remind the user to maintain the first cloud node. After the user receives the node abnormality prompt information, the first cloud node can normally operate through maintenance operations such as network maintenance, hardware maintenance and the like. And, a node recovery completion operation such as a restart operation is performed, and in response to the node recovery completion operation, the first cloud node sends first recovery information to the second cloud node, so that the second Yun Jiedian knows that the first cloud node has recovered, and can join the first cloud node into the cloud node cluster.
In the scheme, the user is prompted to timely maintain the cloud nodes, and after the cloud nodes are maintained, recovery information is timely sent to the second cloud nodes serving as the main nodes, so that a foundation is created for subsequent recovery of the double-node cluster.
In some embodiments of the present disclosure, after establishing the single-node cluster including the first cloud node according to the backup data, the method further includes: under the condition that second recovery information sent by a second cloud node is received, if the second cloud node meets a preset node joining condition, the second cloud node is joined into a single-node cluster, and a target double-node cluster comprising the first cloud node and the second cloud node is obtained.
Fig. 2 is another cloud node recovery method based on a dual node cluster according to an embodiment of the present disclosure, as shown in fig. 2, where the method includes:
step 201, under the condition of connection interruption between a first cloud node and a second cloud node, if the first cloud node is a master node, backing up cloud primary data in the first cloud node to obtain backup data; the first cloud node and the second cloud node are two cloud nodes contained in the initial double-node cluster.
Step 202, a single node cluster including the first cloud node is established according to the backup data.
Step 203, under the condition that the second recovery information sent by the second cloud node is received, if the second cloud node meets a preset node joining condition, joining the second cloud node into the single-node cluster, and obtaining a target dual-node cluster including the first cloud node and the second cloud node.
The second recovery information may be information representing normal operation of the second cloud node. The preset node joining condition may be a condition that a preset node can join the cluster. The target dual-node cluster can be a new dual-node cluster constructed based on the first cloud node and the second cloud node after the first cloud node and the second cloud node can normally operate.
In this embodiment, after the second cloud node can operate normally, the second cloud node sends second recovery information to the first cloud node. And under the condition that the first cloud node receives second recovery information sent by the second cloud node, judging whether the second cloud node meets a preset node joining condition. If yes, the first cloud node adds the second cloud node into the single-node cluster where the first cloud node is located, and a target double-node cluster comprising the first cloud node and the second cloud node is obtained.
In some embodiments of the present disclosure, the second cloud node satisfies a preset node joining condition, including: the node attribute of the second cloud node is a control role attribute, and the second cloud node does not join the node cluster.
The control role attribute is a node attribute of the cloud node, the control role attribute is also called master attribute, and the node with the control role attribute has a basic condition of being added into the cluster.
In this embodiment, a database operation (etcd operator) program may be preset in the first cloud node, where the database operation program may implement a node identification function, and may obtain a node attribute of the second cloud node. After the node attribute of the cloud node is obtained, whether the node attribute is a control role attribute or not is judged. If so, acquiring a cluster state identifier of the second cloud node, and if the cluster state identifier is an empty cluster identifier representing that the cloud node does not join in a cluster, determining that the second cloud node meets a preset node joining condition. If the node attribute is not the control role attribute, or the second cloud node is added to other node clusters although the node attribute is the control role attribute, the second cloud node does not meet the preset node adding condition.
In the scheme, under the condition that the first cloud node operates in a single-node cluster mode, the second cloud node is added into the cluster, and the double-node cluster comprising the first cloud node and the second cloud node is obtained. The automatic recovery of the original double-node cluster is realized.
Next, a cloud node recovery method based on a dual-node cluster in the embodiment of the present disclosure is further described by a specific example, in this embodiment, an initial dual-node cluster including a first cloud node and a second cloud node is pre-deployed, and a keep-alive program and a haproxy program are respectively run on the first cloud node and the second cloud node, and one cloud node is determined to be a master node and the other cloud node is determined to be a slave node under the condition that a fault occurs between the first cloud node and the second cloud node through the keep-alive program and the haproxy program. And a node recovery program is operated on each of the first cloud node and the second cloud node, when the node A or the node B fails, the original double-node cluster cannot work normally, and the node recovery program can recover the cloud nodes.
Fig. 3 is a flow chart of another cloud node recovery method based on a dual node cluster according to an embodiment of the disclosure, where the flow chart is shown in fig. 3:
step 301, detecting whether the first cloud node is a master node through a node recovery program, and if the first cloud node is a slave node, setting the first cloud node to a sleep state.
In step 302, if the first cloud node is the master node, the cloud primary data under the preset cloud primary data path is copied to the preset backup path through the node recovery program, so as to obtain backup data under the preset backup path.
Step 303, calling a cloud native database program through a node recovery program, starting the cloud native database program based on the first text, starting the cloud native database program by using the backup file in the backup path as database data, and pulling up a single node cluster including the first cloud node according to the backup file.
Specifically, the backup data is mounted to a host directory of the first cloud node, a preset restoration command in the first text is rapidly executed according to the backup data, the backup data is restored to a preset cloud primary data path, and the single-node cluster is pulled up through a preset single-node cluster pulling-up command based on the restored backup data.
Step 304, if normal operation including the first cloud node is detected by the node recovery program, calling a database operation program in the first cloud node by the node recovery program, judging whether the second cloud node meets a preset node joining condition by the database operation program, if yes, establishing a static etcd service in the second cloud node by the database operation program, and joining the second cloud node into a single node cluster including the first cloud node to obtain a target double node cluster including the first cloud node and the second cloud node.
In the scheme, the cloud node recovery method suitable for the k8s native double-node cluster is provided, and automatic cloud node recovery is realized under the conditions of data synchronization instantaneity and no increase of service cost.
Fig. 4 is a schematic structural diagram of a cloud node recovery apparatus based on a dual-node cluster, where the apparatus may be implemented by software and/or hardware, and the apparatus may also be applied to a first cloud node, or integrated in an electronic device. As shown in fig. 4, the apparatus includes:
the backup module 401 is configured to, in a case of an interruption of connection between the first cloud node and the second cloud node, backup cloud primary data in the first cloud node if the first cloud node is a master node, so as to obtain backup data; the first cloud node and the second cloud node are two cloud nodes contained in an initial double-node cluster;
and an operation module 402, configured to establish a single node cluster including the first cloud node according to the backup data.
Optionally, the first cloud node and the second cloud node are both connected with a preset network device, and the method further includes:
the first determining module is configured to determine that the first cloud node is the master node if communication between the first cloud node and the preset network device is normal and communication abnormality information between the second cloud node and the preset network device is received;
and the second determining module is used for determining whether the first cloud node is the master node according to the preset node weight corresponding to the first cloud node if the communication between the first cloud node and the preset network equipment is normal and the communication normal information between the second cloud node and the preset network equipment is received.
Optionally, the backup module 401 is configured to:
and copying the cloud primary data under the preset cloud primary data path to a preset backup path through a node recovery program running in the first cloud node to obtain the backup data.
Optionally, the operation module 402 is configured to:
if the data volume of the backup data is kept unchanged within a preset duration, a preset recovery command is operated to restore the backup data to the preset cloud primary data path, and preset single-node cluster information in the preset recovery command is injected into the first cloud node;
and running a preset single-node cluster pull-up command to establish a single-node cluster containing the first cloud node based on the backup data and the preset single-node cluster information.
Optionally, the apparatus further includes:
the setting module is used for setting the first cloud node to be in a dormant state if the first cloud node is a slave node and generating node abnormality prompt information;
and the sending module is used for responding to the node recovery completion operation and sending the first recovery information to the second cloud node.
Optionally, the apparatus further includes:
and the joining module is used for joining the second cloud node into the single-node cluster to obtain a target double-node cluster comprising the first cloud node and the second cloud node if the second cloud node meets a preset node joining condition under the condition that second recovery information sent by the second cloud node is received after the single-node cluster comprising the first cloud node is established according to the backup data.
Optionally, the second cloud node meets a preset node joining condition, including: the node attribute of the second cloud node is a control role attribute, and the second cloud node does not join the node cluster.
The cloud node recovery device based on the dual-node cluster provided by the embodiment of the disclosure can execute the cloud node recovery method based on the dual-node cluster provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, electronic device 500 includes one or more processors 501 and memory 502.
The processor 501 may be a Central Processing Unit (CPU) or other form of processing unit having cloud node restoration capabilities and/or instruction execution capabilities based on a dual node cluster, and may control other components in the electronic device 500 to perform desired functions.
Memory 502 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that may be executed by the processor 501 to implement the dual node cluster-based cloud node restoration method of embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, and the like may also be stored in the computer-readable storage medium.
In one example, the electronic device 500 may further include: an input device 503 and an output device 504, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
In addition, the input device 503 may also include, for example, a keyboard, a mouse, and the like.
The output device 504 may output various information to the outside, including the determined distance information, direction information, and the like. The output device 504 may include, for example, a display, speakers, a printer, and a communication network and remote output apparatus connected thereto, etc.
Of course, only some of the components of the electronic device 500 that are relevant to the present disclosure are shown in fig. 5 for simplicity, components such as buses, input/output interfaces, etc. are omitted. In addition, the electronic device 500 may include any other suitable components depending on the particular application.
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the dual node cluster based cloud node recovery method provided by embodiments of the present disclosure.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Further, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the dual node cluster-based cloud node recovery method provided by embodiments of the present disclosure.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A cloud node recovery method based on a dual node cluster, which is applied to a first cloud node, the method comprising:
under the condition that connection between the first cloud node and the second cloud node is interrupted, if the first cloud node is a main node, the cloud primary data in the first cloud node are backed up, and backup data are obtained; the first cloud node and the second cloud node are two cloud nodes contained in an initial double-node cluster;
and establishing a single-node cluster containing the first cloud node according to the backup data.
2. The method of claim 1, wherein the first cloud node and the second cloud node are each connected to a preset network device, the method further comprising:
if the communication between the first cloud node and the preset network equipment is normal, and communication abnormality information between the second cloud node and the preset network equipment is received, determining that the first cloud node is the master node;
if the communication between the first cloud node and the preset network equipment is normal, and the communication normal information between the second cloud node and the preset network equipment is received, determining whether the first cloud node is the master node according to the preset node weight corresponding to the first cloud node.
3. The method of claim 1, wherein the backing up the cloud primary data in the first cloud node to obtain backup data comprises:
and copying the cloud primary data under the preset cloud primary data path to a preset backup path through a node recovery program running in the first cloud node to obtain the backup data.
4. The method of claim 1, wherein the establishing a single-node cluster including the first cloud node from the backup data comprises:
if the data volume of the backup data is kept unchanged within a preset duration, a preset recovery command is operated to restore the backup data to the preset cloud primary data path, and preset single-node cluster information in the preset recovery command is injected into the first cloud node;
and running a preset single-node cluster pull-up command to establish a single-node cluster containing the first cloud node based on the backup data and the preset single-node cluster information.
5. The method according to claim 1, wherein the method further comprises:
if the first cloud node is a slave node, setting the first cloud node to be in a dormant state, and generating node abnormality prompt information;
and responding to the node recovery completion operation, and sending first recovery information to the second cloud node.
6. The method of claim 1, wherein after the establishing a single-node cluster including the first cloud node from the backup data, the method further comprises:
under the condition that second recovery information sent by the second cloud node is received, if the second cloud node meets a preset node joining condition, the second cloud node is joined into the single-node cluster, and a target double-node cluster comprising the first cloud node and the second cloud node is obtained.
7. The method of claim 6, wherein the second cloud node satisfies a preset node joining condition, comprising:
the node attribute of the second cloud node is a control role attribute, and the second cloud node does not join the node cluster.
8. Cloud node recovery device based on dual node cluster, characterized in that is applied to first cloud node, includes:
the backup module is used for backing up the cloud primary data in the first cloud node to obtain backup data if the first cloud node is a master node under the condition that the connection between the first cloud node and the second cloud node is interrupted; the first cloud node and the second cloud node are two cloud nodes contained in an initial double-node cluster;
and the operation module is used for establishing a single-node cluster containing the first cloud node according to the backup data.
9. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the cloud node recovery method based on dual node clusters according to any one of claims 1-7.
10. A computer readable storage medium, characterized in that the storage medium stores a computer program for executing the cloud node recovery method based on dual node clusters according to any of the preceding claims 1-7.
CN202310928559.XA 2023-07-26 2023-07-26 Cloud node recovery method, device, equipment and medium based on double-node cluster Pending CN117201489A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310928559.XA CN117201489A (en) 2023-07-26 2023-07-26 Cloud node recovery method, device, equipment and medium based on double-node cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310928559.XA CN117201489A (en) 2023-07-26 2023-07-26 Cloud node recovery method, device, equipment and medium based on double-node cluster

Publications (1)

Publication Number Publication Date
CN117201489A true CN117201489A (en) 2023-12-08

Family

ID=88985826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310928559.XA Pending CN117201489A (en) 2023-07-26 2023-07-26 Cloud node recovery method, device, equipment and medium based on double-node cluster

Country Status (1)

Country Link
CN (1) CN117201489A (en)

Similar Documents

Publication Publication Date Title
TWI608419B (en) Method for pre-testing software compatibility and system thereof
KR102047216B1 (en) Replaying jobs at a secondary location of a service
US9158528B2 (en) Forcibly completing upgrade of distributed software in presence of failures
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
CN112100005B (en) Redis copy set implementation method and device
JPWO2017042890A1 (en) Database system, server device, program, and information processing method
US20120324436A1 (en) Method of updating versioned software using a shared cache
CN112380062A (en) Method and system for rapidly recovering system for multiple times based on system backup point
WO2023116425A1 (en) Wireless mesh network upgrade method and apparatus, and main node and storage medium
CN107623581B (en) Service list generation method, device and system, and acquisition and reporting method and device
CN113672263B (en) Firmware parameter updating control method and device and electronic equipment
CN114356711A (en) Database fault self-healing method, system and related device
CN112437119B (en) Distributed system upgrading method, device and node
CN111090537A (en) Cluster starting method and device, electronic equipment and readable storage medium
CN117201489A (en) Cloud node recovery method, device, equipment and medium based on double-node cluster
CN110708203A (en) Fault tolerance method, device and equipment
CN110874713A (en) Service state management method and device
CN101242201B (en) A master-slave system maintenance method, system and device
CN114968656A (en) Data rollback method, device, equipment and medium
TWI690849B (en) Method and device for upgrading and closing applications
CN112379973A (en) Heavy loading method and device
JP2012238083A (en) Database system, master slave management method, and master slave management program
CN111756562B (en) Cluster takeover method, system and related components
CN115550424B (en) Data caching method, device, equipment and storage medium
CN117033489A (en) Resource conversion method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination