Data synchronization method, device, equipment, medium and product in cluster system

By introducing management nodes, arbitration nodes and non-arbitration nodes into the cluster system, checksum synchronization of configuration files are solved, and the problems of configuration files consistency and management in distributed cluster systems are achieved, and unified, accurate and synchronous management of configuration files is achieved.

CN119420769BActive Publication Date: 2025-04-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202412000318.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In a distributed cluster system, how to ensure the correct modification of configuration files and the consistency of configuration files of each member node is an urgent problem.

Method used

By introducing management nodes, arbitration nodes and non-arbitration nodes into the cluster system, the management node obtains the target configuration file and issues it to the arbitration node. The arbitration node feedbacks the configuration file verification value, the management node determines the standard verification value and the legal arbitration node, and uses the configuration files in the legal arbitration node to synchronize data.

Benefits of technology

The validity synchronization of configuration files between member nodes in the cluster system is realized, ensuring unified, accurate and synchronous management of configuration files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420769B_ABST
    Figure CN119420769B_ABST
Patent Text Reader

Abstract

The present invention discloses a data synchronization method, device, equipment, medium and product in a cluster system, which are applied to the technical field of cluster synchronization and are used to solve the problems of unsynchronized configuration files and / or inaccurate configuration file modification between member nodes in the cluster system in the traditional technology. The cluster system includes a management node, an arbitration node and a non-arbitration node. The method is applied to the management node and includes: obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system; receiving a configuration file check value fed back by each arbitration node based on the target configuration file; determining a standard check value according to each configuration file check value and determining a legal arbitration node having the standard check value; and synchronizing data of other arbitration nodes and non-arbitration nodes using the target configuration file in the legal arbitration node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cluster synchronization technology, and in particular to a data synchronization method in a cluster system, and also to a data synchronization device, electronic equipment, computer-readable storage medium and computer program product in a cluster system. Background Art

[0002] Configuration files are a type of file used to define software parameters and behaviors. These parameters may include the software's interface theme, language settings, network configuration, performance optimization, etc. During the software startup phase, the content in the configuration file can be called and run according to the values ​​set for each parameter.

[0003] At present, traditional single-node services do not need to consider the collaboration between nodes, but as the business puts forward higher and higher requirements on reliability, scalability, and resource volume, distributed architecture is gradually being widely used. In most distributed systems, by default, the configuration files of each member are edited separately and then distributed uniformly with the help of distribution tools. However, the synchronization mechanism of the member nodes of most distributed systems ends here. However, in terms of configuration file modification and cluster maintenance, there are the following problems: first, how to ensure that the configuration files are modified correctly, and second, how to ensure the consistency of the configuration files of each member node in the distributed cluster.

[0004] Therefore, how to achieve unified, accurate and synchronous configuration file management in a cluster system is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] An object of the present invention is to provide a data synchronization method in a cluster system, which can realize unified, accurate and synchronized configuration file management within the cluster system; another object of the present invention is to provide a data synchronization device, electronic device, computer-readable storage medium and computer program product in a cluster system, all of which have the above-mentioned beneficial effects.

[0006] In a first aspect, the present invention provides a data synchronization method in a cluster system, the cluster system comprising a management node, an arbitration node and a non-arbitration node, the method being applied to the management node and comprising:

[0007] Obtaining a target configuration file, and sending the target configuration file to each arbitration node in the cluster system;

[0008] receiving a configuration file verification value fed back by each arbitration node based on the target configuration file;

[0009] Determine a standard check value according to each of the configuration file check values, and determine a legitimate arbitration node having the standard check value;

[0010] The target configuration file in the legal arbitration node is used to synchronize data with other arbitration nodes and non-arbitration nodes.

[0011] Wherein, determining the standard check value according to each of the configuration file check values ​​includes:

[0012] Comparing and analyzing the check values ​​of the configuration files, and determining the check value of the configuration file with the largest number;

[0013] The configuration file verification value with the largest number is used as the standard verification value.

[0014] After sending the target configuration file to each arbitration node in the cluster system, the method further includes:

[0015] Calculate a calibration reference value according to the target configuration file;

[0016] Accordingly, determining a standard check value according to each of the configuration file check values ​​includes:

[0017] The configuration file verification value that is consistent with the verification reference value is used as the standard verification value.

[0018] The calibration reference value is calculated according to the target configuration file, including:

[0019] Calculate the target configuration file using a message digest algorithm to obtain an MD5 value, and use the MD5 value as the verification reference value;

[0020] Alternatively, a hash value is obtained by calculating the target configuration file using a hash algorithm, and the hash value is used as the verification reference value.

[0021] The step of synchronizing data of other arbitration nodes using the target configuration file in the legal arbitration node includes:

[0022] The legal arbitration node list is sent to the other arbitration nodes, so that the other arbitration nodes send a data synchronization request to any legal arbitration node according to the legal arbitration node list, and receive a target configuration file fed back by the legal arbitration node based on the data synchronization request.

[0023] After obtaining the target configuration file, the following steps are also included:

[0024] Sending the target configuration file to each of the non-arbitration nodes;

[0025] Accordingly, data synchronization is performed on each of the non-arbitration nodes using the target configuration file in the legal arbitration node, including:

