Database configuration parameter synchronization method and storage medium

By writing network data to the master node and synchronizing it to the slave node through an independent network channel, the problem of inconsistent configuration parameters when the database cluster is abnormal is solved, and the reliability of the database cluster is improved.

CN117290446BActive Publication Date: 2025-10-10CETC JINCANG (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311268600.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-10-10
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In the prior art, database clusters have inconsistent configuration parameters under abnormal circumstances, resulting in low reliability.

Method used

The configuration parameters are written into the first network data through the master node and synchronized to the slave node through an independent network channel to implement the configuration parameter update of the slave node.

Benefits of technology

Even when an information blockage exception occurs between the slave node and the master node, the configuration parameters of the master and slave nodes can be kept consistent, thereby improving the reliability of the database cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117290446B_ABST
    Figure CN117290446B_ABST
Patent Text Reader

Abstract

The application provides a database configuration parameter synchronization method and a storage medium. The database configuration parameter synchronization method comprises the following steps: judging whether a master node meets a preset condition; if yes, writing configuration parameters of the master node into first network data, and synchronizing the first network data to a slave node through an independent network channel; after the slave node receives the first network data, updating configuration parameters of the slave node according to the first network data. Compared with the prior art in which a database cluster synchronizes configuration parameters through a pre-write log, even if an exception occurs between the slave node and the master node due to information blockage, the application can synchronize the configuration parameters of the master node to the slave node through the independent network channel, so that the slave node updates the configuration parameters, and the configuration parameters of the master node and the configuration parameters of the slave node remain consistent, thereby improving the reliability of the database cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database clusters, and in particular to a database configuration parameter synchronization method and storage medium. Background Art

[0002] In a database, configuration parameters are used to configure global database parameters and control database behavior for security, performance, and other purposes. A database cluster consists of a master node and slave nodes, and the configuration parameters of these nodes must be consistent. Existing solutions maintain consistent configuration parameters across nodes in a database cluster in two ways: modifying configuration parameters within a single database, or synchronizing configuration parameters through a write-ahead log.

[0003] Modifying configuration parameters for a single database requires input and implementation within that single database, and the modification only takes effect on that single database. In a database cluster, there are multiple nodes, each hosting a database. To ensure synchronization of configuration parameters across nodes, modifying the configuration parameters of one database requires modifying the configuration parameters of all other nodes individually. This results in cumbersome configuration parameter modifications for the database cluster.

[0004] Synchronizing configuration parameters through a write-ahead log is to write the configuration parameters in the write-ahead log, and then update the configuration parameters of the slave node through the write-ahead log when the configuration parameters of the slave node are updated.

[0005] Although the method of synchronizing configuration parameters through write-ahead logs can solve the problem of cumbersome modification of configuration parameters of database clusters compared to the method of modifying configuration parameters of a single database, when an exception occurs in the database cluster, such as when an exception occurs between the slave node and the master node due to information congestion, the configuration parameters cannot be synchronized through the write-ahead log, resulting in inconsistent configuration parameters of the database cluster and low reliability of the database cluster. Summary of the Invention

[0006] In view of the above problems, the present invention is proposed to provide a database configuration parameter synchronization method and storage medium that overcome the above problems or at least partially solve the above problems. It can solve the problem in the prior art that when an abnormality occurs in the database cluster, the configuration parameters of each node are inconsistent, which in turn leads to low reliability of the database cluster.

[0007] Specifically, the present invention provides a method for synchronizing configuration parameters of a database, comprising:

[0008] Determine whether the master node meets the preset conditions;

[0009] If yes, write the configuration parameters of the master node into first network data, and synchronize the first network data to the slave node through an independent network channel;

[0010] After the slave node receives the first network data, update the configuration parameters of the slave node according to the first network data.

[0011] Optionally, the preset condition comprises starting of the master node.

[0012] The writing of the configuration parameters of the master node into the first network data comprises writing all the configuration parameters registered in the parameter file in the master node into the first network data.

[0013] Optionally, the updating of the configuration parameters of the slave node according to the first network data comprises:

[0014] The slave node judges whether the configuration parameters of the slave node are consistent with the configuration parameters in the first network data.

[0015] If no, update the configuration parameters of the slave node.

[0016] Optionally, after the synchronization of the first network data to the slave node through the independent network channel, the configuration parameter synchronization method of the database further comprises: the master node writes a preset effective instruction into second network data, and synchronizes the second network data to the slave node through the independent network channel.

[0017] The updating of the configuration parameters of the slave node according to the first network data comprises:

[0018] When the preset effective instruction is parsed from the second network data received by the slave node, the configuration parameters of the slave node are updated.

[0019] Optionally, the judging of whether the master node meets the preset condition comprises:

[0020] Monitoring the configuration file of the master node through an independent process to judge whether the configuration file is changed.

[0021] If yes, the master node meets the preset condition.

[0022] The writing of the configuration parameters of the master node into the first network data comprises:

[0023] Obtaining the modified configuration parameters in the configuration file.

[0024] Writing the modified configuration parameters into the first network data.

[0025] Optionally, the updating the configuration parameters of the slave node according to the first network data comprises:

[0026] The slave node judges whether the configuration parameters in the first network data are consistent with the corresponding configuration parameters in the slave node.

[0027] If not, the corresponding configuration parameters of the slave node are updated.

[0028] Optionally, after the first network data is synchronized to the slave node through the independent network channel, the configuration parameter synchronization method further comprises:

[0029] The master node judges whether the modified configuration parameters need to be validated.

[0030] If yes, the modified configuration parameters are validated, a preset validation instruction is written into second network data, and the second network data is synchronized to the slave node through the independent network channel.

[0031] When the slave node parses the preset validation instruction from the received second network data, the corresponding configuration parameters in the slave node are updated.

[0032] Optionally, the writing the configuration parameters of the master node into the first network data comprises:

[0033] The master node acquires the configuration parameters according to the use scenario, and records the configuration parameters in the first network data by using a parameter file.

[0034] Optionally, the writing the configuration parameters of the master node into the first network data comprises:

[0035] The master node writes the identifier of the configuration parameters into the first network data, and the identifier comprises the modification type of the configuration parameters.

[0036] According to another aspect of the present application, a machine readable storage medium is also provided, which stores a machine executable program, and the machine executable program is executed by a processor to implement any of the above configuration parameter synchronization methods.

[0037] The database configuration parameter synchronization method of the present invention employs a technical approach in which a master node writes configuration parameters into first network data, synchronizes this first network data to slave nodes via an independent network channel, and then updates the configuration parameters of the slave nodes based on the first network data. Compared to existing solutions in which database clusters synchronize configuration parameters via a write-ahead log, the present invention can synchronize the master node's configuration parameters to the slave nodes via an independent network channel even if an anomaly occurs between the slave and master nodes due to information congestion, allowing the slave nodes to update the configuration parameters and ensuring consistency between the master and slave nodes' configuration parameters, thereby improving the reliability of the database cluster.

[0038] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0040] Figure 1 is a schematic flow chart of a method for synchronizing database configuration parameters according to an embodiment of the present invention;

