Method and apparatus for updating configuration information, storage medium and electronic device
By setting up storage units that separate data from operation instructions in the configuration center of the cloud storage cluster, and following the order of updating data first and then issuing instructions, the problem of inconsistent configuration information of distributed network file system nodes is solved, and efficient and reliable configuration synchronization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-05
AI Technical Summary
The node configuration information of distributed network file systems is difficult to maintain strong consistency in real time and reliably. Existing technologies suffer from high synchronization latency, and long-term inconsistencies in configuration caused by human error or script errors.
In the configuration center of the cloud storage cluster, a first storage unit and a second storage unit are set up. The first storage unit is used to store the configuration information of the network file system, and the second storage unit is used to store the operation instructions of the gateway node. By updating the data first and then issuing the instructions, the update of the instructions is used as a trigger signal to realize the batch and unified update of the configuration information of the gateway node.
It achieves real-time and reliable consistency of configuration information of distributed network file system nodes, reduces system complexity and operation and maintenance costs, improves the real-time performance and reliability of configuration synchronization, and reduces the risk of configuration inconsistency caused by human error.
Smart Images

Figure CN122160251A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud service technology, and in particular to a method and apparatus for updating configuration information, a storage medium and an electronic device. Background Technology
[0002] With the advent of the cloud computing and big data era, distributed cloud storage clusters have become the mainstream architecture in the data storage field due to their advantages of high scalability, high reliability, and low cost. Network File System (NFS) is commonly deployed in such clusters, providing standardized file sharing services to a large number of clients. To meet the requirements of high availability and load balancing, NFS services in cloud storage clusters typically need to run simultaneously on multiple physical or virtual nodes. This means that the configuration files on all NFS service nodes must remain strictly consistent. Currently, the industry mainly maintains NFS configuration consistency by pushing configuration files to each node from a central server based on a centralized configuration management tool. However, the push process has a time window and cannot guarantee the atomicity of the operation. Placing the configuration files in shared storage for all nodes to read, while solving the consistency problem, introduces and maintains a complete distributed storage system just to synchronize a small number of configuration files, greatly increasing the complexity of the system and the cost of operation and maintenance. Relying on administrators to manually or through scheduled scripts to synchronize files offers the worst consistency guarantee, high synchronization latency, and is highly susceptible to long-term configuration inconsistencies due to human error or script errors.
[0003] This shows that the related technologies suffer from the problem that the node configuration information of distributed network file systems is difficult to maintain strong consistency in real time and reliably. Summary of the Invention
[0004] This application provides a method, apparatus, storage medium, and electronic device for updating configuration information, to at least solve the problem in the related art that it is difficult to maintain strong consistency of node configuration information in distributed network file systems in real time and reliably.
[0005] This application provides a method for updating configuration information, applied to a network file system running on a cloud storage cluster, the network file system including multiple gateway nodes, comprising: setting a first storage unit and a second storage unit in the configuration center of the cloud storage cluster, wherein the first storage unit is used to store the configuration information of the network file system, the second storage unit is used to store the operation instructions of the gateway nodes, and the second storage unit is updated after the first storage unit is updated; when it is determined that the second storage unit is updated, the configuration information of the multiple gateway nodes is updated to the configuration information in the first storage unit.
[0006] This application also provides a configuration information updating device, comprising: a setting module, configured to set a first storage unit and a second storage unit in the configuration center of a cloud storage cluster, wherein the first storage unit is used to store configuration information of a network file system, the second storage unit is used to store operation instructions of gateway nodes, and the second storage unit is updated after the first storage unit is updated; and an updating module, configured to update the configuration information of multiple gateway nodes to the configuration information in the first storage unit when it is determined that the second storage unit has been updated.
[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described configuration information update methods when executing the computer program.
[0008] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described configuration information update methods.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described configuration information update methods.
[0010] This application allows for the configuration of a first storage unit and a second storage unit within the cloud storage cluster's configuration center. The first storage unit stores configuration information for the network file system, while the second storage unit stores operation instructions for gateway nodes. The second storage unit is updated after the first storage unit is updated. Upon determining that the second storage unit is updated, the configuration information of the multiple gateway nodes is updated to match the configuration information in the first storage unit. By separating configuration data and operation instructions into two storage units and following a sequence of updating data before issuing instructions, the update of instructions serves as a trigger signal, enabling batch and unified updates of configuration information for all gateway nodes. This solves the technical problem of maintaining strong consistency of node configuration information in a distributed network file system in real-time and reliably, achieving the technical effect of maintaining the consistency of node configuration information in a distributed network file system in real-time and reliably. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1This is a hardware structure block diagram of a configuration information updating method according to an embodiment of this application;
[0013] Figure 2 This is a flowchart illustrating an optional method for updating configuration information according to an embodiment of this application;
[0014] Figure 3 This is a schematic diagram of an optional configuration management system architecture according to an embodiment of this application;
[0015] Figure 4 This is a flowchart of an optional method for updating configuration information according to an embodiment of this application;
[0016] Figure 5 This is a structural block diagram of an optional configuration information updating device according to an embodiment of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0018] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0019] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] The specific application environment architecture or specific hardware architecture on which the method for updating configuration information depends is described here.
[0021] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of the configuration information update method according to an embodiment of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the image. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0022] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the configuration information update method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0023] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0024] Figure 2 This is a flowchart illustrating an optional configuration information update method according to an embodiment of this application. The method is applied to a network file system, which runs on a cloud storage cluster and includes multiple gateway nodes, such as... Figure 2 As shown, the process of this method may include the following steps:
[0025] Step S202: Set up a first storage unit and a second storage unit in the configuration center of the cloud storage cluster. The first storage unit is used to store the configuration information of the network file system, and the second storage unit is used to store the operation instructions of the gateway node. The second storage unit is updated after the first storage unit is updated.
[0026] Optionally, in step S202 above, the MON (Monitor) module can act as the configuration center of the cloud storage cluster. The MON module is a core metadata management component in the distributed storage system. Setting up the first and second storage units involves creating two key-value pairs in the MON module: one key-value pair named `nfs-conf-data`, used to store the full text of the configuration file; and another key-value pair named `nfs-conf-cmd`, used to receive operation commands initiated to the storage gateway node.
[0027] Step S204: If it is determined that the second storage unit has been updated, the configuration information of multiple gateway nodes is updated to the configuration information in the first storage unit.
[0028] Through the above steps, a first storage unit and a second storage unit can be set up in the configuration center of the cloud storage cluster. The first storage unit stores the configuration information of the network file system, and the second storage unit stores the operation instructions of the gateway nodes. The second storage unit is updated after the first storage unit is updated. When it is determined that the second storage unit is updated, the configuration information of multiple gateway nodes is updated with the configuration information in the first storage unit. By setting up two storage units that separate configuration data and operation instructions, and following the order of updating data first and then issuing instructions, the batch and unified update of the configuration information of all gateway nodes is achieved using the update of instructions as a trigger signal. This solves the technical problem that it is difficult to maintain strong consistency of node configuration information in a distributed network file system in real time and reliably, and achieves the technical effect of maintaining the consistency of node configuration information in a distributed network file system in real time and reliably.
[0029] In an exemplary embodiment, after setting up a first storage unit and a second storage unit in the configuration center of the cloud storage cluster, the method further includes: receiving first configuration information and a first operation instruction written by a target object through the management interface of the network file system; updating the configuration information in the first storage unit to the first configuration information to update the first storage unit; and after determining that the first storage unit has been updated, updating the current operation instruction in the second storage unit to the first operation instruction to update the second storage unit.
[0030] Optionally, in the above embodiments, the management interface module is an operation interface independent of the NFS gateway node. When a user performs configuration change operations through this interface (e.g., adding a new shared directory / data / share1 and setting its access permissions), the module does not directly modify any local configuration files on the NFS gateway node. Instead, it first writes the completely new NFS configuration file content (i.e., the full text of the / etc / exports file containing the information of the newly added shared directory) as a value to the first storage unit of the configuration center (i.e., the key-value pair with the key nfs-conf-data). Next, the management interface module generates a lightweight operation command corresponding to this change, such as a structured JSON string {"action":"reload","version": "20240524001"} or a more refined {"export":"add","target":" / data / share1","version": "20240524001"}, and writes this command as the value to the second storage unit (i.e., a key-value pair with the key nfs-conf-cmd). This order of updating the data key first and then the command key is designed as an atomic operation sequence, ensuring that the corresponding new configuration data is already correctly ready in the configuration center when the command is issued, thus avoiding the risk of nodes pulling old or invalid configurations due to disordered order.
[0031] The above embodiments achieve the instructive and atomic nature of the configuration change process. Traditional file-level operations are abstracted into serialized updates of centralized state data and control commands, fundamentally eliminating configuration inconsistencies caused by push timing or network latency in a distributed environment. The management interface, serving as a unified entry point for changes, accurately and reliably translates user intents into internal cluster events, laying a solid foundation for subsequent strong consistency synchronization.
[0032] In an exemplary embodiment, before updating the configuration information of multiple gateway nodes to the configuration information in the first storage unit, the method further includes: determining the initialization code started by each gateway node in the network file system, the initialization code including callback function registration code; after each gateway node is initialized by the initialization code, generating a callback function for each gateway node according to the callback function registration code, wherein the callback function of each gateway node is used to subscribe to change events of the second storage unit.
[0033] Optionally, in the above embodiments, the initialization process is a crucial step when each NFS gateway node service starts. The initialization code of the NFS service process embeds logic for registering with the cloud storage cluster MON. Specifically, this code calls the API provided by MON, sending information such as the reference address of a callback function of this node to the MON module, and explicitly declares subscription to change events of the second storage unit (nfs-conf-cmd key) (i.e., the event when the value of this key is modified). The MON module, acting as a configuration center, maintains a list of subscribers, recording the callback function subscription relationships of all NFS nodes. In this way, an event-driven bus based on a publish-subscribe pattern is built between MON and all NFS nodes, with MON acting as an event broadcaster.
[0034] Through the above embodiments, a highly efficient and reliable event-driven communication mechanism has been established. It replaces the traditional approach that requires polling or reliance on external configuration management tools for proactive push notifications, resulting in extremely high real-time triggering of configuration changes. Once an instruction is issued, the MON can immediately detect it and notify all nodes, avoiding the latency and resource waste caused by polling. Furthermore, since the subscription relationship is maintained by the cluster's own highly available MON module, even if a node experiences a brief downtime and recovers, it can re-register and continue receiving events, enhancing the system's fault tolerance.
[0035] In one exemplary embodiment, updating the configuration information of multiple gateway nodes to the configuration information in the first storage unit includes: responding to a change event in the second storage unit by sending a change notification to each gateway node through a callback function of each gateway node; after determining that each gateway node has received the change notification, reading a second operation instruction stored in the second storage unit from the configuration center, wherein the second operation instruction is used to reload the configuration information; reading second configuration information from the first storage unit from the configuration center according to the second operation instruction, wherein the second configuration information is the complete configuration information in the first storage unit; and updating the current configuration information of each gateway node to the second configuration information.
[0036] Optionally, in the above embodiments, the configuration update execution process is a refined closed-loop process. When the management interface updates the second storage unit (nfs-conf-cmd), the object notification mechanism built into the MON module will immediately detect this change event. Subsequently, MON will traverse its maintained subscriber list and initiate remote calls (i.e., send change notifications) to the callback functions of each registered NFS gateway node in the list. After each node's callback function is triggered, it will first actively connect to MON and read the latest value of the nfs-conf-cmd key, i.e., the operation command. The callback function will parse the command content, for example, determine whether to perform "reload configuration" (corresponding to the command {"action":"reload"}) or "add share" (corresponding to the command {"export":"add",...}). Then, according to the command's guidance, the callback function will again actively pull the current complete configuration information (i.e., the latest / etc / exports file content) from the first storage unit (nfs-conf-data key) of MON. After retrieving the latest configuration, the callback function performs two key operations: 1) it overwrites the retrieved configuration content into the local NFS configuration file (e.g., / etc / exports); 2) based on the parsed instruction type, it calls the corresponding system command (e.g., executing `exportfs -r` to reload the configuration and make it effective) or the NFS service's internal interface. This process enables dynamic configuration activation, typically without requiring a restart of the entire NFS service process, thus ensuring high availability of the business.
[0037] The above embodiments combine the real-time advantages of event-driven notifications with the reliability of proactive data retrieval. Nodes only proactively retrieve data after receiving an event notification, avoiding issues such as network congestion and uneven node processing capabilities that can occur with unidirectional push from a central node, and eliminating performance dependence on a central node. This notification-retrieval-execution model ensures that each node can independently and reliably obtain and apply completely consistent configuration content, ultimately achieving strong consistency of NFS service configuration across the cluster. Simultaneously, it supports dynamic application via commands, significantly reducing service interruption time caused by configuration changes.
[0038] In one exemplary embodiment, after determining that each gateway node has received a change notification, the method further includes: reading a third operation instruction from a second storage unit in a configuration center, wherein the third operation instruction is used to load target configuration information; reading third configuration information from a first storage unit in a configuration center according to the third operation instruction, wherein the third configuration information is the target configuration information in the first storage unit; and updating the target configuration information of each gateway node to the third configuration information.
[0039] Optionally, in the above embodiments, the design of the operation instructions has fine-grained control capabilities. Besides triggering a full configuration reload, the instructions can also specify more specific operation targets. For example, the instruction could be {"action":"update","section":"export_78","version":"20240524002"}, which includes the identifier of the target configuration section. When the node's callback function parses such an instruction, it does not fetch and overwrite the entire configuration file. Instead, it may parse only the configuration fragment related to export_78 from the complete configuration information stored in the first storage unit (or based on the difference information in the instruction), and then only update the corresponding part of the local configuration file. This is suitable for scenarios where only a specific shared directory parameter needs to be modified.
[0040] The above embodiments achieve granular control over configuration changes. Fine-grained instructions support incremental updates or hot updates for specific functions, reducing unnecessary data transfer and local file I / O operations. This is particularly beneficial in scenarios with numerous or frequently changing configuration items, significantly improving synchronization efficiency and system performance while reducing network and node resource consumption.
[0041] In an exemplary embodiment, after determining that each gateway node has received a change notification, the method further includes: reading a fourth operation instruction stored in the second storage unit from the configuration center, wherein the fourth operation instruction is used to adjust the enabling status of a target function of the network file system, and the enabling status of the target function is determined by the status identifier of the target function; and adjusting the current status identifier of the target function of each gateway node to the target status identifier by executing the fourth operation instruction.
[0042] Optionally, in the above embodiments, the operation instructions can be used to dynamically manage specific functions of the NFS service. For example, the instruction {"action":"toggle_feature","feature":"detailed_logging", "enable":true} is intended to dynamically enable the detailed logging function. After the node's callback function is parsed, it does not need to modify the main configuration file. Instead, it directly calls the management interface inside the NFS service process to dynamically adjust the running parameters of the corresponding functional module (such as modifying the log level flag). This adjustment is a memory-level hot update, which can take effect immediately and does not affect the client requests being processed.
[0043] The above embodiments expand the scope of configuration management from static file configuration to dynamic runtime behavior control. It allows administrators to fine-tune various functions of the NFS service without interrupting service, greatly improving system operational flexibility and service continuity, and meeting the stringent high availability requirements of cloud environments.
[0044] In one exemplary embodiment, after determining that each gateway node has received a change notification, the method further includes: reading a fifth operation instruction stored in a second storage unit from a configuration center, wherein the fifth operation instruction is used to restart the gateway node; after restarting each gateway node according to the fifth operation instruction, reading configuration information from a first storage unit from the configuration center; and updating the current configuration information of each gateway node to the configuration information of the first storage unit.
[0045] Optionally, in the above embodiments, the operation instruction may include special changes that require a node restart to take effect (such as kernel parameter adjustments or deep module updates), and the instruction may be {"action": "restart_service"}. When the node's callback function parses this instruction, it will terminate the current NFS service process according to the safety procedure and then restart the process. During the startup initialization phase of the NFS service process (i.e., when executing the aforementioned initialization code), its built-in logic will actively query the MON for the latest configuration information in the first storage unit (nfs-conf-data) and start the service based on this configuration. This ensures that after a node undergoes a restart (whether it is planned maintenance or fault recovery), it can automatically synchronize to the latest configuration state of the cluster, without inconsistencies caused by the presence of old configurations locally.
[0046] The above embodiments improve configuration consistency guarantees in node lifecycle management (such as restart and fault recovery). By embedding the configuration retrieval logic into the service startup initialization phase, it ensures that nodes automatically synchronize with the latest cluster configuration after startup under any circumstances, achieving full lifecycle coverage of configuration management. This further enhances the system's reliability and self-healing capabilities, and reduces the need for manual intervention and potential errors.
[0047] In an optional embodiment, the instruction-driven cloud storage cluster NFS service configuration management method of this application can be applied to, for example... Figure 3The configuration management system shown is deeply integrated into the cloud storage cluster and mainly consists of four core modules that work together: a management interface module, which serves as the user's entry point, generating and pushing configuration data (data keys), as well as generating and issuing control commands (command keys); a configuration center module, implemented by the cloud storage cluster's metadata management module (MON), which acts as the system's single trusted source, responsible for persistently storing data keys and command keys, and receiving and managing callback registrations from the NFS service; a configuration agent module, embedded within the NFS service process of each NFS gateway node, which actively retrieves data keys and ultimately parses and executes command keys; and an event-driven bus module, which is powered by the native object notification mechanism in MON, acting as the system's nervous system, responsible for triggering callback notifications to all registered NFS nodes in real time and reliably when command key changes are detected. Through modular design, this system decouples configuration storage, changes, notifications, and execution, achieving centralized, command-based, and automated configuration management.
[0048] In an optional embodiment, the process of implementing the NFS service configuration management method through the above configuration management system is as follows: Figure 4 As shown, the specific steps include:
[0049] 1. Module initialization: In the initial stage of system startup, each module completes its own preparation work.
[0050] 2. Create two key-value pairs in MON: In the built-in database of the configuration center module MON, pre-create two specific key-value pairs, for example, named nfs-conf-data (data key, used to store the complete NFS configuration file content) and nfs-conf-cmd (command key, used to store operation commands).
[0051] 3. Each NFS service registers a callback function with the MON upon startup and subscribes to nfs-conf-cmd change events: When the NFS service process on each NFS gateway node starts, its embedded configuration agent module automatically registers a callback function with the configuration center module MON and declares its subscription to change events of the command key (nfs-conf-cmd). MON records this subscription relationship.
[0052] 4. User operations through the management interface: Users can perform configuration management operations, such as creating new shared directories, through a separate management interface module.
[0053] 5. The management interface writes the new configuration to the nfs-conf-data key: The management interface module first writes the new and complete configuration content to the data key (nfs-conf-data) in MON.
[0054] 6. The management interface generates an instruction and writes it to the nfs-conf-cmd key: Next, the management interface module generates an instruction describing this change action (e.g., {"action":"exportfs_reload"}) and writes it to the instruction key (nfs-conf-cmd) in MON. Steps 5 and 6 constitute an atomic operation sequence.
[0055] 7. MON detects that nfs-conf-cmd has been modified: The Configuration Center Module (MON) continuously monitors the key status. Once it detects that the command key (nfs-conf-cmd) has been modified, it immediately triggers an event.
[0056] 8. MON sends change events to all subscribed NFS nodes through the Object mechanism: The event-driven bus module (MON's Object notification mechanism) is activated, sending change event notifications to all NFS nodes that registered callback functions in step 3.
[0057] 9. NFS node callback functions are triggered: The callback functions pre-registered in the configuration agent module on each NFS node are invoked and executed upon receiving an event notification.
[0058] 10. Callback function fetches the latest configuration from nfs-conf-data: The triggered callback function first actively fetches the latest complete configuration content from the MON data key (nfs-conf-data).
[0059] 11. Whether to execute the command: The callback function parses the command content read from the command key (nfs-conf-cmd) and determines the specific operation to be performed, such as updating or reloading the configuration, dynamically enabling a certain function, etc.
[0060] 12-1. Execute the corresponding command: Based on the command parsing result, configure the agent module to perform the corresponding operation, such as calling the system command exportfs -r to reload the NFS configuration and make the new configuration take effect.
[0061] 12-2. Update only local configuration.
[0062] 13. Configuration takes effect and cluster status is consistent: All NFS nodes have completed the pull of the latest configuration and execution of commands, thereby ensuring that the configuration of all NFS services in the entire cloud storage cluster reaches a strongly consistent state.
[0063] Through the above embodiments, this application successfully solves the core pain points of NFS service configuration management in distributed cloud storage clusters, and provides an integrated solution that combines strong consistency, high real-time performance, high availability, simple architecture and convenient operation and maintenance, providing key technical support for building stable and efficient cloud storage services.
[0064] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (e.g., read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0065] According to another aspect of the embodiments of this application, a configuration information updating device is also provided. This configuration information updating device can be used to implement the configuration information updating method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0066] Figure 5 This is a structural block diagram of an optional configuration information updating device according to an embodiment of this application, such as... Figure 5 As shown, the device for updating the configuration information includes:
[0067] The configuration module 52 is used to set up a first storage unit and a second storage unit in the configuration center of the cloud storage cluster. The first storage unit is used to store the configuration information of the network file system, and the second storage unit is used to store the operation instructions of the gateway node. The second storage unit is updated after the first storage unit is updated.
[0068] The update module 54 is used to update the configuration information of multiple gateway nodes to the configuration information in the first storage unit when it is determined that the second storage unit has been updated.
[0069] The configuration information updating device provided in this application allows for the setup of a first storage unit and a second storage unit in the configuration center of a cloud storage cluster. The first storage unit stores configuration information for the network file system, while the second storage unit stores operation instructions for gateway nodes. The second storage unit is updated after the first storage unit is updated. When an update to the second storage unit is confirmed, the configuration information of multiple gateway nodes is updated to match the information in the first storage unit. By separating configuration data and operation instructions into two storage units and following the order of updating data first and then issuing instructions, the update of instructions serves as a trigger signal, enabling batch and unified updates of configuration information for all gateway nodes. This solves the technical problem of maintaining strong consistency of node configuration information in a distributed network file system in real time and reliably, achieving the technical effect of maintaining the consistency of node configuration information in a distributed network file system in real time and reliably.
[0070] In an exemplary embodiment, the setting module 52 is configured to receive first configuration information and first operation instructions written by the target object through the management interface of the network file system; update the configuration information in the first storage unit to the first configuration information to update the first storage unit; and after determining that the first storage unit has been updated, update the current operation instructions in the second storage unit to the first operation instructions to update the second storage unit.
[0071] In one exemplary embodiment, the update module 54 is configured to determine the initialization code started by each gateway node in the network file system, the initialization code including callback function registration code; after each gateway node is initialized by the initialization code, a callback function for each gateway node is generated according to the callback function registration code, wherein the callback function of each gateway node is used to subscribe to change events of the second storage unit.
[0072] In an exemplary embodiment, the update module 54 is configured to, in response to a change event of the second storage unit, send a change notification to each gateway node through a callback function of each gateway node; after determining that each gateway node has received the change notification, read a second operation instruction stored in the second storage unit from the configuration center, wherein the second operation instruction is used to reload configuration information; read second configuration information of the first storage unit from the configuration center according to the second operation instruction, wherein the second configuration information is the complete configuration information in the first storage unit; and update the current configuration information of each gateway node to the second configuration information.
[0073] In an exemplary embodiment, the update module 54 is configured to read a third operation instruction from the configuration center of the second storage unit, wherein the third operation instruction is used to load target configuration information; read third configuration information from the configuration center of the first storage unit according to the third operation instruction, wherein the third configuration information is the target configuration information in the first storage unit; and update the target configuration information of each gateway node to the third configuration information.
[0074] In an exemplary embodiment, the update module 54 is used to read the fourth operation instruction stored in the second storage unit from the configuration center, wherein the fourth operation instruction is used to adjust the activation status of the target function of the network file system, and the activation status of the target function is determined by the status identifier of the target function; by executing the fourth operation instruction, the current status identifier of the target function of each gateway node is adjusted to the target status identifier.
[0075] In an exemplary embodiment, the update module 54 is configured to read a fifth operation instruction stored in the second storage unit from the configuration center, wherein the fifth operation instruction is used to restart the gateway node; after restarting each gateway node according to the fifth operation instruction, the update module 54 reads the configuration information of the first storage unit from the configuration center; and updates the current configuration information of each gateway node to the configuration information of the first storage unit.
[0076] The description of the features in the embodiment corresponding to the above configuration information updating device can be found in the relevant description of the embodiment corresponding to the configuration information updating method, and will not be repeated here.
[0077] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described configuration information update method embodiments.
[0078] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described configuration information update method embodiments when running.
[0079] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0080] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described configuration information update method embodiments.
[0081] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described configuration information update method embodiments.
[0082] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0083] The foregoing has provided a detailed description of a configuration information updating method, apparatus, storage medium, and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for updating configuration information, characterized in that, This is applied to a network file system that runs on a cloud storage cluster and includes multiple gateway nodes, including: A first storage unit and a second storage unit are set in the configuration center of the cloud storage cluster. The first storage unit is used to store the configuration information of the network file system, and the second storage unit is used to store the operation instructions of the gateway node. The second storage unit is updated after the first storage unit is updated. If it is determined that the second storage unit has been updated, the configuration information of the plurality of gateway nodes is updated to the configuration information in the first storage unit.
2. The method according to claim 1, characterized in that, After setting up the first storage unit and the second storage unit in the configuration center of the cloud storage cluster, the method further includes: The first configuration information and the first operation instruction written by the target object are received through the management interface of the network file system; Update the configuration information in the first storage unit with the first configuration information to update the first storage unit; After determining that the first storage unit has been updated, the current operation instruction in the second storage unit is updated to the first operation instruction to update the second storage unit.
3. The method according to claim 1, characterized in that, Before updating the configuration information of the plurality of gateway nodes to the configuration information in the first storage unit, the method further includes: Determine the initialization code that starts each gateway node in the network file system, the initialization code including callback function registration code; After each gateway node is initialized through the initialization code, a callback function for each gateway node is generated according to the callback function registration code, wherein the callback function of each gateway node is used to subscribe to the change event of the second storage unit.
4. The method according to claim 3, characterized in that, Updating the configuration information of the plurality of gateway nodes to the configuration information in the first storage unit includes: In response to a change event in the second storage unit, a change notification is sent to each gateway node through a callback function of each gateway node; After determining that each gateway node has received the change notification, the second operation instruction stored in the second storage unit is read from the configuration center, wherein the second operation instruction is used to reload the configuration information; According to the second operation instruction, the second configuration information of the first storage unit is read from the configuration center, wherein the second configuration information is the complete configuration information in the first storage unit; Update the current configuration information of each gateway node to the second configuration information.
5. The method according to claim 4, characterized in that, After determining that each gateway node has received the change notification, the method further includes: A third operation instruction is read from the configuration center from the second storage unit, wherein the third operation instruction is used to load target configuration information; According to the third operation instruction, the third configuration information in the first storage unit is read from the configuration center, wherein the third configuration information is the target configuration information in the first storage unit; Update the target configuration information of each gateway node to the third configuration information.
6. The method according to claim 4, characterized in that, After determining that each gateway node has received the change notification, the method further includes: The fourth operation instruction stored in the second storage unit is read from the configuration center, wherein the fourth operation instruction is used to adjust the activation status of the target function of the network file system, and the activation status of the target function is determined by the status identifier of the target function; By executing the fourth operation instruction, the current status identifier of the target function of each gateway node is adjusted to the target status identifier.
7. The method according to claim 5, characterized in that, After determining that each gateway node has received the change notification, the method further includes: The fifth operation instruction stored in the second storage unit is read from the configuration center, wherein the fifth operation instruction is used to restart the gateway node; After restarting each gateway node according to the fifth operation instruction, the configuration information of the first storage unit is read from the configuration center; Update the current configuration information of each gateway node to the configuration information of the first storage unit.
8. A device for updating configuration information, characterized in that, include: The configuration module is used to set up a first storage unit and a second storage unit in the configuration center of the cloud storage cluster. The first storage unit is used to store configuration information of the network file system, and the second storage unit is used to store operation instructions of the gateway node. The second storage unit is updated after the first storage unit is updated. The update module is used to update the configuration information of multiple gateway nodes to the configuration information in the first storage unit when it is determined that the second storage unit has been updated.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the configuration information update method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method for updating configuration information as described in any one of claims 1 to 7.