[0026] Sending a verification request to each of the non-arbitration nodes, so that each of the non-arbitration nodes feeds back a configuration file verification value corresponding to the target configuration file to the management node;

[0027] The non-arbitration node whose configuration file check value is inconsistent with the standard check value is used as a node to be synchronized;

[0028] Data synchronization is performed on each of the nodes to be synchronized using the target configuration file in the legal arbitration node.

[0029] The step of performing data synchronization on each of the nodes to be synchronized by using the target configuration file in the legal arbitration node includes:

[0030] A list of legal arbitration nodes is sent to each of the nodes to be synchronized, so that each of the nodes to be synchronized sends a data synchronization request to any of the legal arbitration nodes according to the list of legal arbitration nodes, and receives a target configuration file fed back by the legal arbitration node based on the data synchronization request.

[0031] Before synchronizing the data of each of the nodes to be synchronized using the target configuration file in the legal arbitration node, the method further includes:

[0032] Sending a clearing request to each of the nodes to be synchronized, so that each of the nodes to be synchronized deletes the target configuration file sent by the management node according to the clearing request.

[0033] The step of obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system includes:

[0034] Obtaining the target configuration file, and performing validity verification on the target configuration file;

[0035] When the validity check passes, the target configuration file is sent to each arbitration node in the cluster system;

[0036] When the validity check fails, an error message is fed back to the sender of the target configuration file.

[0037] The step of obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system includes:

[0038] Obtaining target file parameters, and determining parameter names and parameter types of the target file parameters;

[0039] Determine whether the parameter name matches a supported parameter list;

[0040] When the parameter name does not match the supported parameter list, determining that the validity check of the target file parameter fails;

[0041] When the parameter name hits the supported parameter list, determining the validity check strategy corresponding to the parameter type, and using the validity check strategy to perform validity check on the parameter value of the target file parameter;

[0042] When the validity check of the parameter value passes, the target configuration file is generated by using the target file parameters and the local configuration file, and the target configuration file is sent to each arbitration node in the cluster system;

[0043] When the validity check of the target file parameter fails or the validity check of the parameter value fails, an error prompt is fed back to the sending end of the target configuration file.

[0044] The target configuration file is obtained, including:

[0045] The target configuration file is obtained through a target command line interface.

[0046] In a second aspect, the present invention further discloses a data synchronization device in a cluster system, the cluster system comprising a management node, an arbitration node and a non-arbitration node, the device being applied to the management node and comprising:

[0047] A sending module, used for obtaining a target configuration file, and sending the target configuration file to each arbitration node in the cluster system;

[0048] A receiving module, configured to receive a configuration file verification value fed back by each arbitration node based on the target configuration file;

[0049] A determination module, configured to determine a standard check value according to each of the configuration file check values, and determine a legitimate arbitration node having the standard check value;

[0050] The synchronization module is used to synchronize data of the other arbitration nodes and the non-arbitration nodes by using the target configuration file in the legal arbitration node.

[0051] In a third aspect, the present invention further discloses an electronic device, comprising:

[0052] Memory for storing computer programs;

[0053] The processor is used to implement the steps of any one of the data synchronization methods in the cluster system described above when executing the computer program.

[0054] In a fourth aspect, the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the data synchronization methods in the cluster system described above are implemented.

[0055] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of any of the data synchronization methods in a cluster system as described above.

[0056] The present invention provides a data synchronization method in a cluster system, the cluster system comprises a management node, an arbitration node and a non-arbitration node, the method is applied to the management node, and comprises: obtaining a target configuration file, and sending the target configuration file to each arbitration node in the cluster system; receiving a configuration file check value fed back by each arbitration node based on the target configuration file; determining a standard check value according to each configuration file check value, and determining a legal arbitration node having the standard check value; and synchronizing data of other arbitration nodes and non-arbitration nodes using the target configuration file in the legal arbitration node.

[0057] By applying the technical solution provided by the present invention, in a cluster system, a management node is used to implement distribution processing of configuration files. In addition to the management node, other member nodes are divided into arbitration nodes and non-arbitration nodes, and the management node and each arbitration node are used to implement accuracy verification of the configuration file, so as to determine the legitimate arbitration node with an accurate configuration file. Therefore, the configuration file in the legitimate arbitration node can be used to synchronize data with other member nodes in the cluster system (including each arbitration node and each non-arbitration node), so as to achieve synchronization of the validity of the configuration file between the member nodes in the cluster system, thereby achieving unified, accurate and synchronized configuration file management in the cluster system.

[0058] The data synchronization device, electronic device, computer-readable storage medium and computer program product in the cluster system provided by the present invention also have the above-mentioned technical effects, and the present invention will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the following briefly introduces the drawings required for describing the prior art and the embodiments of the present invention. Of course, the drawings related to the embodiments of the present invention described below are only part of the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present invention.

[0060] Figure 1 A schematic diagram of the structure of a cluster system provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of a flow chart of a data synchronization method in a cluster system provided by an embodiment of the present invention;

[0062] Figure 3 A flowchart of a configuration file management method provided by an embodiment of the present invention;

[0063] Figure 4 A schematic diagram of a flow chart of a configuration file synchronization method provided by an embodiment of the present invention;