[0041] Figure 2 is a schematic flow chart of determining whether all configuration parameters of a slave node are consistent with configuration parameters in first network data according to one embodiment of the present invention;

[0042] Figure 3 is a schematic flow chart of a method for synchronizing database configuration parameters when a master node is started according to an embodiment of the present invention;

[0043] Figure 4 is a schematic flow chart of determining whether configuration parameters in first network data are consistent with corresponding configuration parameters of a slave node according to one embodiment of the present invention;

[0044] Figure 5 is a schematic flow chart of a method for synchronizing database configuration parameters when a master node is running and configuration parameters are modified according to an embodiment of the present invention;

[0045] Figure 6 is a schematic structural diagram of a machine-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

[0046] Refer to the following Figures 1 to 6The application discloses a database configuration parameter synchronization method and a storage medium. In the description of the present application, it should be understood that the terms "first", "second" are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second" can explicitly or implicitly include at least one of the features, that is, one or more of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise specifically limited. When a certain feature "includes or contains" a certain or certain features, unless otherwise specifically described, it indicates that other features are not excluded and can further include other features.

[0047] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "illustrative embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0048] Figure 1 The application discloses a database configuration parameter synchronization method according to an embodiment of the present application. The method is suitable for a database cluster in which a master node and a slave node are arranged. When a configuration parameter is modified, the configuration parameter on the master node is modified first, and then the master node synchronizes the modification of the configuration parameter to the slave node.

