CN112600690A - Configuration data synchronization method, device, equipment and storage medium - Google Patents

Configuration data synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN112600690A
CN112600690A CN202011396153.4A CN202011396153A CN112600690A CN 112600690 A CN112600690 A CN 112600690A CN 202011396153 A CN202011396153 A CN 202011396153A CN 112600690 A CN112600690 A CN 112600690A
Authority
CN
China
Prior art keywords
configuration data
cluster
network
zookeeper
nodes
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.)
Granted
Application number
CN202011396153.4A
Other languages
Chinese (zh)
Other versions
CN112600690B (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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202011396153.4A priority Critical patent/CN112600690B/en
Publication of CN112600690A publication Critical patent/CN112600690A/en
Application granted granted Critical
Publication of CN112600690B publication Critical patent/CN112600690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/0866Checking the configuration
    • 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
    • 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/0866Checking the configuration
    • H04L41/0873Checking configuration conflicts between network elements
    • 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/0893Assignment of logical groups to network elements
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a method, a device, equipment and a storage medium for synchronizing configuration data, wherein the method comprises the following steps: acquiring cluster configuration data and local configuration data; carrying out consistency check on the local configuration data and the cluster configuration data, and starting a service process according to a check result; creating a zookeeper temporary node in a zookeeper cluster, and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the node; and according to the network state of the node, performing consistency check and synchronization of the local configuration data and the cluster configuration data. According to the method and the device, the whole configuration operation failure caused by the failure of individual nodes can be avoided, the network state of the nodes is monitored through the zookeeper, a separate heartbeat detection process is not required to be set, and the configuration operation is simplified.

Description

Configuration data synchronization method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for synchronizing configuration data.
Background
In the distributed cluster, a plurality of physical hosts provide related service for the outside, configuration data of cluster operation needs to be stored on the physical hosts, and the configuration data of each physical host is required to be kept consistent.
When the cluster configuration data is modified, a request needs to be issued to all physical hosts of the cluster, the whole operation is successful after all the hosts complete the modification operation, and if part of the hosts fail to modify, the configuration data on other hosts needs to be rolled back, so that the consistency of the cluster configuration data is ensured.
It is obvious that, in the prior art, failure in issuing configuration by any host of a distributed cluster will result in failure in modifying configuration of the cluster, and configuration data on other hosts needs to be rolled back.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus, a device and a storage medium for synchronizing configuration data, so as to solve at least one problem in the prior art.
A first aspect of the present application provides a configuration data synchronization method, which is applied to nodes of a distributed cluster, and includes:
acquiring cluster configuration data and local configuration data;
carrying out consistency check on the local configuration data and the cluster configuration data, and starting a service process according to a check result;
creating a zookeeper temporary node in a zookeeper cluster, and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the distributed cluster node;
and according to the network state of the distributed cluster nodes, performing consistency check and synchronization of the local configuration data and the cluster configuration data.
A second aspect of the present application provides a configuration data synchronization apparatus, which is applied to a node of a distributed cluster, and includes:
the acquisition module is used for acquiring cluster configuration data and local configuration data;
the synchronization module is used for carrying out consistency check on the local configuration data and the cluster configuration data and starting a service process according to a check result;
the monitoring module is used for creating a zookeeper temporary node in the zookeeper cluster and creating a monitor to monitor the change of the zookeeper temporary node so as to obtain the network state of the distributed cluster nodes;
and the synchronization module is also used for carrying out consistency check and synchronization of the local configuration data and the cluster configuration data according to the network state of the distributed cluster nodes.
A third aspect of the present application provides a configuration data synchronization apparatus, including: memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing when executing the computer program to implement the method as described in the first aspect.
A fourth aspect of the present application provides a computer readable storage medium having computer readable instructions stored thereon which are executable by a processor to implement the method as described in the first aspect.
Compared with the prior art, the configuration data synchronization method, device, equipment and storage medium provided by the application acquire cluster configuration data and local configuration data; carrying out consistency check on the local configuration data and the cluster configuration data, and starting a service process according to a check result; therefore, in the application, when the local configuration data of the distributed cluster nodes is inconsistent with the cluster configuration data, the service process is not started, so that the management platform does not cause the whole operation failure due to the failure of individual nodes when issuing the configuration data to all the nodes of the cluster. Creating a zookeeper temporary node in a zookeeper cluster, and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the distributed cluster node; and according to the network state of the distributed cluster nodes, performing consistency check and synchronization of the local configuration data and the cluster configuration data. Therefore, in the application, the network state of the distributed cluster nodes is monitored through the zookeeper, a separate heartbeat detection process is not required to be set, and configuration operation is simplified.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a schematic diagram of a prior art configuration data management platform;
FIG. 2 is a schematic diagram illustrating a prior art configuration data synchronization method;
FIG. 3 is a diagram illustrating a conventional method for monitoring the network status of a cluster host through a heartbeat process;
FIG. 4 illustrates a flow chart of a method of configuration data synchronization provided by some embodiments of the present application;
FIG. 5 illustrates a schematic diagram of a distributed storage Ceph cluster provided by some embodiments of the present application;
FIG. 6 illustrates a schematic diagram of creating a zookeeper temporary node provided by some embodiments of the present application;
FIG. 7 illustrates a scenario diagram of modifying cluster configuration data provided by some embodiments of the present application;
FIG. 8 illustrates a schematic diagram of a configuration data synchronization apparatus provided by some embodiments of the present application;
fig. 9 illustrates a schematic diagram of a configuration data synchronization apparatus provided by some embodiments of the present application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which this application belongs.
In addition, the terms "first" and "second", etc. are used to distinguish different objects, rather than to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
At present, the most common configuration data synchronization method is to set a centralized configuration center, as shown in fig. 1, a database of the configuration center maintains all configuration data of a cluster, and all hosts of the cluster maintain the same configuration data as the database of the configuration center. When the configuration data needs to be modified, the configuration management module issues a request to all the hosts of the cluster, the failure of any host to store the configuration data can cause the synchronization failure of the configuration data, and the configuration data on the successfully issued host needs to be rolled back, so that the consistency of the configuration data is ensured.
When configuration data on a successful host is issued in a rollback configuration, if a target host has a non-network fault such as a downtime, a process restart, or the like, data in the host and a configuration center database are inconsistent, all the configuration data are read from the configuration center database and subjected to consistency check when the host recovers the fault, as shown in fig. 2, a cluster host N is a faulty host, if the configuration data are inconsistent, synchronization is performed on the basis of the data in the configuration center database, and if the synchronization fails, retry is performed until the configuration recovers to a consistent state, and then service of the faulty host is started.
When the configuration data of the normal host is rolled back, if a network failure occurs again in the target host (the process is not restarted), which also causes inconsistency between the data in the host and the data in the configuration center database, a heartbeat process (sending a heartbeat message) for detecting network connectivity with the configuration center is usually run on the host, as shown in fig. 3, when a network failure is detected to recover (the network is changed from non-connectivity to connectivity), all the configuration data are read from the configuration center database and are subjected to consistency check and synchronization.
Therefore, in the prior art, the cluster configuration modification failure can be caused by the configuration failure issued by any host, and the defects are particularly prominent in large-scale clusters; the centralized configuration center database is used for storing the configuration data, and the reliability of the configuration data needs to be realized by an additional high-availability method, such as setting a backup database; an independent heartbeat detection process is required to be set to monitor whether the network is recovered or not and carry out consistency check and synchronization, and the setting is complicated.
In view of the above, embodiments of the present application provide a method and an apparatus for synchronizing configuration data, a device for synchronizing configuration data, and a computer-readable storage medium, which are described below with reference to the accompanying drawings.
Referring to fig. 4, which shows a flowchart of a configuration data synchronization method provided in some embodiments of the present application, the method is applied to a node of a distributed cluster, for example, a distributed storage system includes multiple distributed storage nodes, as shown in fig. 4, the method may specifically include the following steps:
step S101: acquiring cluster configuration data and local configuration data;
in particular, cluster configuration data may be stored in a database of the distributed cluster. Taking a distributed storage Ceph cluster as an example (as shown in fig. 5), the cluster itself provides a distributed K-V database (implemented based on rocks DB, hereinafter named DB) for storing cluster state information, and provides functions of adding, deleting, changing, and searching the database to the outside, and any node in the cluster can call a command line or other external interface to operate the database. Ceph is a distributed storage system, and is a distributed key value system composed of a plurality of rocksdbs.
In the embodiment, all configuration data of the cluster are stored in the K-V database in a K-V form, compared with the prior art, a separate configuration center database is not required to be arranged to store the cluster configuration data, the distributed database provided by the distributed cluster is used to store the cluster configuration data, an additional high-availability scheme is not required, and corresponding arrangement is simplified.
Step S102: carrying out consistency check on the local configuration data and the cluster configuration data, and starting a service process according to a check result;
specifically, if the two are consistent, the service process is started; if the local configuration data and the cluster configuration data are not consistent, synchronizing the local configuration data and the cluster configuration data, and starting the service process after synchronization is completed.
In practical application, each node of the cluster locally calls a command line provided by the DB to inquire all configuration data of the cluster when a service process is started, and performs consistency check with the locally stored configuration data, if the configuration data is not consistent, configuration synchronization is performed, and a process corresponding to a service on the node, namely the service process, is started after synchronization is completed.
Step S103: creating a zookeeper temporary node in a zookeeper cluster, and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the distributed cluster node;
specifically, in step S103, when the monitor monitors that the zookeeper temporary node disappears and receives a network suspension event notified by the zookeeper cluster, the distributed cluster node is set from the network connection state to the network failure state; when the monitor receives the network connection event notified by the zookeeper cluster, the distributed cluster nodes are set from the network failure state to the network connection state.
In practical application, as shown in fig. 6, when a service process is started, a thread is started to create a zookeeper temporary node, such as/network/nodeb, in a zookeeper cluster, and a watch is created to monitor changes of the temporary node/network/nodeb, when a network failure occurs in nodeb, the temporary node/network/nodeb disappears, a zookeeper client on a node receives a network suspension (suspend) event, and the zookeeper client sets a node from a network connection state to a network failure state; when the nodeX network is recovered, the temporary node/network/nodeX is regenerated again, the zookeeper client receives a network connection (connected) event, and the zookeeper client sets the node from the network failure state to the network connection state.
In this embodiment, a temporary node and an event notification mechanism of zookeeper are used to implement notification of a network failure and a recovery event.
Step S104: and according to the network state of the distributed cluster nodes, performing consistency check and synchronization of the local configuration data and the cluster configuration data.
Specifically, in step S104, when the distributed cluster node recovers from the network failure state to the network connection state, cluster configuration data and local configuration data are acquired; carrying out consistency check on the local configuration data and the cluster configuration data; if the two are consistent, ending; and if not, synchronizing the local configuration data and the cluster configuration data.
In practical application, as shown in fig. 7, when configuration data needs to be modified, a management platform issues a request to all nodes of a cluster (i.e., hosts in the cluster), and if configuration fails due to a non-network fault such as downtime or process restart of some nodes, other nodes that have been successfully configured need not to roll back, and when the failure of the node that has failed to be configured is recovered (the process is restarted), a DB command line is called locally at the node to obtain the cluster configuration data and perform consistency check and synchronization, so that the configuration consistency of all nodes of the cluster is ensured.
In practical application, as shown in fig. 7, when configuration data needs to be modified, a management platform issues a request to all nodes of a cluster, if a part of the nodes fail to configure due to a network fault (a process is not restarted), other nodes that have issued configuration successfully do not need to rollback, and when the nodes monitor that a node notified by a zookeeper cluster recovers from a network fault state to a network connection state, a DB command line is locally invoked to acquire cluster configuration data and perform consistency check and synchronization, so as to ensure the configuration consistency of all the nodes of the cluster.
According to the configuration data synchronization method provided by the embodiment of the application, consistency check and synchronization of configuration data are realized by using characteristics of zookeeper and distributed clusters. On one hand, when the local configuration data of the distributed cluster nodes are inconsistent with the cluster configuration data, the service process cannot be started, so that the management platform cannot cause the whole operation failure due to the failure of individual nodes when issuing the configuration data to all the nodes of the cluster; on the other hand, the network state of the node is monitored through the zookeeper, a separate heartbeat detection process is not needed to be set, and configuration operation is simplified.
In the foregoing embodiment, a method for synchronizing configuration data is provided, and correspondingly, an apparatus for synchronizing configuration data is also provided. The configuration data synchronization device provided by the embodiment of the application can implement the configuration data synchronization method. Please refer to fig. 8, which illustrates a schematic diagram of a configuration data synchronization apparatus according to some embodiments of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
As shown in fig. 8, the configuration data synchronization apparatus 10 may include:
an obtaining module 101, configured to obtain cluster configuration data and local configuration data;
the synchronization module 102 is configured to perform consistency check on the local configuration data and the cluster configuration data, and start a service process according to a check result;
specifically, if the local configuration data is consistent with the cluster configuration data, a service process is started; and if not, synchronizing the local configuration data and the cluster configuration data, and starting a service process after synchronization is completed.
The monitoring module 103 is used for creating a zookeeper temporary node in the zookeeper cluster and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the distributed cluster node;
the synchronization module 102 is further configured to perform consistency check and synchronization between the local configuration data and the cluster configuration data according to the network state of the distributed cluster nodes.
In some implementations of the embodiments of the present application, the synchronization module 102 is specifically configured to:
carrying out consistency check on the local configuration data and the cluster configuration data;
if the local configuration data is consistent with the cluster configuration data, starting a service process; and if not, synchronizing the local configuration data and the cluster configuration data, and starting a service process after synchronization is completed.
In some implementations of the embodiments of the present application, the monitoring module 103 is specifically configured to:
when the monitor monitors that the zookeeper temporary node disappears and receives a network pause event notified by a zookeeper cluster, setting the distributed cluster node from a network connection state to a network fault state;
when the monitor receives the network connection event notified by the zookeeper cluster, the distributed cluster nodes are set from the network failure state to the network connection state.
In some implementations of the embodiments of the present application, the synchronization module 102 is further specifically configured to:
when the distributed cluster nodes are recovered to a network connection state from a network fault state, cluster configuration data and local configuration data are obtained;
carrying out consistency check on the local configuration data and the cluster configuration data;
if the two are consistent, ending; and if not, synchronizing the local configuration data and the cluster configuration data.
In some implementations of embodiments of the present application, the cluster configuration data is stored in a database of the distributed cluster.
The configuration data synchronization device provided by the above embodiment of the present application and the configuration data synchronization method provided by the embodiment of the present application have the same inventive concept and the same beneficial effects.
The present application further provides a configuration data synchronization device corresponding to the configuration data synchronization method provided in the foregoing embodiments, where the device may be an electronic device for a client, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, and the like, to execute the configuration data synchronization method.
Please refer to fig. 9, which illustrates a schematic diagram of a configuration data synchronization apparatus according to some embodiments of the present application. As shown in fig. 9, the configuration data synchronization device 20 includes: the system comprises a processor 200, a memory 201, a bus 202 and a communication interface 203, wherein the processor 200, the communication interface 203 and the memory 201 are connected through the bus 202; the memory 201 stores a computer program that can be executed on the processor 200, and the processor 200 executes the configuration data synchronization method provided in any of the foregoing embodiments when executing the computer program.
The Memory 201 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
Bus 202 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used for storing a program, and the processor 200 executes the program after receiving an execution instruction, and the configuration data synchronization method disclosed in any embodiment of the present application may be applied to the processor 200, or implemented by the processor 200.
The processor 200 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 200. The Processor 200 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201 and completes the steps of the method in combination with the hardware thereof.
The configuration data synchronization device provided by the embodiment of the application and the configuration data synchronization method provided by the embodiment of the application have the same inventive concept and have the same beneficial effects as the method adopted, operated or realized by the device.
The present application further provides a computer-readable storage medium corresponding to the configuration data synchronization method provided in the foregoing embodiments, where the computer-readable storage medium may be an optical disc, and a computer program (i.e., a program product) is stored on the optical disc, and when the computer program is executed by a processor, the computer program will execute the configuration data synchronization method provided in any of the foregoing embodiments.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above-mentioned embodiment of the present application and the configuration data synchronization method provided by the embodiment of the present application have the same beneficial effects as the method adopted, executed or implemented by the application program stored in the computer-readable storage medium.
Finally, it should be noted that: the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present disclosure, and the present disclosure should be construed as being covered by the claims and the specification.

Claims (10)

1. A method for synchronizing configuration data is applied to nodes of a distributed cluster, and comprises the following steps:
acquiring cluster configuration data and local configuration data;
carrying out consistency check on the local configuration data and the cluster configuration data, and starting a service process according to a check result;
creating a zookeeper temporary node in a zookeeper cluster, and creating a monitor to monitor the change of the zookeeper temporary node to obtain the network state of the distributed cluster node;
and according to the network state of the distributed cluster nodes, performing consistency check and synchronization of the local configuration data and the cluster configuration data.
2. The method of claim 1, wherein the performing consistency check on the local configuration data and the cluster configuration data and starting a service process according to a check result comprises:
carrying out consistency check on the local configuration data and the cluster configuration data;
if the two are consistent, starting the service process; and if not, synchronizing the local configuration data and the cluster configuration data, and starting a service process after synchronization is completed.
3. The method of claim 1, wherein the create monitor listening for changes to the zookeeper temporary node to obtain the network status of distributed cluster nodes, comprises:
when the monitor monitors that the zookeeper temporary node disappears and receives a network pause event notified by a zookeeper cluster, setting the distributed cluster node from a network connection state to a network fault state;
when the monitor receives the network connection event notified by the zookeeper cluster, the distributed cluster nodes are set from the network failure state to the network connection state.
4. The method of claim 3, wherein the performing consistency check and synchronization of the local configuration data and the cluster configuration data according to the network status of the distributed cluster nodes comprises:
when the distributed cluster nodes are recovered to a network connection state from a network fault state, cluster configuration data and local configuration data are obtained;
carrying out consistency check on the local configuration data and the cluster configuration data;
if the two are consistent, ending; and if not, synchronizing the local configuration data and the cluster configuration data.
5. The method of any of claims 1 to 4, wherein the cluster configuration data is stored in a database of the distributed cluster.
6. A configuration data synchronization device applied to nodes of a distributed cluster is characterized by comprising:
the acquisition module is used for acquiring cluster configuration data and local configuration data;
the synchronization module is used for carrying out consistency check on the local configuration data and the cluster configuration data and starting a service process according to a check result;
the monitoring module is used for creating a zookeeper temporary node in the zookeeper cluster and creating a monitor to monitor the change of the zookeeper temporary node so as to obtain the network state of the distributed cluster nodes;
and the synchronization module is also used for carrying out consistency check and synchronization of the local configuration data and the cluster configuration data according to the network state of the distributed cluster nodes.
7. The apparatus of claim 6, wherein the listening module is specifically configured to:
when the monitor monitors that the zookeeper temporary node disappears and receives a network pause event notified by a zookeeper cluster, setting the distributed cluster node from a network connection state to a network fault state;
when the monitor receives the network connection event notified by the zookeeper cluster, the distributed cluster nodes are set from the network failure state to the network connection state.
8. The apparatus of claim 7, wherein the synchronization module is specifically configured to:
when the distributed cluster nodes are recovered to a network connection state from a network fault state, cluster configuration data and local configuration data are obtained;
carrying out consistency check on the local configuration data and the cluster configuration data;
if the two are consistent, ending; and if not, synchronizing the local configuration data and the cluster configuration data.
9. A configuration data synchronization apparatus, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method according to any of claims 1 to 5.
10. A computer-readable storage medium having computer-readable instructions stored thereon, the computer-readable instructions being executable by a processor to implement the method of any one of claims 1 to 5.
CN202011396153.4A 2020-12-03 2020-12-03 Configuration data synchronization method, device, equipment and storage medium Active CN112600690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011396153.4A CN112600690B (en) 2020-12-03 2020-12-03 Configuration data synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011396153.4A CN112600690B (en) 2020-12-03 2020-12-03 Configuration data synchronization method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112600690A true CN112600690A (en) 2021-04-02
CN112600690B CN112600690B (en) 2022-05-24

Family

ID=75188137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011396153.4A Active CN112600690B (en) 2020-12-03 2020-12-03 Configuration data synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112600690B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11652909B1 (en) * 2022-03-10 2023-05-16 International Business Machines Corporation TCP session closure in container orchestration system
CN116743550A (en) * 2023-08-11 2023-09-12 之江实验室 Processing method of fault storage nodes of distributed storage cluster

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179443A (en) * 2007-11-23 2008-05-14 华为技术有限公司 Method, device and system of implementing configuration data conformance in system
US8484163B1 (en) * 2010-12-16 2013-07-09 Netapp, Inc. Cluster configuration backup and recovery
US20140099922A1 (en) * 2012-10-09 2014-04-10 Cellco Partnership D/B/A Verizon Wireless Interface for synchronizing automated replies between different messaging systems
CN106375342A (en) * 2016-10-21 2017-02-01 用友网络科技股份有限公司 Zookeeper-technology-based system cluster method and system
CN106878053A (en) * 2016-12-22 2017-06-20 努比亚技术有限公司 A kind of config update devices and methods therefor based on ZOOKEEPER
US20200137023A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Distributed network internet protocol (ip) address management in a coordinated system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179443A (en) * 2007-11-23 2008-05-14 华为技术有限公司 Method, device and system of implementing configuration data conformance in system
US8484163B1 (en) * 2010-12-16 2013-07-09 Netapp, Inc. Cluster configuration backup and recovery
US20140099922A1 (en) * 2012-10-09 2014-04-10 Cellco Partnership D/B/A Verizon Wireless Interface for synchronizing automated replies between different messaging systems
CN106375342A (en) * 2016-10-21 2017-02-01 用友网络科技股份有限公司 Zookeeper-technology-based system cluster method and system
CN106878053A (en) * 2016-12-22 2017-06-20 努比亚技术有限公司 A kind of config update devices and methods therefor based on ZOOKEEPER
US20200137023A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Distributed network internet protocol (ip) address management in a coordinated system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11652909B1 (en) * 2022-03-10 2023-05-16 International Business Machines Corporation TCP session closure in container orchestration system
CN116743550A (en) * 2023-08-11 2023-09-12 之江实验室 Processing method of fault storage nodes of distributed storage cluster
CN116743550B (en) * 2023-08-11 2023-12-29 之江实验室 Processing method of fault storage nodes of distributed storage cluster

Also Published As

Publication number Publication date
CN112600690B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
CN109347675B (en) Server configuration method and device and electronic equipment
US7802128B2 (en) Method to avoid continuous application failovers in a cluster
US9098439B2 (en) Providing a fault tolerant system in a loosely-coupled cluster environment using application checkpoints and logs
US9240937B2 (en) Fault detection and recovery as a service
CN112600690B (en) Configuration data synchronization method, device, equipment and storage medium
CN109491609B (en) Cache data processing method, device and equipment and readable storage medium
CN105242990A (en) Cloud platform based data backup method and apparatus
CN111818124B (en) Data storage method, data storage device, electronic equipment and medium
CN107508694B (en) Node management method and node equipment in cluster
CN102394914A (en) Cluster brain-split processing method and device
CN104036043A (en) High availability method of MYSQL and managing node
CN115562911B (en) Virtual machine data backup method, device, system, electronic equipment and storage medium
CN114764380A (en) Distributed cluster control method and device based on ETCD
CN112000735A (en) Data processing method, device and system
CN115658390A (en) Container disaster tolerance method, system, device, equipment and computer readable storage medium
CN108243031B (en) Method and device for realizing dual-computer hot standby
JP6083480B1 (en) Monitoring device, fault tolerant system and method
CN108133034B (en) Shared storage access method and related device
CN112199240A (en) Method for switching nodes during node failure and related equipment
CN113886021A (en) Mirror image backup method and device, electronic equipment and readable storage medium
CN113986450A (en) Virtual machine backup method and device
CN107526652B (en) Data synchronization method and storage device
CN105868038B (en) Memory error processing method and electronic equipment
CN116701518A (en) Database cluster deployment method and device, computer equipment and storage medium
CN113596195B (en) Public IP address management method, device, main node and 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