[0064] Figure 5 A schematic diagram of the structure of a data synchronization device in a cluster system provided by an embodiment of the present invention;

[0065] Figure 6 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The core of the present invention is to provide a data synchronization method in a cluster system, which can realize unified, accurate and synchronized configuration file management in the cluster system; another core of the present invention is to provide a data synchronization device, electronic device, computer-readable storage medium and computer program product in a cluster system, all of which have the above-mentioned beneficial effects.

[0067] In order to describe the technical solutions in the embodiments of the present invention more clearly and completely, the technical solutions in the embodiments of the present invention will be introduced below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] An embodiment of the present invention provides a data synchronization method in a cluster system.

[0069] First, please refer to Figure 1 , Figure 1 A schematic diagram of the structure of a cluster system provided by an embodiment of the present invention, the cluster system may include a management node, an arbitration node, and a non-arbitration node, wherein the number of arbitration nodes and non-arbitration nodes is not unique, the number of management nodes is one, and the management node may be any one of the arbitration nodes. The data synchronization method in the cluster system provided by the present invention is implemented based on the cluster system.

[0070] For further information, please refer to Figure 2 , Figure 2 A schematic diagram of a data synchronization method in a cluster system provided by an embodiment of the present invention. The data synchronization method in the cluster system is applied to Figure 1 The management node shown may include the following S101 to S104.

[0071] S101: Obtain a target configuration file, and send the target configuration file to each arbitration node in the cluster system.

[0072] This step aims to achieve the acquisition and distribution of the target configuration file, which is the configuration file that needs to be modified and managed and synchronized. Specifically, after obtaining the target configuration file, the management node can distribute it to each arbitration node in the cluster system. The number of arbitration nodes is generally multiple, which is used to verify the accuracy of the target configuration file to ensure that the arbitration node with the accurate target configuration file is found. Among them, the management node can maintain a node list of each arbitration node in the cluster system, so as to achieve the distribution and processing of the target configuration file according to the node information of each arbitration node in the node list.

[0073] Wherein, obtaining the target configuration file may include: obtaining the target configuration file through a target command line interface. For a cluster system, a unified command line interface, namely a target command line interface, may be provided, so that the target configuration file can only be obtained through the target command line interface, which effectively limits the modification entry of the target configuration file, further avoids the randomness of configuration file modification in the cluster system, and ensures the accuracy of the target configuration file.

[0074] S102: Receive a configuration file verification value fed back by each arbitration node based on the target configuration file.

[0075] This step aims to achieve the acquisition of the configuration file verification value. Specifically, after the management node distributes the target configuration file to each arbitration node, each arbitration node can start running according to the configuration information in the target configuration file. During the operation, the target configuration file of individual arbitration nodes may be modified, such as illegal intrusion modification, or abnormal modification of the node itself, etc., resulting in inaccurate target configuration file. Based on this, a verification cycle can be set so that each arbitration node can feedback a verification value of the target configuration file to the management node according to the preset verification cycle, that is, the above-mentioned configuration file verification value. The configuration file verification value is calculated by the arbitration node according to the target configuration file currently owned by itself. Therefore, the management node can use the configuration file verification value fed back by each arbitration node to determine the arbitration node with an accurate target configuration file. It can be understood that the specific value of the preset verification cycle does not affect the implementation of the present technical solution, and can be set by technical personnel according to actual conditions, and the present invention does not limit this.

[0076] S103: Determine a standard check value according to the check values ​​of each configuration file, and determine a legal arbitration node having the standard check value.

[0077] This step is intended to determine the legal arbitration node. Specifically, after obtaining the verification standard values ​​fed back by each arbitration node, the management node can determine the standard verification value based on all the verification standard values. The standard verification value refers to the configuration file verification value of the accurate target configuration file, which must be one of the many configuration file verification values. Then, the arbitration node with the standard verification value is the legal arbitration node. As mentioned above, the number of arbitration nodes is not unique, and similarly, the number of legal arbitration nodes is not unique. Generally speaking, it can account for half or more of the total number of arbitration nodes.

[0078] In one embodiment of the present invention, determining the standard check value according to the check values ​​of each configuration file may include:

[0079] Compare and analyze the checksum values ​​of each configuration file to determine the checksum value of the configuration file with the largest number;

[0080] The configuration file with the largest number of checksums is used as the standard checksum.

[0081] The embodiment of the present invention provides a method for determining a standard check value based on each configuration file check value, which can be implemented according to the "more than half" principle. That is, the management node can select the configuration file check value with the largest number from all the configuration file check values ​​received as the standard check value.

[0082] In one embodiment of the present invention, after sending the target configuration file to each arbitration node in the cluster system, the method may further include: calculating a verification reference value according to the target configuration file;

[0083] Accordingly, determining the standard check value according to each configuration file check value may include: taking the configuration file check value that is consistent with the check reference value as the standard check value.

[0084] The embodiment of the present invention provides another implementation method for determining a standard check value based on the check values ​​of each configuration file. It is understandable that before the management node distributes the target configuration file to each arbitration node, the target configuration file must be an accurate configuration file that has not been modified. Therefore, the check reference value (which is the standard value) can be calculated based on the target configuration file and saved. Thus, in each subsequent detection cycle, the check reference value can be used to perform consistency check on the configuration file check value fed back by each arbitration node. Obviously, if the two are consistent, the check passes, otherwise the check fails. In other words, the configuration file check value that is consistent with the check reference value is the standard check value.