[0049] As shown in Figure 1 The application discloses a database configuration parameter synchronization method, which comprises the following steps:

[0050] Step S100: determining whether the master node meets a preset condition; if yes, executing step S101.

[0051] Step S101: writing the configuration parameter of the master node into first network data, and synchronizing the first network data to the slave node through an independent network channel.

[0052] Step S102: after the slave node receives the first network data, updating the configuration parameter of the slave node according to the first network data.

[0053] Preferably, the preset condition is that the master node is started, or the preset condition is that the configuration file of the master node is changed.

[0054] For example, when the master node meets the master node startup requirements, the master node writes the configuration parameters into the first network data, and then synchronizes the first network data to each slave node of the database cluster through an independent network channel. After the slave node receives the first network data, the slave node updates the configuration parameters of the slave node according to the configuration parameters in the first network data.

[0055] Through the configuration parameter synchronization method of this embodiment, compared with the prior art solution in which the database cluster synchronizes configuration parameters through a pre-written log, even if an abnormality occurs between the slave node and the master node due to information congestion, the present invention can synchronize the configuration parameters of the master node with the slave node through an independent network channel, so that the slave node updates the configuration parameters, ensuring that the configuration parameters of the master node and the configuration parameters of the slave node remain consistent, thereby improving the reliability of the database cluster.

[0056] In some embodiments of the present invention, the preset conditions include starting the master node; writing the configuration parameters of the master node into the first network data, including: writing all configuration parameters of the master node registered in the parameter file into the first network data.

[0057] In this embodiment, when the preset condition in step S100 is that the master node is started, writing the configuration parameters of the master node into the first network data includes writing all configuration parameters registered in the parameter file of the master node into the first network data, so that the first network data is transmitted to each slave node through an independent network channel, so that each slave node updates inconsistent configuration parameters according to the first network data.

[0058] Through the configuration parameter synchronization method of this embodiment, when the master node is started, all the configuration parameters registered in the parameter file of the master node are written into the first network data, and then transmitted to each slave node through an independent network channel. This allows all the configuration parameters of each slave node in the database cluster to be updated, so that the configuration parameters of the database cluster remain consistent, avoiding the situation where the configuration parameters of the slave node are inconsistent with the configuration parameters of the master node, thereby avoiding the problem of failure due to inconsistent configuration parameters during the operation of the database cluster, and thus improving the reliability of the database cluster.

[0059] In some embodiments of the present invention, Figure 2 As shown, the preset condition is that when the master node starts, the slave node updates the configuration parameters of the slave node according to the first network data, including the following steps:

[0060] Step S300: The slave node obtains the configuration parameters in the first network data and all the configuration parameters in the slave node through the synchronization service of the slave node.

[0061] Step S301: The slave node determines whether all configuration parameters in the slave node are consistent with corresponding configuration parameters in the first network data through the slave node synchronization service; if not, execute step S302; if so, execute step S303.

[0062] Step S302: Update the configuration parameters of the slave node.

[0063] Step S303: The configuration parameters of the slave node remain unchanged.

[0064] Through the configuration parameter synchronization method of this embodiment, when the master node is started, the values ​​of all configuration parameters of the slave nodes are compared and updated with the values ​​of the corresponding configuration parameters in the first network data, so that the values ​​of the configuration parameters of the master node are consistent with the values ​​of the configuration parameters of each slave node, thereby avoiding the problem of failure due to inconsistent configuration parameter values ​​during the operation of the database cluster, thereby improving the reliability of the database cluster.

[0065] In some embodiments of the present invention, after synchronizing the first network data to the slave node through an independent network channel, the database configuration parameter synchronization method also includes: the master node writes the preset effectiveness instruction into the second network data, and synchronizes the second network data to the slave node through an independent network channel.

