CN114500525B - Method, device, computer equipment and medium for updating nodes in distributed system - Google Patents

Method, device, computer equipment and medium for updating nodes in distributed system Download PDF

Info

Publication number
CN114500525B
CN114500525B CN202111598322.7A CN202111598322A CN114500525B CN 114500525 B CN114500525 B CN 114500525B CN 202111598322 A CN202111598322 A CN 202111598322A CN 114500525 B CN114500525 B CN 114500525B
Authority
CN
China
Prior art keywords
node
cluster volume
nodes
priority
cluster
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.)
Active
Application number
CN202111598322.7A
Other languages
Chinese (zh)
Other versions
CN114500525A (en
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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202111598322.7A priority Critical patent/CN114500525B/en
Publication of CN114500525A publication Critical patent/CN114500525A/en
Application granted granted Critical
Publication of CN114500525B publication Critical patent/CN114500525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a method, a device, computer equipment and a medium for updating nodes in a distributed system, wherein the method can comprise the following steps: receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data; based on the updated state information of the first cluster volume, switching a first node in the first cluster volume to be a master node, wherein the master node is used as a program running node; and controlling the second nodes in the second cluster volume to be demoted into standby nodes, adding synchronous data in the first cluster volume, wherein the first nodes in the first cluster volume are in communication connection with the second nodes in the second cluster volume, and the second cluster volume comprises one or more second nodes. The invention updates the nodes in the distributed system step by step based on the main-standby node switching mode, avoids the dependence on manual operation of personnel, and is beneficial to avoiding the problem of asynchronous node updating.

Description

Method, device, computer equipment and medium for updating nodes in distributed system
Technical Field
The present invention relates to the technical field of distributed systems, and more particularly, to a method, an apparatus, a computer device, and a medium for updating a node in a distributed system.
Background
Currently, distributed technology is increasingly used. A distributed system is a collection of individual computers, like a large system for a user. The distributed system has the advantages of expandability, higher reliability and the like, but also has the defects of strong dependence of system performance reliability on a network, requirement of global clock, mutual independence of node updating and the like. Particularly, in the environment deployment test process of practical application, operations such as version update and service restarting are often needed to be performed on each node, so that the problems of complex operation and large dependence on manual operation exist, and the problems of asynchronous node update and the like often occur, and the problem needs to be solved.
Disclosure of Invention
In order to solve the problems that the conventional distributed system node update has complex operation, excessive dependence on manual operation, asynchronous node update and the like, the invention can provide a method, a device, computer equipment and a medium for node update in a distributed system so as to solve at least one problem in the prior art.
To achieve the above technical object, the present invention discloses a method for updating nodes in a distributed system, which may include, but is not limited to, one or more of the following steps.
Receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data.
And switching a first node in the first cluster volume to be a master node based on the updated state information of the first cluster volume, wherein the master node is used as a program running node.
And controlling a second node in a second cluster volume to be demoted to a standby node, and adding synchronous data in a first cluster volume, wherein the first node in the first cluster volume is in communication connection with the second node in the second cluster volume, and the second cluster volume comprises one or more second nodes.
Further, the switching the first node in the first cluster volume to be the master node includes:
and controlling the first node to be added into the second cluster volume, and enabling the first node to serve as a program running node.
Further, the switching the first node in the first cluster volume to be the master node includes:
switching the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority.
Further, the controlling the second node in the second cluster volume to demote to the standby node and adding the synchronization data in the first cluster volume includes:
and controlling the second node to be added into the first cluster volume so as to synchronize the received updated data into the second node.
Further, after the second node in the second cluster volume is downgraded to a standby node and synchronous data in the first cluster volume is added, the method further comprises:
and obtaining update parameter values of all second nodes in the second cluster volume, wherein the update parameter values are used for indicating whether the second nodes are updated or not.
And performing exclusive OR operation on the updated parameter values of all the second nodes to obtain an operation result.
Determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or determining that all second nodes in the second cluster volume are updated according to the operation result being 0.
Further, the first cluster volume and the second cluster volume are storage cluster volumes, and the first node and the second node are in communication connection based on a survival detection mechanism.
In order to achieve the above technical purpose, the present invention also provides a device for updating a node in a distributed system, where the device for updating a node in a distributed system specifically includes, but is not limited to, an update data receiving module, a node active/standby switching module, and an update data synchronization module.
The updating data receiving module is used for receiving updating data of a first node in the first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data.
The node master-slave switching module is used for switching a first node in a first cluster volume to be a master node based on the state information of the first cluster volume, and the master node is used as a program running node.
The updating data synchronization module is used for controlling a second node in a second cluster volume to be downgraded into a standby node and adding synchronous data in a first cluster volume, wherein the first node in the first cluster volume is in communication connection with the second node in the second cluster volume, and the second cluster volume comprises one or more second nodes.
To achieve the above object, the present invention also provides a computer device including a memory and a processor, the memory storing computer readable instructions that, when executed by the processor, cause the processor to perform the steps of the method for node update in the distributed system according to any of the embodiments of the present invention.
To achieve the above technical object, the present invention also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of a method for node update in a distributed system according to any embodiment of the present invention.
To achieve the above technical object, the present invention also provides a computer program product, which when executed by a processor, performs the steps of the method for node update in a distributed system according to any of the embodiments of the present invention.
The beneficial effects of the invention are as follows: the invention can ensure that the nodes in the distributed system are gradually updated based on the mode of switching the active and standby nodes while the nodes normally provide services outwards, thereby avoiding the dependence on manual operation of personnel and being beneficial to avoiding the problem of asynchronous updating of the nodes. The method for updating the nodes in the distributed system can effectively simplify the test deployment process of the distributed system. The technical scheme for updating the distributed system nodes can be applied to distributed system testing and operation and maintenance, so that the testing efficiency is greatly improved. In addition, the invention can avoid the problem that the load balancing system calls the nodes which are not updated by the priority configuration in the case that part of nodes are updated and part of nodes are not updated in the updating process of the distributed system, and avoid the occurrence of the asynchronous condition, so that the nodes accessed by the user equipment are necessarily updated nodes.
Drawings
FIG. 1 illustrates a flow diagram of a method for node update in a distributed system in accordance with one or more embodiments of the invention.
FIG. 2 illustrates a distributed system environment deployment architecture diagram in one or more embodiments of the invention.
FIG. 3 illustrates a schematic diagram of a distributed system node update asynchronization scenario in one or more embodiments of the present invention.
FIG. 4 is a schematic diagram illustrating the apparatus composition of node updates in a distributed system in accordance with one or more embodiments of the present invention.
FIG. 5 illustrates a schematic diagram of the internal architecture of a computer in one or more embodiments of the invention.
Detailed Description
The method, the device, the computer equipment and the medium for updating the nodes in the distributed system provided by the invention are explained and illustrated in detail below with reference to the attached drawings.
Aiming at the problems that the node update is needed to be manually carried out, the operation is time-consuming and labor-consuming and the node update is easy to be asynchronous in the existing distributed system test and operation work, one or more embodiments of the invention can provide a method for the node update in the distributed system so as to solve the technical problems.
As shown in fig. 1, the method for updating a node in a distributed system provided by the present invention may include, but is not limited to, one or more of the following steps.
Firstly, receiving update data of a first node in a first cluster volume; the first node is a standby node, the first cluster volume includes one or more first nodes, and the update data includes at least one of a file, program data, and the like, which is not limited thereto.
As shown in fig. 2 and 3, the nodes in the first cluster volume are Storage (Storage) groups that need to be synchronized, and the nodes in the second cluster volume are used as program running nodes in an initial state. The first cluster volume may include, but is not limited to, node 1-1, node 2-2, node 3-3, etc., with node 1-1, node 2-2, node 3-3 shown in the figure being standby nodes in an initial state. In this embodiment, the nodes in the first cluster volume are cold standby nodes, and synchronization is automatically performed when there is a file update. The second cluster volume may include, but is not limited to, node 1, node 2, node 3, etc., with node 1, node 2, node 3 shown in the figure being the primary node in the initial state.
In the embodiment of the present invention, node 1 in the second cluster volume and node 1-1 of the first cluster volume in the illustration are in communication connection based on a survival detection (keep alive) mechanism, node 2 in the second cluster volume and node 2-2 of the first cluster volume are in communication connection based on a survival detection (keep alive) mechanism, node 3 in the second cluster volume and node 3-3 of the first cluster volume are in communication connection based on a survival detection (keep alive) mechanism, … …, and node n in the second cluster volume and node n-n of the first cluster volume are in communication connection based on a survival detection (keep alive) mechanism.
And secondly, based on the state information of the first cluster volume being updated, switching the first node in the first cluster volume to be a master node, wherein the master node is used as a program running node. Specifically, the embodiment may determine that the state information of the first cluster volume is updated according to the timestamp information and/or the offset position information. The offset location information in the present embodiment may be, for example, offset location information in a binary log file (e.g., binlog), but is not limited thereto.
Optionally, if the state information of the first cluster volume is updated, the switching the first node in the first cluster volume to the master node according to the embodiment may include: the first node is controlled to join the second cluster volume, as shown by the updated node 1-1 joining the second cluster volume, and the first node is made to function as a program running node. Specifically, after the preset waiting time, if the node related programs in the first cluster volume are started, stopping all the programs on the remaining nodes in the second cluster volume so as to perform synchronization.
Optionally, switching the first node in the first cluster volume to the master node in this embodiment includes: switching the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority, where the first priority may be denoted as n+t, the second priority may be denoted as N, and the third priority may be denoted as N-t. Specifically, in the embodiment of the invention, the priority +2t is set for the newly started program, and the priorities of the master node and the standby node are separated by t; taking fig. 3 as an example, in the initial state, the priority of the node 1 serving as the master node is N, the priority of the node 1-1 serving as the standby node is N-t, after the first node is switched to the master node, the priority of the node 1-1 is updated to n+t, that is, the node 1-1 is higher than the node 1 which is not updated at the moment when the first node is switched to the first priority from the initial third priority, so as to avoid the problem that the node which is not updated is called, when a load balancing system calls a related program, the node with the higher priority is selected to be called, and at the moment, the node 1-1 with the higher priority is called in preference to the node 1.
And finally, controlling the second nodes in the second cluster volume to be demoted into standby nodes, adding synchronous data in the first cluster volume, wherein the first nodes in the first cluster volume are in communication connection with the second nodes in the second cluster volume, and the second cluster volume comprises one or more second nodes. In the embodiment of the invention, the first cluster volume and the second cluster volume are both storage cluster volumes, and the first node and the second node can be in communication connection based on a survival detection mechanism. Embodiments of the present invention may synchronize and manage distributed system files with file synchronization tools (e.g., fastDFS, etc.), although not limited thereto.
Optionally, controlling the second node in the second cluster volume to be downgraded to the standby node and adding the synchronization data in the first cluster volume includes: and controlling the second node to be added into the first cluster volume so as to synchronize the received updated data to the second node, thereby realizing the aim that the second node is synchronized.
Optionally, after the second node in the second cluster volume is controlled to be downgraded to a standby node and synchronous data in the first cluster volume is added, the embodiment of the present invention further includes the following steps:
Update parameter values are obtained for all second nodes in the second cluster volume, the update parameter values being usable to indicate whether the second nodes are updated. In this embodiment, the update parameter value of the first node of the first cluster volume is initially set to 00000001, the update parameter value of the second node of the second cluster volume is initially set to 00000010, and after the first node in the first cluster volume is added to the second cluster volume after one version update, the update parameter value of the first node becomes 00000011=00000001+00000010, that is, a new update parameter value is obtained by accumulating the update parameter values. It can be seen that the embodiment of the present invention adopts a manner of accumulating updated parameter values, and by this accumulating manner, the present invention can obtain version update times and states according to the latest obtained parameter values, that is, directly determine update times and current states according to the updated parameter values.
In addition, the embodiment of the invention can also carry out exclusive OR operation on the update parameter values of all the second nodes in the second cluster volume so as to obtain an operation result. Based on the operation result, the method and the device can determine whether all nodes in the cluster volume are updated.
According to the invention, according to the operation result not being 0, the update parameter value of the node existing in the current cluster volume is different from other nodes, and the second node which is not updated exists in the second cluster volume is determined; or according to the operation result of 0, indicating that the update parameter values of all the nodes of the current cluster volume are the same, and determining that all the second nodes in the second cluster volume are updated. In addition, the invention is based on the characteristic that the distributed system has strong dependence on the network, and can also detect the status of the nodes which may have abnormality after automatic updating; for nodes with abnormal states, the invention can output and prompt.
The invention can lead the node of the distributed system to have higher automation and intelligent degree in version updating and other aspects, and after the related personnel select any node to update, the invention automatically completes the updating of other nodes in the distributed system, thereby greatly improving the deployment efficiency and greatly saving the time cost and the manpower maintenance resource cost; the method is simpler in judging the synchronous state by setting the node priority strategy, particularly a 2t interval method, is very suitable for the condition that the number of nodes of the distributed system is large, and can enable the distributed system to realize capacity expansion more easily.
As shown in fig. 4, the method for updating a node in a distributed system according to the embodiment of the present invention is based on the same technical concept of the present invention, and one or more embodiments of the present invention can provide an apparatus for updating a node in a distributed system.
The node updating device in the distributed system may include, but is not limited to, an update data receiving module, a node active-standby switching module, and an update data synchronizing module, which are described in detail below.
The updating data receiving module is used for receiving updating data of a first node in the first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data.
Optionally, the first cluster volume and the second cluster volume in one or more embodiments of the invention are both storage cluster volumes.
The node master-slave switching module is used for switching a first node in the first cluster volume to be a master node based on the state information of the first cluster volume, and the master node is used as a program running node.
Optionally, the node primary-standby switching module is configured to control the first node to join the second cluster volume, and is configured to make the first node function as a program running node.
Optionally, the node active-standby switching module is configured to switch the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority.
And the updating data synchronization module is used for controlling the second node in the second cluster volume to be demoted into the standby node and adding synchronous data in the first cluster volume, wherein the first node in the first cluster volume is in communication connection with the second node in the second cluster volume, and the second cluster volume comprises one or more second nodes.
Optionally, the first node and the second node in one or more embodiments of the present invention are communicatively connected based on a survival detection mechanism.
Optionally, the update data synchronization module is configured to control the second node to join the first cluster volume, for synchronizing the received update data to the second node.
Optionally, the update data synchronization module of the present invention can be further configured to obtain update parameter values of all second nodes in the second cluster volume, where the update parameter values are used to indicate whether the second nodes are updated. The updating data synchronization module is used for carrying out exclusive or operation on updating parameter values of all the second nodes so as to obtain an operation result; the updating data synchronization module is used for determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or the updating data synchronization module is used for determining that all the second nodes in the second cluster volume are updated according to the operation result of 0.
As shown in fig. 5, the method for updating a node in the distributed system according to the embodiment of the present invention is based on the same technical concept of the present invention, and one or more embodiments of the present invention can also provide a computer device. The computer device includes a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the steps of the method of node update in a distributed system in any of the embodiments of the present invention. The method for updating the nodes in the distributed system can comprise the following steps: firstly, receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data. And secondly, based on the state information of the first cluster volume being updated, switching the first node in the first cluster volume to be a master node, wherein the master node is used as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: and controlling the first node to be added into the second cluster volume, and enabling the first node to serve as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: switching the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority. And finally, controlling the second nodes in the second cluster volume to be demoted into standby nodes, adding synchronous data in the first cluster volume, wherein the first nodes in the first cluster volume are in communication connection with the second nodes in the second cluster volume, and the second cluster volume comprises one or more second nodes. In the embodiment of the invention, the first cluster volume and the second cluster volume are both storage cluster volumes, and the first node and the second node are in communication connection based on a survival detection mechanism. Optionally, controlling the second node in the second cluster volume to be downgraded to the standby node and adding the synchronization data in the first cluster volume includes: the second node is controlled to join the first cluster volume to synchronize the received update data to the second node. Optionally, after the second node in the second cluster volume is controlled to be downgraded to a standby node and synchronous data in the first cluster volume is added, the embodiment of the present invention further includes: acquiring update parameter values of all second nodes in the second cluster volume, wherein the update parameter values are used for indicating whether the second nodes are updated or not; performing exclusive OR operation on the updated parameter values of all the second nodes to obtain an operation result; determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or determining that all second nodes in the second cluster volume are updated according to the operation result of 0.
As shown in fig. 5, the method for updating a node in a distributed system according to an embodiment of the present invention is based on the same technical concept of the present invention, and one or more embodiments of the present invention may further provide a storage medium storing computer readable instructions, where the computer readable instructions when executed by one or more processors cause the one or more processors to perform the steps of the method for updating a node in a distributed system according to any embodiment of the present invention. The method for updating the nodes in the distributed system can comprise the following steps: firstly, receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data. And secondly, based on the state information of the first cluster volume being updated, switching the first node in the first cluster volume to be a master node, wherein the master node is used as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: and controlling the first node to be added into the second cluster volume, and enabling the first node to serve as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: switching the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority. And finally, controlling the second nodes in the second cluster volume to be demoted into standby nodes, adding synchronous data in the first cluster volume, wherein the first nodes in the first cluster volume are in communication connection with the second nodes in the second cluster volume, and the second cluster volume comprises one or more second nodes. In the embodiment of the invention, the first cluster volume and the second cluster volume are both storage cluster volumes, and the first node and the second node are in communication connection based on a survival detection mechanism. Optionally, controlling the second node in the second cluster volume to be downgraded to the standby node and adding the synchronization data in the first cluster volume includes: the second node is controlled to join the first cluster volume to synchronize the received update data to the second node. Optionally, after the second node in the second cluster volume is controlled to be downgraded to a standby node and synchronous data in the first cluster volume is added, the embodiment of the present invention further includes: acquiring update parameter values of all second nodes in the second cluster volume, wherein the update parameter values are used for indicating whether the second nodes are updated or not; performing exclusive OR operation on the updated parameter values of all the second nodes to obtain an operation result; determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or determining that all second nodes in the second cluster volume are updated according to the operation result of 0.
One or more embodiments of the present invention can also provide a computer program product that, when executed by a processor, performs the steps of the method for node update in a distributed system according to any of the embodiments of the present invention. The method for updating the nodes in the distributed system can comprise the following steps: firstly, receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data. And secondly, based on the state information of the first cluster volume being updated, switching the first node in the first cluster volume to be a master node, wherein the master node is used as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: and controlling the first node to be added into the second cluster volume, and enabling the first node to serve as a program running node. Optionally, switching the first node in the first cluster volume to the master node according to the embodiment of the present invention includes: switching the called priority of the first node from the initial third priority to the first priority; the called priority of the second node is a second priority, the first priority is higher than the second priority, and the second priority is higher than the third priority. And finally, controlling the second nodes in the second cluster volume to be demoted into standby nodes, adding synchronous data in the first cluster volume, wherein the first nodes in the first cluster volume are in communication connection with the second nodes in the second cluster volume, and the second cluster volume comprises one or more second nodes. In the embodiment of the invention, the first cluster volume and the second cluster volume are both storage cluster volumes, and the first node and the second node are in communication connection based on a survival detection mechanism. Optionally, controlling the second node in the second cluster volume to be downgraded to the standby node and adding the synchronization data in the first cluster volume includes: the second node is controlled to join the first cluster volume to synchronize the received update data to the second node. Optionally, after the second node in the second cluster volume is controlled to be downgraded to a standby node and synchronous data in the first cluster volume is added, the embodiment of the present invention further includes: acquiring update parameter values of all second nodes in the second cluster volume, wherein the update parameter values are used for indicating whether the second nodes are updated or not; performing exclusive OR operation on the updated parameter values of all the second nodes to obtain an operation result; determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or determining that all second nodes in the second cluster volume are updated according to the operation result of 0.
Based on the technical scheme provided by the invention, the nodes in the distributed system are gradually updated based on the mode of switching the active and standby nodes, the dependence on manual operation of personnel is avoided, and the problem of asynchronous node updating is also solved. Therefore, the method for updating the nodes in the distributed system effectively simplifies the test deployment process of the distributed system. The technical scheme for updating the distributed system nodes can be applied to distributed system testing and operation and maintenance so as to greatly improve the testing efficiency of the distributed system. In addition, the invention avoids the problem that the load balancing system calls the nodes which are not updated through the configuration of the priority strategy, avoids the occurrence of the asynchronous condition and ensures that the nodes accessed by the user equipment are the latest nodes in the case that part of the nodes are updated and part of the nodes are not updated in the updating process of the distributed system.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection (electronic device) with one or more wires, a portable computer cartridge (magnetic device), a random access Memory (RAM, random Access Memory), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (EPROM, erasable Programmable Read-Only Memory, or flash Memory), an optical fiber device, and a portable compact disc Read-Only Memory (CDROM, compact Disc Read-Only Memory). In addition, the computer-readable storage medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable gate arrays (PGA, programmable GATE ARRAY), field Programmable gate arrays (FPGA, field Programmable GATE ARRAY), and the like.
In the description of the present specification, a description referring to the terms "present embodiment," "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
The above description is only of the preferred embodiments of the present invention, and is not intended to limit the invention, but any modifications, equivalents, and simple improvements made within the spirit of the present invention should be included in the scope of the present invention.

Claims (8)

1. A method for updating nodes in a distributed system, comprising:
Receiving update data of a first node in a first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data;
Based on the state information of the first cluster volume being updated, switching a first node in the first cluster volume to be a master node comprises: switching the called priority of the first node from an initial third priority to a first priority, wherein the called priority of the second node is a second priority, the first priority is higher than the second priority, the second priority is higher than the third priority, the first priority is expressed as N+t, the second priority is expressed as N, the third priority is expressed as N-t, the called priority of the main node is N in an initial state, the called priority of the standby node is N-t, and the main node is used as a program running node;
And controlling a second node in a second cluster volume to be demoted to a standby node, and adding synchronous data in a first cluster volume, wherein the first node in the first cluster volume is in communication connection with the second node in the second cluster volume, and the second cluster volume comprises one or more second nodes.
2. The method of node update in a distributed system according to claim 1, wherein said switching a first node in the first cluster volume to be a master node comprises:
and controlling the first node to be added into the second cluster volume, and enabling the first node to serve as a program running node.
3. The method of claim 1, wherein controlling the demotion of the second node in the second cluster volume to the standby node and joining the synchronization data in the first cluster volume comprises:
and controlling the second node to be added into the first cluster volume so as to synchronize the received updated data into the second node.
4. The method of claim 1 or 2, further comprising, after said controlling the second node in the second cluster volume to demote to a standby node and join the synchronization data in the first cluster volume:
Obtaining update parameter values of all second nodes in the second cluster volume, wherein the update parameter values are used for indicating whether the second nodes are updated or not;
performing exclusive OR operation on the updated parameter values of all the second nodes to obtain an operation result;
Determining that a second node which is not updated exists in the second cluster volume according to the operation result which is not 0; or determining that all second nodes in the second cluster volume are updated according to the operation result being 0.
5. The method of claim 1, wherein the first cluster volume and the second cluster volume are storage cluster volumes, and wherein the first node and the second node are communicatively connected based on a survival detection mechanism.
6. An apparatus for updating nodes in a distributed system, comprising:
the updating data receiving module is used for receiving updating data of a first node in the first cluster volume; the first nodes are standby nodes, the first cluster volume comprises one or more first nodes, and the update data comprises at least one of files and program data;
The node master-slave switching module is used for switching a first node in a first cluster volume to be a master node based on the state information of the first cluster volume, and the master node is used as a program running node; the node master-slave switching module is used for switching the called priority of the first node from an initial third priority to a first priority, the called priority of the second node is a second priority, the first priority is higher than the second priority, the second priority is higher than the third priority, wherein the first priority is expressed as n+t, the second priority is expressed as N, the third priority is expressed as N-t, the called priority of the master node is N in an initial state, and the called priority of the slave node is N-t;
The updating data synchronization module is used for controlling a second node in a second cluster volume to be downgraded into a standby node and adding synchronous data in a first cluster volume, wherein the first node in the first cluster volume is in communication connection with the second node in the second cluster volume, and the second cluster volume comprises one or more second nodes.
7. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method of node update in a distributed system as claimed in any one of claims 1 to 5.
8. A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of node update in a distributed system as claimed in any one of claims 1 to 5.
CN202111598322.7A 2021-12-24 2021-12-24 Method, device, computer equipment and medium for updating nodes in distributed system Active CN114500525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111598322.7A CN114500525B (en) 2021-12-24 2021-12-24 Method, device, computer equipment and medium for updating nodes in distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111598322.7A CN114500525B (en) 2021-12-24 2021-12-24 Method, device, computer equipment and medium for updating nodes in distributed system

Publications (2)

Publication Number Publication Date
CN114500525A CN114500525A (en) 2022-05-13
CN114500525B true CN114500525B (en) 2024-04-26

Family

ID=81497035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111598322.7A Active CN114500525B (en) 2021-12-24 2021-12-24 Method, device, computer equipment and medium for updating nodes in distributed system

Country Status (1)

Country Link
CN (1) CN114500525B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741894A (en) * 2008-11-26 2010-06-16 中国移动通信集团公司 Upgrade method for distributed system and upgrade scheduling node and system
CN102025756A (en) * 2009-09-09 2011-04-20 中兴通讯股份有限公司 Distributed system and data synchronization method thereof
CN102811136A (en) * 2011-06-01 2012-12-05 南京中兴新软件有限责任公司 Software upgrading system and method
WO2012172234A1 (en) * 2011-06-17 2012-12-20 Bull Sas Method, device, and computer program for the software update of clusters optimizing the availability of said clusters
JP5238915B1 (en) * 2012-08-23 2013-07-17 ディジタル・ワークス株式会社 Distributed database system
CN104281631A (en) * 2013-07-12 2015-01-14 中兴通讯股份有限公司 Distributed database system and data synchronization method and nodes thereof
CN106557543A (en) * 2016-10-14 2017-04-05 深圳前海微众银行股份有限公司 Node switching method and system
CN109165230A (en) * 2018-09-11 2019-01-08 郑州云海信息技术有限公司 A kind of method, device and equipment that distributed type assemblies management software data are synchronous
CN109240724A (en) * 2018-09-12 2019-01-18 京信通信系统(中国)有限公司 A kind of cascade device upgrade method and equipment
CN109634638A (en) * 2018-12-17 2019-04-16 郑州云海信息技术有限公司 A kind of clustered software upgrade method, device, equipment and medium
CN110636128A (en) * 2019-09-20 2019-12-31 苏州浪潮智能科技有限公司 Data synchronization method, system, electronic equipment and storage medium
US10567500B1 (en) * 2015-12-21 2020-02-18 Amazon Technologies, Inc. Continuous backup of data in a distributed data store
CN111611109A (en) * 2020-05-22 2020-09-01 苏州浪潮智能科技有限公司 Backup method, system, device and medium for distributed cluster
CN112437119A (en) * 2020-11-05 2021-03-02 新华三大数据技术有限公司 Distributed system upgrading method, device and node
CN113014634A (en) * 2021-02-20 2021-06-22 成都新希望金融信息有限公司 Cluster election processing method, device, equipment and storage medium
CN113127565A (en) * 2021-04-28 2021-07-16 联通沃音乐文化有限公司 Method and device for synchronizing distributed database nodes based on external observer group
WO2021217849A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Blockchain node synchronization method, apparatus and device, and storage medium
CN113805925A (en) * 2021-09-27 2021-12-17 济南浪潮数据技术有限公司 Online upgrading method, device, equipment and medium for distributed cluster management software

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101927321B1 (en) * 2012-04-02 2018-12-10 엘지전자 주식회사 Upgradeable display device and the method for controlling the same
US8935689B2 (en) * 2012-08-13 2015-01-13 International Business Machines Corporation Concurrent embedded application update and migration

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741894A (en) * 2008-11-26 2010-06-16 中国移动通信集团公司 Upgrade method for distributed system and upgrade scheduling node and system
CN102025756A (en) * 2009-09-09 2011-04-20 中兴通讯股份有限公司 Distributed system and data synchronization method thereof
CN102811136A (en) * 2011-06-01 2012-12-05 南京中兴新软件有限责任公司 Software upgrading system and method
WO2012172234A1 (en) * 2011-06-17 2012-12-20 Bull Sas Method, device, and computer program for the software update of clusters optimizing the availability of said clusters
JP5238915B1 (en) * 2012-08-23 2013-07-17 ディジタル・ワークス株式会社 Distributed database system
CN104281631A (en) * 2013-07-12 2015-01-14 中兴通讯股份有限公司 Distributed database system and data synchronization method and nodes thereof
US10567500B1 (en) * 2015-12-21 2020-02-18 Amazon Technologies, Inc. Continuous backup of data in a distributed data store
CN106557543A (en) * 2016-10-14 2017-04-05 深圳前海微众银行股份有限公司 Node switching method and system
CN109165230A (en) * 2018-09-11 2019-01-08 郑州云海信息技术有限公司 A kind of method, device and equipment that distributed type assemblies management software data are synchronous
CN109240724A (en) * 2018-09-12 2019-01-18 京信通信系统(中国)有限公司 A kind of cascade device upgrade method and equipment
CN109634638A (en) * 2018-12-17 2019-04-16 郑州云海信息技术有限公司 A kind of clustered software upgrade method, device, equipment and medium
CN110636128A (en) * 2019-09-20 2019-12-31 苏州浪潮智能科技有限公司 Data synchronization method, system, electronic equipment and storage medium
WO2021217849A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Blockchain node synchronization method, apparatus and device, and storage medium
CN111611109A (en) * 2020-05-22 2020-09-01 苏州浪潮智能科技有限公司 Backup method, system, device and medium for distributed cluster
CN112437119A (en) * 2020-11-05 2021-03-02 新华三大数据技术有限公司 Distributed system upgrading method, device and node
CN113014634A (en) * 2021-02-20 2021-06-22 成都新希望金融信息有限公司 Cluster election processing method, device, equipment and storage medium
CN113127565A (en) * 2021-04-28 2021-07-16 联通沃音乐文化有限公司 Method and device for synchronizing distributed database nodes based on external observer group
CN113805925A (en) * 2021-09-27 2021-12-17 济南浪潮数据技术有限公司 Online upgrading method, device, equipment and medium for distributed cluster management software

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
储佳佳 ; 郭进伟 ; 刘柏众 ; 张晨东 ; 钱卫宁 ; .高可用数据库系统中的分布式一致性协议.华东师范大学学报(自然科学版).(第05期),全文. *
基于无线IAP的工业嵌入式系统升级技术应用;彭亮;沈安文;张宁;周立峰;;仪表技术与传感器(第12期);全文 *
彭亮 ; 沈安文 ; 张宁 ; 周立峰 ; .基于无线IAP的工业嵌入式系统升级技术应用.仪表技术与传感器.2013,(第12期),全文. *
高可用数据库系统中的分布式一致性协议;储佳佳;郭进伟;刘柏众;张晨东;钱卫宁;;华东师范大学学报(自然科学版)(第05期);全文 *

Also Published As

Publication number Publication date
CN114500525A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US11320991B2 (en) Identifying sub-health object storage devices in a data storage system
CN107526659B (en) Method and apparatus for failover
CN111049928B (en) Data synchronization method, system, electronic device and computer readable storage medium
EP3979574A1 (en) Method and device for implementing rerouting
CN114064414A (en) High-availability cluster state monitoring method and system
EP3817290A1 (en) Member change method for distributed system, and distributed system
CN112052230B (en) Multi-machine room data synchronization method, computing device and storage medium
CN112256433A (en) Partition migration method and device based on Kafka cluster
CN115373799A (en) Cluster management method and device and electronic equipment
CN114500525B (en) Method, device, computer equipment and medium for updating nodes in distributed system
CN115291891A (en) Cluster management method and device and electronic equipment
CN114244735A (en) Main/standby operation switching method and device and storage medium
CN115905270B (en) Method and device for determining active data nodes in database and storage medium
CN110837451B (en) Processing method, device, equipment and medium for high availability of virtual machine
CN116155957B (en) Operation method and device of sorting machine control program and electronic equipment
CN112035174B (en) Method, apparatus and computer storage medium for running web service
CN114064795A (en) Data synchronization method and device, electronic equipment and storage medium
CN113225201B (en) Information synchronization method and device
WO2021031757A1 (en) Relay configuration method and device for optical network, and computer-readable storage medium
CN117290160A (en) Backup method, storage medium and equipment for database read-write separation cluster
CN117520053A (en) Database system management method and device based on master-slave replication protocol
CN117950875A (en) Service method, device, equipment and storage medium for cluster
CN116775601A (en) Database migration method and device, electronic equipment and storage medium
CN116233155A (en) Hybrid cloud data synchronization method and device, electronic equipment and storage medium
CN116431594A (en) Data storage method and device and computer readable storage 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
GR01 Patent grant
GR01 Patent grant