[0085] Among them, calculating the verification reference value according to the target configuration file may include: using a message digest algorithm to calculate the target configuration file to obtain an MD5 value, and using the MD5 value as the verification reference value; or using a hash algorithm to calculate the target configuration file to obtain a hash value, and using the hash value as the verification reference value. An embodiment of the present invention provides a method for calculating a verification reference value, which can be calculated based on a message digest algorithm or can be calculated based on a hash algorithm. Similarly, the calculation of the configuration file verification value by each arbitration node based on the target configuration file assigned to itself in S102 can also be implemented by this algorithm.

[0086] S104: Using the target configuration file in the legal arbitration node, data synchronization is performed on other arbitration nodes and non-arbitration nodes.

[0087] This step aims to achieve data synchronization between member nodes in the cluster system. The member nodes that need to be synchronized here are the arbitration nodes and non-arbitration nodes in the cluster system except the legal arbitration node. The data that needs to be synchronized is the target configuration file in the legal arbitration node, that is, the accurate target configuration file. Specifically, the target configuration file in the legal arbitration node is synchronized to other member nodes in the cluster system.

[0088] In one embodiment of the present invention, synchronizing data of other arbitration nodes using a target configuration file in a legitimate arbitration node may include: sending a list of legitimate arbitration nodes to other arbitration nodes, so that other arbitration nodes send a data synchronization request to any legitimate arbitration node according to the list of legitimate arbitration nodes, and receiving a target configuration file fed back by the legitimate arbitration node based on the data synchronization request.

[0089] The embodiment of the present invention provides a method for implementing data synchronization for arbitration nodes other than the legal arbitration node in a cluster system. Specifically, after determining the legal arbitration nodes in the cluster system, the management node can generate a legal arbitration node list, which contains node information of each legal arbitration node, such as node ID, node IP and other information. Therefore, the management node can distribute the legal arbitration node list to the arbitration nodes other than the legal arbitration node in the cluster system, so that the other arbitration nodes can refer to the legal arbitration node list to initiate a data synchronization request to any of the legal arbitration nodes. Then, the legal arbitration node that receives the data synchronization request can synchronize its own target configuration file to the arbitration node that initiates the data synchronization request, thereby realizing data synchronization between the arbitration nodes. It can be understood that the data synchronization process of each non-arbitration node in the cluster system can also refer to this implementation process, and this embodiment will not be repeated here.

[0090] In one embodiment of the present invention, after obtaining the target configuration file, the method may further include: sending the target configuration file to each non-arbitration node;

[0091] Accordingly, the above-mentioned data synchronization of each non-arbitration node using the target configuration file in the legal arbitration node may include:

[0092] Sending a verification request to each non-arbitration node so that each non-arbitration node feeds back a configuration file verification value corresponding to the target configuration file to the management node;

[0093] The non-arbitration nodes whose configuration file checksums are inconsistent with the standard checksums are regarded as nodes to be synchronized;

[0094] Use the target configuration file in the legal arbitration node to synchronize data on each node to be synchronized.

[0095] The embodiment of the present invention provides a method for implementing data synchronization for each non-arbitration arbitration node in a cluster system. Through this implementation method, only some non-arbitration nodes in the cluster system that need to perform data synchronization need to perform data synchronization, and there is no need to perform data synchronization for all non-arbitration nodes in the cluster system, which has higher data synchronization efficiency. Specifically, the management node can first obtain the configuration file verification value of each non-arbitration node in the cluster system regarding its existing target configuration file, and verify it using the standard verification value obtained above. If the two are consistent, it means that the existing target configuration file in the arbitration node itself is an accurate configuration file. Otherwise, it means that there is an abnormality in the target configuration file, and the arbitration node needs to perform data synchronization. In this way, some non-arbitration nodes in the cluster system that need to perform data synchronization, that is, the above-mentioned nodes to be synchronized, are obtained, and then the target configuration file in the legal arbitration node is used to perform data synchronization on each node to be synchronized.

[0096] Among them, using the target configuration file in the legal arbitration node to synchronize data for each node to be synchronized may include: sending a list of legal arbitration nodes to each node to be synchronized, so that each node to be synchronized sends a data synchronization request to any legal arbitration node according to the list of legal arbitration nodes, and receives the target configuration file fed back by the legal arbitration node based on the data synchronization request.

[0097] The embodiment of the present invention provides a method for implementing data synchronization for each node to be synchronized in a cluster system. The implementation process can refer to the implementation process of implementing data synchronization for each arbitration node other than the legal arbitration node in the cluster system, which will not be described in detail in this embodiment.

[0098] Furthermore, before synchronizing the data of each node to be synchronized using the target configuration file in the legal arbitration node, the method may further include: sending a clear request to each node to be synchronized, so that each node to be synchronized deletes the target configuration file sent by the management node according to the clear request. It is understandable that since it has been determined that the target configuration file in each node to be synchronized has an error, it can be deleted to facilitate the storage of the target configuration file synchronized by the legal arbitration node, which can effectively avoid unnecessary space occupation and further save storage resources.