[0066] Correspondingly, the slave node updates the configuration parameters of the slave node according to the first network data, including: when a preset effectiveness instruction is parsed from the second network data received by the slave node, updating the configuration parameters of the slave node.

[0067] The application of this embodiment is as follows Figure 3 As shown, the steps in the dotted box 100 are performed by the master node, and the steps in the dotted box 200 are performed by the slave node; after the master node is started, the database configuration parameter synchronization method includes the following steps:

[0068] Step S1: After the master node is started, all configuration parameters registered in the parameter file of the master node are obtained.

[0069] Step S2: The master node writes the configuration parameters into the first network data, and synchronizes the first network data to the slave node through an independent network channel.

[0070] Step S3: Receive first network data from the node.

[0071] Step S4: The slave node parses the first network data to obtain corresponding configuration parameters.

[0072] Step S5: The slave node modifies the configuration parameters on the slave node accordingly according to the parsed configuration parameters.

[0073] Step S6: The master node determines whether all configuration parameters are written into the first network data. If yes, the master node executes step S7; if not, the master node returns to step S2.

[0074] Step S7: The master node writes the preset effective instruction into the second network data, and synchronizes the second network data to the slave node through an independent network channel.

[0075] Step S8: Receive second network data from the node.

[0076] Step S9: The slave node parses the second network data to obtain the preset effective instruction therein.

[0077] Step S10: The slave node executes the preset validation instruction to make all modified configuration parameters in the slave node effective.

[0078] In this embodiment, after the master node executes step S2, the slave nodes simultaneously execute step S3; and the master node executes step S6.

[0079] Through the configuration parameter synchronization method of this embodiment, after the master node completes writing all configuration parameters registered in the parameter file into the first network data, the master node writes the preset effectiveness instruction into the second network data and synchronizes it to each slave node, so that the slave node updates the configuration parameters according to the second network data, that is, changes the status of the configuration parameters in each slave node, so that the configuration parameters of each slave node take effect immediately, thereby allowing the database cluster to be quickly put into use.

[0080] In some embodiments of the present invention, determining whether the master node meets the preset conditions includes: monitoring the configuration file of the master node through an independent process to determine whether the configuration file has changed; if so, the master node meets the preset conditions.

[0081] Correspondingly, writing the configuration parameters of the master node into the first network data includes: the master node obtaining the modified configuration parameters in the configuration file; and writing the modified configuration parameters into the first network data.

[0082] In this embodiment, when the master node is in operation, when the independent process of the master node detects that the configuration file of the master node has changed, the master node obtains the modified configuration parameters in the configuration file and writes the modified configuration parameters into the first network data, so that after the master node writes the configuration parameters to be modified into the first network data, the first network data is synchronized to each slave node through an independent network channel.

[0083] With the configuration parameter synchronization method of this embodiment, when a master node is running and an independent process in the master node detects a change in the master node's configuration file, the master node obtains the modified configuration parameters in the configuration file and writes them into the first network data. The master node then synchronizes the first network data to each slave node via an independent network channel. This reduces the number of configuration parameters synchronized in the first network data, thereby saving the time it takes for the slave nodes to modify the configuration parameters and improving the efficiency of each slave node in modifying the configuration parameters.

[0084] In some embodiments of the present invention, Figure 4 As shown, when the master node is in a running state and detects that a configuration file of the master node has changed, the slave node updates the configuration parameters of the slave node according to the first network data, including the following steps:

[0085] Step S500: The slave node obtains the configuration parameters in the first network data and the corresponding configuration parameters of the slave node through the synchronization service of the slave node.

[0086] Step S501: The slave node determines whether the configuration parameters in the first network data are consistent with the corresponding configuration parameters in the slave node through the slave node synchronization service; if not, execute step S502; if so, execute step S503.

[0087] Step S502: Update the corresponding configuration parameters of the slave node.

[0088] Step S503: The configuration parameters of the slave node remain unchanged.