[0099] It can be seen that the data synchronization method in the cluster system provided by the embodiment of the present invention, in the cluster system, uses the management node to implement the distribution processing of the configuration file. In addition to the management node, other member nodes are divided into arbitration nodes and non-arbitration nodes, and the management node and each arbitration node are used to implement the accuracy verification of the configuration file, so as to determine the legitimate arbitration node with the accurate configuration file. Therefore, the configuration file in the legitimate arbitration node can be used to synchronize data with other member nodes in the cluster system (including each arbitration node and each non-arbitration node), so as to achieve the synchronization of the validity of the configuration file between the member nodes in the cluster system, thereby realizing unified, accurate and synchronized configuration file management in the cluster system.

[0100] Based on the above embodiments:

[0101] In one embodiment of the present invention, obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system may include:

[0102] Obtain the target configuration file and verify the validity of the target configuration file;

[0103] When the validity check passes, the target configuration file is sent to each arbitration node in the cluster system;

[0104] When the validity check fails, an error message is fed back to the sender of the target configuration file.

[0105] In order to effectively ensure the accuracy of the target configuration file received by each member node in the cluster system, an embodiment of the present invention provides a method for implementing the validity check of the target configuration file before distributing it. That is, the management node can first perform a validity check on the acquired target configuration file before distributing it to each arbitration node in the cluster system. Only when the validity check passes will it continue to distribute it to each arbitration node in the cluster system. Otherwise, it only returns an error prompt to re-acquire the target configuration file.

[0106] In one embodiment of the present invention, obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system may include:

[0107] Obtain target file parameters, and determine parameter names and parameter types of the target file parameters;

[0108] Determine whether the parameter name matches the supported parameter list;

[0109] When the parameter name does not match the supported parameter list, it is determined that the validity check of the target file parameter fails;

[0110] When the parameter name hits the supported parameter list, determine the validity check strategy corresponding to the parameter type, and use the validity check strategy to perform validity check on the parameter value of the target file parameter;

[0111] When the validity check of the parameter value passes, the target configuration file is generated using the target file parameters and the local configuration file, and the target configuration file is sent to each arbitration node in the cluster system;

[0112] When the validity check of the target file parameter fails or the validity check of the parameter value fails, an error prompt is fed back to the sender of the target configuration file.

[0113] The embodiment of the present invention provides another implementation method for checking the validity of a target configuration file before distributing it. It is understandable that the management node may receive the entire target configuration file through the target command line interface, or it may only receive one or more target file parameters, which are used to modify its existing target configuration file (i.e., the above-mentioned local configuration file) to obtain a new target configuration file. Therefore, when the management node receives the target file parameters, it can first check the validity of the target file parameters. If the validity check passes, the local configuration file can be modified using the target file parameters to obtain a new target configuration file and distribute it. Otherwise, it can only return an error prompt to re-acquire the target file parameters.

[0114] Furthermore, in this embodiment, the validity check of the target file parameter includes parameter name check and parameter value check, wherein the parameter name check refers to the management node checking whether it supports the target file parameter; the parameter value check refers to checking whether the value of the target file parameter is valid according to the parameter type of the target file parameter. Only when both checks are passed, the validity check of the target file parameter can be considered to have passed, otherwise, the validity check of the target file parameter is considered to have failed.

[0115] The validity check strategy is used to check the validity of the parameter value of the target file parameter, which may include:

[0116] When the parameter type is a switch value, determine whether the parameter value of the target file is a preset valid value. If so, the validity check passes; if not, the validity check fails.

[0117] When the parameter type is a string, determine whether the parameter value of the target file hits the preset parameter list. If so, the validity check passes; if not, the validity check fails.

[0118] When the parameter type is numeric, determine whether the parameter value of the target file meets the preset threshold range, the parameter value of the target file.

[0119] It can be understood that the verification of the entire target configuration file in the aforementioned embodiment can refer to the verification process of the target file parameters, that is, the validity verification process is performed on each file parameter in the target configuration file.

[0120] An embodiment of the present invention provides another data synchronization method in a cluster system.

[0121] First, please refer to Figure 3 , Figure 3 A flow chart of a configuration file management method provided by an embodiment of the present invention, the implementation process of which may include:

[0122] A unified command line interface is developed in advance so that the management node can obtain the complete configuration file or file parameters only through the command line interface, and use the internal judgment logic of the command line interface to verify the validity of the complete configuration file or file parameters. If the validity verification fails, the error item can be echoed and an error (error prompt) can be given. If the validity verification succeeds, the latest version of the configuration file can be generated based on the file parameters, and the old version of the configuration file can be archived and the new version of the configuration file can be distributed and synchronized, or the received complete configuration file can be directly distributed and synchronized.

[0123] It can be seen that the unified command line interface limits the entry for modifying the configuration file, and proposes the logic of maintaining a formal and correct configuration file, which is then distributed by the management node to the Local dir (local directory) of all member nodes in the cluster system to make it effective.

[0124] For further information, please refer to Figure 4 , Figure 4 A schematic diagram of a flow chart of a configuration file synchronization method provided by an embodiment of the present invention, wherein the implementation process may include:

[0125] 1. Use the arbitration strategy to identify which nodes the correct configuration files are distributed on:

[0126] During the normal operation of the cluster system, it is very likely that the configuration file of a member node is modified or deleted. When this happens, you can use the following logic to confirm which node in the cluster system has the correct configuration file.

[0127] (1) Determine the Quorum Node.

[0128] (2) Each Quorum Node actively sends the verification value (such as md5 value or sha256 value, etc.) of the local configuration file to the CMS (Cluster Manager Server) once in a cycle.

[0129] (3) CMS temporarily stores the verification values ​​sent by each Quorum Node.

[0130] (4) The management node confirms the consistency of all "temporarily stored" check values.

[0131] (5) Based on the "more than half" principle, CMS obtains the "benchmark value of the verification value" and CRNL (Configure RightNode List, a list of arbitration nodes with correct configuration files, i.e., a list of legal arbitration nodes).

[0132] (6) CMS sends an ack (acknowledge character) message and CRNL to the Quorum Node that is not in CRNL.

[0133] (7) The Quorum Node not in CRNL selects any legitimate Quorum Node in CRNL to send a configuration file synchronization request. The requested legitimate Quorum Node responds to the request and synchronizes the configuration file.

[0134] 2. Automatically monitor the configuration files of each member node in the cluster system periodically, identify the member nodes with abnormal configurations, and update the member nodes with abnormal configuration files:

[0135] (1) After obtaining the "base value of the checksum value" and CRNL, CMS obtains the checksum value of the configuration file on the Noquorum Node (non-arbitration node) in the cluster system.

[0136] (2) Compare each checksum value with the "checksum benchmark value". If they are consistent, return ack=0 to the corresponding non-arbitration node. Otherwise, return ack=1 and CRNL to the corresponding Noquorum Node.

[0137] (3) When the Noquorum Node receives ack=0, it does not need to take any subsequent actions. When it receives ack=1, it selects any legal Quorum Node in CRNL and sends a configuration file synchronization request. The requested legal Quorum Node responds to the request and synchronizes the configuration file.

[0138] It can be seen that the data synchronization method in the cluster system provided by the embodiment of the present invention, in the cluster system, uses the management node to implement the distribution processing of the configuration file. In addition to the management node, other member nodes are divided into arbitration nodes and non-arbitration nodes, and the management node and each arbitration node are used to implement the accuracy verification of the configuration file, so as to determine the legitimate arbitration node with the accurate configuration file. Therefore, the configuration file in the legitimate arbitration node can be used to synchronize data with other member nodes in the cluster system (including each arbitration node and each non-arbitration node), so as to achieve the synchronization of the validity of the configuration file between the member nodes in the cluster system, thereby realizing unified, accurate and synchronized configuration file management in the cluster system.

[0139] An embodiment of the present invention provides a data synchronization device in a cluster system.

[0140] Please refer to Figure 5 , Figure 5 This is a structural diagram of a data synchronization device in a cluster system provided by the present invention. The cluster system includes a management node, an arbitration node and a non-arbitration node. The data synchronization device in the cluster system is applied to the management node and may include:

[0141] The sending module 1 is used to obtain the target configuration file and send the target configuration file to each arbitration node in the cluster system;

[0142] Receiving module 2, used for receiving the configuration file verification value fed back by each arbitration node based on the target configuration file;

[0143] Determination module 3, used to determine the standard check value according to each configuration file check value, and determine the legal arbitration node having the standard check value;

[0144] The synchronization module 4 is used to synchronize data of other arbitration nodes and non-arbitration nodes using the target configuration file in the legal arbitration node.

[0145] It can be seen that the data synchronization device in the cluster system provided by the embodiment of the present invention, in the cluster system, uses the management node to implement the distribution processing of the configuration file. In addition to the management node, other member nodes are divided into arbitration nodes and non-arbitration nodes, and the management node and each arbitration node are used to implement the accuracy verification of the configuration file, so as to determine the legitimate arbitration node with the accurate configuration file. Therefore, the configuration file in the legitimate arbitration node can be used to synchronize data with other member nodes in the cluster system (including each arbitration node and each non-arbitration node), so as to achieve synchronization of the validity of the configuration file between the member nodes in the cluster system, thereby realizing unified, accurate and synchronized configuration file management in the cluster system.

[0146] In one embodiment of the present invention, the determination module 3 may be specifically used to compare and analyze the check values ​​of each configuration file, determine the check value of the configuration file with the largest number, and use the check value of the configuration file with the largest number as the standard check value.

[0147] In one embodiment of the present invention, the data synchronization device in the cluster system may further include a calculation module, which is used to calculate and obtain a verification reference value according to the target configuration file after the target configuration file is sent to each arbitration node in the cluster system;

[0148] Accordingly, the determination module 3 may be specifically configured to use a configuration file verification value that is consistent with the verification reference value as a standard verification value.

[0149] In one embodiment of the present invention, the above-mentioned calculation module can be specifically used to calculate the target configuration file using a message digest algorithm to obtain an MD5 value, and use the MD5 value as a verification reference value; or, calculate the target configuration file using a hash algorithm to obtain a hash value, and use the hash value as a verification reference value.