[0089] Through the configuration parameter synchronization method of this embodiment, the slave node changes the inconsistent configuration parameters in the slave node according to the configuration parameters in the first network data, so that the configuration parameters of the slave node are consistent with the configuration parameters of the master node, thereby avoiding the problem of failure due to inconsistent configuration parameters during the operation of the database cluster, thereby improving the security and reliability of the operation of the database cluster.

[0090] In some embodiments of the present invention, when the master node detects that a configuration file of the master node has changed, and after the master node synchronizes the first network data to the slave node through an independent network channel, the database configuration parameter synchronization method further includes:

[0091] The master node determines whether the modified configuration parameters need to take effect;

[0092] If so, the modified configuration parameters are made effective, and the preset effective instruction is written into the second network data, and the second network data is synchronized to the slave node through an independent network channel;

[0093] When the preset effective instruction is parsed from the second network data received by the slave node, the corresponding configuration parameters in the slave node are updated.

[0094] The application of this embodiment is as follows Figure 5 As shown, the steps in the dotted box 100 are performed by the master node, and the steps in the dotted box 200 are performed by the slave node; when the master node detects that the configuration file of the master node has changed, the database configuration parameter synchronization method includes the following steps:

[0095] Step S21: During the operation of the master node, the master node monitors whether the configuration file of the master node has changed through an independent process; if so, step S22 is executed.

[0096] Step S22: The master node obtains the modified configuration parameters in the configuration file.

[0097] Step S23: The master node writes the modified configuration parameters into the first network data, and synchronizes the first network data to the slave node through an independent network channel.

[0098] Step S24: Receive first network data from the node.

[0099] Step S25: The slave node parses the first network data to obtain corresponding configuration parameters.

[0100] Step S26: The slave node modifies the configuration parameters on the slave node accordingly according to the parsed configuration parameters.

[0101] Step S27: The master node determines whether to make the modified configuration parameters effective; if so, execute step S28.

[0102] Step S28: The master node writes the preset effective instruction into the second network data, and synchronizes the second network data to the slave node through an independent network channel.

[0103] Step S29: Receive second network data from the node.

[0104] Step S30: Parsing the second network data from the node to obtain the preset effective instruction therein.

[0105] Step S31: The slave node executes a preset validation instruction to make the modified configuration parameters in the slave node effective.

[0106] Through the configuration parameter synchronization method of this embodiment, when the master node is in operation and the configuration parameters of the master node are modified, the master node determines whether to make the modified configuration parameters in each slave node effective, and can again confirm whether the modified configuration parameters of each slave node need to be applied in full.

[0107] Alternatively, when the master node is in operation and configuration parameters of the master node are modified, the master node determines whether to make the modified configuration parameters of the master node and each slave node effective, thereby confirming again whether all modified configuration parameters of the master node and each slave node need to be applied.

[0108] The above two judgment methods avoid the problem of database cluster failure caused by errors in the modified configuration parameters of the slave node and the modified configuration parameters taking effect immediately, thereby improving the security of the database cluster operation.

[0109] Furthermore, the user can set the effective time of the modified configuration parameters in the master node according to the actual situation, so that the master node will periodically write the preset effective instructions into the second network data and synchronize the second network data to the slave node, so that the modified configuration parameters in the slave node can take effect at a regular interval, thereby improving the controllability of the effectiveness of the modified configuration parameters in the slave node.

[0110] In some embodiments of the present invention, writing the configuration parameters of the master node into the first network data includes: the master node obtains the configuration parameters according to the usage scenario, and records the configuration parameters in the first network data using a parameter file.

[0111] In this embodiment, when the usage scenario is started as a master node, all configuration parameters are obtained in the master node, and then all are registered in the parameter file, and then the configuration parameters are recorded in the first network data in the master node according to the parameter file, so that all configuration parameters of each slave node in the database cluster are updated to keep the configuration parameters of the database cluster consistent.

[0112] Alternatively, when the usage scenario is that the database cluster is running, the master node is in running state and the configuration file of the master node is changed, the master node obtains the modified configuration parameters in the configuration file and records them in the parameter file. Then the master node writes the modified configuration parameters into the first network data according to the parameter file, so as to update the corresponding configuration parameters in each slave node, so that the configuration parameters of each node in the database cluster remain consistent.

[0113] Through the configuration parameter synchronization method of this embodiment, the number of configuration parameters recorded in the first network data varies depending on the usage scenario, so as to save the time of modifying the configuration parameters of the slave node, thereby improving the work efficiency of the master node writing the configuration parameters into the first network data and synchronizing them to each slave node through an independent network channel.

[0114] In some embodiments of the present invention, the configuration parameter structure recorded in the parameter file in the master node is shown in Table (1):

[0115] Table (1)

[0116]

[0117]

[0118] Among them, one recording method is: the name is the name of the configuration parameter, the parameter type is the type of the configuration parameter, and the description is other content of the configuration parameter, such as the parameter value of the configuration parameter, whether it has been modified, whether it is effective, and other information.

[0119] In some embodiments of the present invention, writing the configuration parameters of the master node into the first network data includes: the master node writing an identifier of the configuration parameter into the first network data, where the identifier includes a modification type of the configuration parameter.

[0120] The modification type can be deletion, addition, or modification; the parameter name is the name of the configuration parameter being modified; and the parameter value is the value of the configuration parameter being modified.

[0121] For example, when the master node adds or deletes configuration parameters in the parameter file, the data format for recording the configuration parameters is shown in Table (2):

[0122] Table (2)

[0123] item value Logo 2 or 3 (add or delete) Configuration parameter name Parameter name

[0124] In Table (2), when the value of the identifier is 2, the modification type of the configuration parameter is adding the configuration parameter; when the value of the identifier is 3, the modification type of the configuration parameter is deleting the configuration parameter.

[0125] For example, when the master node modifies the configuration parameters in the parameter file, the data format for recording the configuration parameters is shown in Table (3):

[0126] Table (3)

[0127] item value Logo 1(Modified) Configuration parameter name Parameter name Configuration parameter values Latest value

[0128] In Table (3), when the value of the identifier is 1, the modification type of the configuration parameter is modification of the configuration parameter, and the latest value is the modified configuration parameter value.

[0129] When the master node synchronizes configuration parameters to the slave node via first network data, the configuration parameter information recorded in the first network data includes the modification type. In this embodiment, after receiving the first network data, the slave node obtains the configuration parameter information from the first network data, then obtains the configuration parameter modification type and parameter validation instructions from this information, and modifies the corresponding configuration parameters of the slave node based on the configuration parameter modification type. After parsing the preset validation instructions from the received second network data, the slave node can compare the preset validation instructions with the parameter validation instructions in the configuration parameter information to determine whether the two are consistent. If they are consistent, the slave node validates the modified configuration parameters, thereby updating the configuration parameters of the slave node.

[0130] With the configuration parameter synchronization method of this embodiment, the slave node determines the configuration parameter modification type and parameter validation instructions based on the configuration parameter information recorded in the first network data, allowing the slave node to modify the configuration parameters accordingly and validate the modified configuration parameters, thereby improving the reliability of configuration parameter modifications. Furthermore, the user can set the preset validation instructions in the second network data based on the parameter validation instructions of the configuration parameters, selectively validating the modified configuration parameters, thereby improving the controllability of configuration parameter updates in the slave node.

[0131] The present invention also provides a machine-readable storage medium. Figure 6 4 is a schematic diagram of a machine-readable storage medium 40 according to an embodiment of the present invention. The machine-readable storage medium 40 stores a machine executable program 41 thereon. When the machine executable program 41 is executed by a processor, the configuration parameter synchronization method of any of the above embodiments is implemented.

[0132] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.

[0133] For the purposes of the description of this embodiment, the machine-readable storage medium 40 can be any device that can contain, store, communicate, propagate, or transmit a program for use with an instruction execution system, device, or apparatus, or in conjunction with such instruction execution systems, devices, or apparatuses. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or more wirings (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium 40 can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, deciphering, or processing in other suitable ways as necessary, and then stored in a computer memory.

[0134] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0135] The processor may be connected to an I / O interface (input / output interface) suitable for connecting the computer device to one or more I / O devices (input / output devices) via a system interconnect (e.g., PCI, PCI-Express, etc.). The I / O devices may include, for example, a keyboard and a pointing device, wherein the pointing device may include a touchpad or a touch screen, etc. The I / O devices may be built-in components of the computer device, or may be devices externally connected to the computing device.