[0150] In one embodiment of the present invention, the synchronization module 4 can be specifically used to send a list of legal arbitration nodes to other arbitration nodes, so that other arbitration nodes send data synchronization requests to any legal arbitration node according to the list of legal arbitration nodes, and receive a target configuration file fed back by the legal arbitration node based on the data synchronization request.

[0151] In one embodiment of the present invention, the sending module may also be used to send the target configuration file to each non-arbitration node after obtaining the target configuration file;

[0152] Accordingly, the synchronization module 4 may include:

[0153] A sending unit, used for sending a verification request to each non-arbitration node, so that each non-arbitration node feeds back a configuration file verification value corresponding to the target configuration file to the management node;

[0154] A determination unit, configured to determine a non-arbitration node whose configuration file check value is inconsistent with a standard check value as a node to be synchronized;

[0155] The synchronization unit is used to synchronize data of each node to be synchronized by using the target configuration file in the legal arbitration node.

[0156] In one embodiment of the present invention, the synchronization unit may be specifically used to send a list of legal arbitration nodes to each node to be synchronized, so that each node to be synchronized sends a data synchronization request to any legal arbitration node according to the list of legal arbitration nodes, and receives a target configuration file fed back by the legal arbitration node based on the data synchronization request.

[0157] In one embodiment of the present invention, the data synchronization device in the cluster system may further include a clearing unit for sending a clearing request to each node to be synchronized before performing data synchronization on each node to be synchronized using the target configuration file in the legal arbitration node, so that each node to be synchronized deletes the target configuration file sent by the management node according to the clearing request.

[0158] In one embodiment of the present invention, the above-mentioned sending module 1 can be specifically used to obtain the target configuration file and perform validity verification on the target configuration file; when the validity verification passes, the target configuration file is sent to each arbitration node in the cluster system; when the validity verification fails, an error prompt is fed back to the sender of the target configuration file.

[0159] In one embodiment of the present invention, the above-mentioned sending module 1 can be specifically used to obtain the target file parameters, and determine the parameter name and parameter type of the target file parameters; determine whether the parameter name hits the supported parameter list; when the parameter name does not hit the supported parameter list, determine that the validity check of the target file parameters has failed; when the parameter name hits the supported parameter list, determine the validity check strategy corresponding to the parameter type, and use the validity check strategy to check the validity of the parameter value of the target file parameter; when the validity check of the parameter value passes, generate a target configuration file using the target file parameters and the local configuration file, and send the target configuration file to each arbitration node in the cluster system; when the validity check of the target file parameters fails or the validity check of the parameter value fails, feedback an error prompt to the sending end of the target configuration file.

[0160] In one embodiment of the present invention, the sending module 1 may be specifically used to obtain a target configuration file through a target command line interface.

[0161] For an introduction to the device provided in the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0162] An embodiment of the present invention provides an electronic device.

[0163] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided by the present invention, and the electronic device may include:

[0164] A memory 11, used for storing computer programs;

[0165] The processor 10 can implement the steps of any one of the above-mentioned data synchronization methods in the cluster system when executing the computer program.

[0166] like Figure 6 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.

[0167] In the embodiment of the present invention, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices.

[0168] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in an embodiment of a method for synchronizing data in a cluster system.

[0169] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present invention, the memory 11 at least stores programs for implementing the following functions:

[0170] Obtain the target configuration file and send it to each arbitration node in the cluster system;

[0171] receiving a configuration file verification value fed back by each arbitration node based on the target configuration file;

[0172] Determine the standard checksum value based on the checksum values ​​of each configuration file, and determine the legal arbitration node that has the standard checksum value;

[0173] The target configuration file in the legal arbitration node is used to synchronize data with other arbitration nodes and non-arbitration nodes.

[0174] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0175] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0176] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.

[0177] Of course, it should be noted that Figure 6 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 6 More or fewer components than shown, or combinations of certain components.

[0178] An embodiment of the present invention provides a computer-readable storage medium.

[0179] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned data synchronization methods in a cluster system can be implemented.

[0180] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.

[0181] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the above method embodiment, and the present invention will not elaborate on it here.

[0182] An embodiment of the present invention provides a computer program product.

[0183] The computer program product provided by the embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of any one of the above-mentioned data synchronization methods in a cluster system can be implemented.

[0184] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.

[0185] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0186] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0187] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0188] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0189] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0190] The technical solution provided by the present invention is described in detail above. Specific examples are used herein to illustrate the principle and implementation of the present invention, and the description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A data synchronization method in a cluster system, characterized in that: The cluster system includes a management node, an arbitration node, and a non-arbitration node. The method is applied to the management node and includes: Obtaining a target configuration file through a target command line interface, and sending the target configuration file to each of the arbitration nodes and each of the non-arbitration nodes in the cluster system; the target command line interface is an entry for the cluster system to modify the target configuration file; receiving a configuration file verification value fed back by each arbitration node based on the target configuration file in the arbitration node; each arbitration node feeds back the verification value to the management node according to a preset verification period; Determine a standard check value according to each of the configuration file check values, and determine a legitimate arbitration node having the standard check value; the standard check value refers to an accurate configuration file check value of the target configuration file, and the standard check value is determined by comparing and analyzing each of the configuration file check values; Sending a list of legal arbitration nodes to the other arbitration nodes, so that the other arbitration nodes send a data synchronization request to any legal arbitration node according to the list of legal arbitration nodes, and receive a target configuration file fed back by the legal arbitration node based on the data synchronization request; Sending a verification request to each of the non-arbitration nodes, so that each of the non-arbitration nodes feeds back a configuration file verification value corresponding to the target configuration file to the management node; The non-arbitration node whose configuration file check value is inconsistent with the standard check value is used as a node to be synchronized; A list of legal arbitration nodes is issued to each of the nodes to be synchronized, so that each of the nodes to be synchronized sends a data synchronization request to any of the legal arbitration nodes according to the list of legal arbitration nodes, and receives a target configuration file fed back by the legal arbitration node based on the data synchronization request.

2. The data synchronization method in a cluster system according to claim 1, characterized in that: Determining a standard check value according to each of the configuration file check values ​​includes: Comparing and analyzing the check values ​​of the configuration files, and determining the check value of the configuration file with the largest number; The configuration file verification value with the largest number is used as the standard verification value.

3. The data synchronization method in a cluster system according to claim 1, characterized in that: After sending the target configuration file to each arbitration node in the cluster system, the method further includes: Calculate a calibration reference value according to the target configuration file; Accordingly, determining a standard check value according to each of the configuration file check values ​​includes: The configuration file verification value that is consistent with the verification reference value is used as the standard verification value.

4. The data synchronization method in a cluster system according to claim 3, characterized in that: The calibration reference value is calculated according to the target configuration file, including: Calculate the target configuration file using a message digest algorithm to obtain an MD5 value, and use the MD5 value as the verification reference value; Alternatively, a hash value is obtained by calculating the target configuration file using a hash algorithm, and the hash value is used as the verification reference value.

5. The data synchronization method in a cluster system according to claim 1, characterized in that: Before synchronizing the data of each of the nodes to be synchronized using the target configuration file in the legal arbitration node, the method further includes: Sending a clearing request to each of the nodes to be synchronized, so that each of the nodes to be synchronized deletes the target configuration file sent by the management node according to the clearing request.

6. The data synchronization method in a cluster system according to any one of claims 1 to 5, characterized in that: Obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system includes: Obtaining the target configuration file, and performing validity verification on the target configuration file; When the validity check passes, the target configuration file is sent to each arbitration node in the cluster system; When the validity check fails, an error message is fed back to the sender of the target configuration file.

7. The data synchronization method in a cluster system according to any one of claims 1 to 5, characterized in that: Obtaining a target configuration file and sending the target configuration file to each arbitration node in the cluster system includes: Obtaining target file parameters, and determining parameter names and parameter types of the target file parameters; Determine whether the parameter name matches a supported parameter list; When the parameter name does not match the supported parameter list, determining that the validity check of the target file parameter fails; When the parameter name hits the supported parameter list, determining the validity check strategy corresponding to the parameter type, and using the validity check strategy to perform validity check on the parameter value of the target file parameter; When the validity check of the parameter value passes, the target configuration file is generated by using the target file parameters and the local configuration file, and the target configuration file is sent to each arbitration node in the cluster system; When the validity check of the target file parameter fails or the validity check of the parameter value fails, an error prompt is fed back to the sending end of the target configuration file.

8. A data synchronization device in a cluster system, characterized in that: The cluster system includes a management node, an arbitration node, and a non-arbitration node. The device is applied to the management node and includes: a sending module, used for obtaining a target configuration file through a target command line interface, and sending the target configuration file to each arbitration node and each non-arbitration node in the cluster system; the target command line interface is an entry for the cluster system to modify the target configuration file; A receiving module, configured to receive a configuration file verification value fed back by each arbitration node based on the target configuration file in the arbitration node; each arbitration node feeds back the verification value to the management node according to a preset verification period; A determination module, configured to determine a standard check value according to each of the configuration file check values, and determine a legal arbitration node having the standard check value; the standard check value refers to an accurate configuration file check value of the target configuration file, and the standard check value is determined by comparing and analyzing each of the configuration file check values; A synchronization module, used to synchronize data of other arbitration nodes and non-arbitration nodes using the target configuration file in the legal arbitration node; The synchronization module is further configured to send a list of legal arbitration nodes to the other arbitration nodes, so that the other arbitration nodes send a data synchronization request to any legal arbitration node according to the list of legal arbitration nodes, and receive a target configuration file fed back by the legal arbitration node based on the data synchronization request; The synchronization module comprises: a sending unit, configured to send a verification request to each of the non-arbitration nodes, so that each of the non-arbitration nodes feeds back a configuration file verification value corresponding to the target configuration file to the management node; A determination unit, configured to take a non-arbitration node whose configuration file check value is inconsistent with the standard check value as a node to be synchronized; The synchronization unit is used to send a list of legal arbitration nodes to each of the nodes to be synchronized, so that each of the nodes to be synchronized sends a data synchronization request to any of the legal arbitration nodes according to the list of legal arbitration nodes, and receives a target configuration file fed back by the legal arbitration node based on the data synchronization request.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data synchronization method in a cluster system as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data synchronization method in a cluster system as described in any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the data synchronization method in a cluster system according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Information updating method, device and equipment and computer readable storage medium

    CN116781692A

  • Highly-available distributed cluster configuration database

    US6014669A