[0136] The processor can also be linked to a display interface suitable for connecting a computer device to a display device through a system interconnection. The display device can include a display screen as a built-in component of the computer device. The display device can also include a computer monitor, a television or a projector, etc. that are externally connected to the computer device. In addition, a network interface controller (NIC) can be suitable for connecting the computer device to a network through a system interconnection. In certain embodiments, the NIC can use any suitable interface or protocol (such as an Internet Small Computer System Interface, etc.) to transmit data. The network can be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN) or the Internet, etc. Remote devices can be connected to the computing device through a network.

[0137] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical ideas provided by the method of this embodiment, additional changes can be made to the above method.

[0138] At this point, those skilled in the art will recognize that, although a number of exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications consistent with the principles of the present invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

Claims

1. A method for synchronizing configuration parameters of a database, characterized in that: include: Determine whether the master node meets the preset conditions; The preset conditions include the master node being started or the configuration file of the master node being changed; If so, writing the configuration parameters of the master node into the first network data, and synchronizing the first network data to the slave node through an independent network channel; After the slave node receives the first network data, updating the configuration parameters of the slave node according to the first network data; After synchronizing the first network data to the slave node through the independent network channel, the method further includes: The master node writes the preset effective instruction into the second network data, and synchronizes the second network data to the slave node through the independent network channel; Updating the configuration parameters of the slave node according to the first network data includes: When a preset effective instruction is parsed from the second network data received by the slave node, the configuration parameters of the slave node are updated.

2. The configuration parameter synchronization method according to claim 1, characterized in that: When the preset condition is that the master node is started, writing the configuration parameters of the master node into the first network data includes: All configuration parameters registered in the parameter file in the master node are written into the first network data.

3. The configuration parameter synchronization method according to claim 2, characterized in that: Updating the configuration parameters of the slave node according to the first network data includes: The slave node determines whether the configuration parameters of the slave node are consistent with the configuration parameters in the first network data; If not, the configuration parameters of the slave node are updated.

4. The configuration parameter synchronization method according to claim 1, characterized in that: The determination of whether the master node meets the preset conditions includes: Monitoring the configuration file of the master node through an independent process to determine whether the configuration file has changed; If so, the master node meets the preset condition; The step of writing the configuration parameters of the master node into the first network data includes: Obtaining the modified configuration parameters in the configuration file; The modified configuration parameters are written into the first network data.

5. The configuration parameter synchronization method according to claim 4, characterized in that: Updating the configuration parameters of the slave node according to the first network data includes: The slave node determines whether the configuration parameters in the first network data are consistent with the corresponding configuration parameters in the slave node; If not, the corresponding configuration parameters of the slave node are updated.

6. The configuration parameter synchronization method according to claim 4 or 5, characterized in that: After synchronizing the first network data to the slave node through the independent network channel, the method further includes: The master node determines whether the modified configuration parameters need to be made effective; If so, the modified configuration parameters are made effective, and a preset effective instruction is written into the second network data, and the second network data is synchronized to the slave node through the independent network channel; When a preset effective instruction is parsed from the second network data received by the slave node, the corresponding configuration parameters in the slave node are updated.

7. The configuration parameter synchronization method according to claim 6, characterized in that: The step of writing the configuration parameters of the master node into the first network data includes: The master node obtains the configuration parameters according to the usage scenario, and records the configuration parameters in the first network data using a parameter file.

8. The configuration parameter synchronization method according to claim 1, characterized in that: The step of writing the configuration parameters of the master node into the first network data includes: The master node writes the identifier of the configuration parameter into the first network data, where the identifier includes the modification type of the configuration parameter.

9. A machine-readable storage medium having a machine-executable program stored thereon, wherein the machine-executable program, when executed by a processor, implements the configuration parameter synchronization method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and system for transmitting archived logs and medium

    CN112910694A