NAS-based cluster management method and apparatus, and computer device and nonvolatile readable storage medium
By using docker containers to isolate SAN and NAS systems in centralized NAS storage, and synchronize configuration data by monitoring threads and main processes, the problem of strong dependence of NAS and SAN systems is solved, improving the scalability and efficiency of cluster management.
Patent Information
- Application Number
- PCT/CN2024/122511
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-31
- Filing Date
- 2024-09-29
- Publication Date
- 2025-05-08
AI Technical Summary
In unified centralized NAS storage, the dependence between the NAS system and the SAN system is strong, resulting in the scalability and performance of the management architecture being affected.
The docker container is used to isolate the SAN and NAS systems. Each node includes the SAN storage system deployed by the host and the NAS system deployed by the docker container. The configuration data synchronization between the SAN cluster and the NAS cluster is achieved by monitoring threads and the main process.
It improves the scalability of cluster management, reduces the impact on storage services, realizes independent and related management of SAN clusters and NAS clusters, and improves the management efficiency of centralized NAS storage.
Smart Images

Figure CN2024122511_08052025_PF_FP_ABST
Abstract
Description
NAS-based cluster management method, device, computer equipment, and non-volatile readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on October 31, 2023, with application number 202311426345.9 and application name “Cluster management method, device, computer equipment and medium based on NAS”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of computer technology, and in particular to a NAS-based cluster management method, apparatus, computer equipment, and non-volatile readable storage medium. Background Art
[0004] In a unified Network Attached Storage (NAS) storage framework, a Storage Area Network (SAN) storage system is deployed on centralized storage, and NAS file storage services are provided externally based on the SAN-deployed NAS storage, which has broad application prospects.
[0005] However, in the current unified centralized NAS storage, the dependence between the NAS system and the SAN system is relatively strong, which will affect the scalability and performance of the management architecture to a certain extent.
[0006] Summary of the Invention
[0007] In view of this, the present application provides a NAS-based cluster management method, apparatus, computer equipment, and non-volatile readable storage medium to solve the above technical problems.
[0008] In a first aspect, the present application provides a NAS-based cluster management method, which is applied to a centralized cluster. The centralized cluster includes a master node and at least one slave node. Each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a Docker container. A monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system. The method is executed by the monitoring thread in the master node, and the method includes:
[0009] After obtaining the operation instruction, generating an operation result according to the operation instruction, wherein the operation instruction is used to instruct to perform a state switching operation of the network attached storage system or to perform a restart operation of the network attached storage system;
[0010] Synchronize the operation results to the monitoring thread corresponding to each slave node, so that the monitoring thread corresponding to the slave node completes configuration data synchronization in the storage area network deployed in the slave node;
[0011] The operation results are sequentially sent to the network attached storage system corresponding to each node in the centralized cluster, so that the master process deployed in the network attached storage system corresponding to each node completes the configuration data synchronization.
[0012] This application provides a NAS-based cluster management method with the following advantages:
[0013] In a centralized cluster, there are master and slave nodes. Each node consists of a host and a Docker container. The SAN storage system is deployed in the host, and the NAS system is deployed in the Docker container. This effectively isolates the SAN and NAS using Docker containers, resulting in a more robust isolation. For example, if the NAS requires an upgrade for certain dependency libraries, but the SAN does not, only the dependency libraries within Docker can be upgraded, without requiring any intervention from the SAN cluster. If the NAS requires functional expansion, there's no need to consider the impact of these implementations and newly added dependency libraries on the SAN. The Docker container and its surroundings are like two separate terminals, each independently interfering with the other. Furthermore, by implementing a NAS cluster within Docker, if a user needs to upgrade the NAS functionality of an existing storage device while still using the SAN functionality, they can simply replace the Docker image without impacting the SAN functionality. This management architecture offers improved scalability and minimizes the impact on storage services.
[0014] Furthermore, a monitoring thread is set up in the SAN storage system, and a master process is set up in the NAS system. SAN systems in multiple nodes constitute a SAN cluster, and NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and NAS cluster communicate via the monitoring thread and the master process, enabling configuration data synchronization between the SAN and NAS clusters. This effectively enables independent yet interconnected cluster management of the SAN and NAS clusters. Information exchange between the monitoring thread and the master thread enables centralized NAS storage under a new unified architecture, resulting in more efficient cluster management.
[0015] In an optional embodiment, the method further includes:
[0016] Periodically obtain the current status of the network-attached storage system and the current environment information of the centralized cluster;
[0017] When it is determined based on the current state and environment information that the network-attached storage system is to be switched to the target state, a state switching instruction is generated and sent to the network-attached storage system corresponding to each node in the centralized cluster, so that the master process deployed in each network-attached storage system can complete the state switching.
[0018] In some embodiments, a monitoring thread in the master node can periodically monitor the current state of the NAS system and the current environment of the centralized cluster. Based on the current state and the information provided, it can determine whether the NAS system needs to switch state, as well as the target state to which it should switch. If it is determined that the NAS system needs to switch to the target state, a state switching instruction can be generated and sent to the NAS system corresponding to each node in the centralized cluster, for the master process deployed in each NAS system to complete the state switching operation.
[0019] In an optional implementation, when receiving a state switching request fed back by the first main process, the method further includes:
[0020] According to the state switching request, obtain the current state of the network attached storage system and the current environment information of the centralized cluster;
[0021] When determining that the network attached storage system is to be switched to a target state based on the current state and environment information, generating a state switching instruction;
[0022] The state switching instruction is sent to the first main process, so that the first main process completes the state switching operation of the network attached storage system, wherein the first main process is the main process included in the network attached storage system corresponding to any node in the centralized cluster.
[0023] In some embodiments, in addition to the monitoring thread in the master node being able to monitor the status of the NAS system and the environmental information of the centralized cluster, each master process can actually also periodically self-check its internal status, that is, self-check the status of the NAS system and the environmental information of the centralized cluster. Then, based on the status of the NAS system and the environmental information of the centralized cluster, determine whether it is necessary to switch the status and determine the target state to be switched. Once it is determined that it is necessary to switch to the target state, it is necessary to send a request message, that is, a state switching request, to the monitoring thread of the master node to ask whether it is possible to switch to the target state. After receiving the state switching request, the monitoring thread will also obtain the status of the NAS system and the current environmental information of the centralized cluster by itself to further verify whether a state switching is necessary. If the verification result is consistent with the result of the first master process's request, a state switching instruction is sent to the first master process so that the first master process can complete the state switching operation on the NAS system.
[0024] In an optional embodiment, the method further includes: sending a state switching instruction to other main processes except the first main process, so that the other main processes except the first main process complete the state switching operation on the network attached storage system according to the state switching instruction.
[0025] In some embodiments, in order to achieve configuration data synchronization, the monitoring thread not only needs to send a state switching instruction to the first main process, but also needs to send a state switching instruction to the main processes set in other nodes, so that all main processes complete the state switching of the NAS system.
[0026] In an optional embodiment, the method further includes: upon receiving a response message after the state switching is completed, sent by a master process included in the network-attached storage system corresponding to all nodes in the centralized cluster, synchronously updating the current state of the network-attached storage system stored in the storage area network of each node.
[0027] In some embodiments, after completing a state switch, each master process needs to send a response message to the master node's monitoring thread to indicate that the state switch has been completed. This allows the master node's monitoring thread to synchronously update the current state of the NAS system recorded by each node's SAN system based on the response message.
[0028] In an optional embodiment, the environmental information includes one or more of the following:
[0029] The status of the storage area network, network attached storage system, file system identification information, file system status, storage pool status, volume status, and acquired alarm information in the current environment.
[0030] In an optional embodiment, the status of the network attached storage system includes one or more of the following:
[0031] Power on, Running, Hot Backup, Start, Stop, Stopped, and Down.
[0032] In some embodiments, the states in this application document only include these 7 states. Compared with the switching operations of more than a dozen states in the related art, state switching will be simpler, the switching logic for each state will also be simpler, and the state switching efficiency will be higher.
[0033] In an optional implementation, a communication connection is established between the monitoring thread and the main process in each node via a heartbeat, and the heartbeat frequency includes multiple levels.
[0034] In an optional embodiment, establishing a communication connection between the monitoring thread and the main process in each node through a heartbeat includes:
[0035] The main process and the monitoring thread in each node respectively start a child thread, and send heartbeat messages to each other at the current heartbeat frequency level through the respectively started child threads, wherein the heartbeat messages are used to inform the other party of its current status.
[0036] In an optional embodiment, the heart rate includes 4 heart rate gears, and the 4 heart rate gears are 5s / time, 30s / time, 1min / time, and 5min / time, respectively, and 5s / time is the default heart rate gear.
[0037] In an optional embodiment, the heartbeat message includes a want_state field and an fsid field, wherein the want_state field is used to indicate its own state to be switched, and the fsid field is used to record the state to which the network attached storage system needs to switch and the id of the file system to be taken over.
[0038] In some embodiments, heartbeat verification is used to verify whether both parties are in normal working state, and different heartbeat frequency gears can be configured according to different working states.
[0039] In an optional embodiment, when it is determined that the current state of the network-attached storage system is the first target state and the heartbeat frequency gear is not at the lowest gear, a first gear adjustment instruction is sent to a master process included in the network-attached storage system corresponding to each node in the centralized cluster, where the first gear adjustment instruction is used to instruct to automatically lower the heartbeat frequency gear by one gear;
[0040] or,
[0041] When it is determined that the current state of the network attached storage system has changed, or when it is determined that the current state of the network attached storage system has become abnormal, a second gear adjustment instruction is sent to a master process included in the network attached storage system corresponding to each node in the centralized cluster, where the second gear adjustment instruction is used to adjust the heartbeat frequency gear to the highest gear.
[0042] In some embodiments, when the current state of the NAS system is the first target state, it indicates that the current NAS system is in a stable state. If the heartbeat frequency gear is not at the lowest gear at this time, a first gear adjustment instruction may be sent to the master process included in the network attached storage system corresponding to each node in the centralized cluster. The first gear adjustment instruction is used to instruct the heartbeat frequency gear to be automatically adjusted down by one gear, thereby reducing the frequency of heartbeat access, reducing resource usage, and avoiding unnecessary resource waste.
[0043] However, once it is determined that the status of the NAS system has changed or an abnormality has occurred, it is necessary to adjust the heartbeat frequency gear to the highest gear. Through frequent heartbeat access, the current system status can be determined in real time to avoid unnecessary losses.
[0044] In a second aspect, the present application provides a NAS-based cluster management method, which is applied to a centralized cluster. The centralized cluster includes a master node and at least one slave node. Each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a Docker container. A monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system. The method is executed by the master process in any node, and the method includes:
[0045] Get the operation instructions sent by the monitoring thread in the master node;
[0046] According to the operation instruction, an operation corresponding to the operation instruction is executed to complete the configuration data synchronization operation, wherein the configuration data synchronization operation includes a state switching operation of the network attached storage system or a restart operation of the network attached storage system.
[0047] This application provides a NAS-based cluster management method with the following advantages:
[0048] In a centralized cluster, there are master and slave nodes. Each node consists of a host and a Docker container. The SAN storage system is deployed in the host, and the NAS system is deployed in the Docker container. This effectively isolates the SAN and NAS using Docker containers, resulting in a more robust isolation. For example, if the NAS requires an upgrade for certain dependency libraries, but the SAN does not, only the dependency libraries within Docker can be upgraded, without requiring any intervention from the SAN cluster. If the NAS requires functional expansion, there's no need to consider the impact of these implementations and newly added dependency libraries on the SAN. The Docker container and its surroundings are like two separate terminals, each independently interfering with the other. Furthermore, by implementing a NAS cluster within Docker, if a user needs to upgrade the NAS functionality of an existing storage device while still using the SAN functionality, they can simply replace the Docker image without impacting the SAN functionality. This management architecture offers improved scalability and minimizes the impact on storage services.
[0049] A monitoring thread is set in the SAN storage system, and a main process is set in the NAS system. The SAN systems in multiple nodes constitute a SAN cluster, and the NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and the NAS cluster are connected in communication via the monitoring thread and the main process. When the main process receives an operation instruction sent by the monitoring thread, it can perform corresponding operations according to the operation instruction to synchronize the configuration data in the SAN cluster and the NAS cluster. The configuration data synchronization operation may include but is not limited to the state switching of the NAS system, or the switching operation of the heartbeat frequency between the main process and the monitoring thread in each node. In this way, it is equivalent to realizing the independent and interrelated cluster management of the SAN cluster and the NAS cluster. Based on the information interaction between the monitoring thread and the main thread, centralized NAS storage under a new unified architecture is realized, and cluster management is more efficient.
[0050] In an optional implementation, the current state of the network attached storage system and the current environment information of the centralized cluster are periodically obtained;
[0051] When it is determined that the network attached storage system is to be switched to a target state based on the current state and environment information, a state switching request is sent to the monitoring thread in the master node;
[0052] When a state switching instruction corresponding to the state switching request is received and fed back by the monitoring thread in the master node, the state of the network attached storage system is switched to the target state.
[0053] In some embodiments, each main process can also periodically self-check its internal status, that is, self-check the status of the NAS system and the environmental information of the centralized cluster. Then, based on the status of the NAS system and the environmental information of the centralized cluster, determine whether it is necessary to switch the status and determine the target state to be switched. Once it is determined that it is necessary to switch to the target state, it is necessary to send a request information to the monitoring thread of the master node, that is, a state switching request, to ask whether it is possible to switch to the target state. After receiving the state switching request, the monitoring thread will also obtain the status of the NAS system and the current environmental information of the centralized cluster by itself to further verify whether a state switching is required. If the verification result is consistent with the result of the first main process request, a state switching instruction is sent to the first main process to enable the first main process to complete the state switching operation on the NAS system.
[0054] In an optional embodiment, after receiving a state switching instruction corresponding to the state switching request fed back by the monitoring thread in the master node and switching the state of the network attached storage system to the target state, the method further includes:
[0055] Generate a response message indicating that the switch is complete and send it to the monitoring thread corresponding to the master node.
[0056] In some embodiments, after completing a state switch, each master process needs to send a response message to the master node's monitoring thread to indicate that the state switch has been completed. This allows the master node's monitoring thread to synchronously update the current state of the NAS system recorded by each node's SAN system based on the response message.
[0057] In an optional embodiment, the method further includes:
[0058] Obtain the metadata sent by the main process corresponding to the target service protocol, encapsulate the metadata, and then execute the disk operation. The data corresponding to the metadata is directly sent to the storage pool by the main process corresponding to the target service protocol for disk operation.
[0059] In some embodiments, data and metadata are separated by modifying the target service protocol—that is, adjusting the business logic. Once separated, the process corresponding to the target service protocol automatically sends the data to the storage pool for storage. Simultaneously, a direct communication connection is established with the master process of any node, sending metadata to the master process. The master process then encapsulates and processes the metadata, storing it on disk. Because metadata processing is performed within the master process, no external file system is required, eliminating reliance on open source file systems.
[0060] In a third aspect, the present application provides a NAS-based cluster management device, the device comprising:
[0061] An acquisition module is configured to be an operation instruction, wherein the operation instruction is used to instruct execution of a state switching operation of the network attached storage system or execution of a restart operation of the network attached storage system;
[0062] A processing module is configured to generate an operation result according to the operation instruction;
[0063] a synchronization module configured to synchronize the operation result to the monitoring thread corresponding to each slave node, so as to complete the configuration data synchronization in the storage area network deployed in the slave node by the monitoring thread corresponding to the slave node;
[0064] The sending module is configured to send the operation results to the network attached storage system corresponding to each node in the centralized cluster in sequence, so as to complete the configuration data synchronization with the main process deployed in the network attached storage system corresponding to each node.
[0065] The NAS-based cluster management device provided in this application has the following advantages:
[0066] In a centralized cluster, there are master and slave nodes. Each node consists of a host and a Docker container. The SAN storage system is deployed in the host, and the NAS system is deployed in the Docker container. This effectively isolates the SAN and NAS using Docker containers, resulting in a more robust isolation. For example, if the NAS requires an upgrade for certain dependency libraries, but the SAN does not, only the dependency libraries within Docker can be upgraded, without requiring any intervention from the SAN cluster. If the NAS requires functional expansion, there's no need to consider the impact of these implementations and newly added dependency libraries on the SAN. The Docker container and its surroundings are like two separate terminals, each independently interfering with the other. Furthermore, by implementing a NAS cluster within Docker, if a user needs to upgrade the NAS functionality of an existing storage device while still using the SAN functionality, they can simply replace the Docker image without impacting the SAN functionality. This management architecture offers improved scalability and minimizes the impact on storage services.
[0067] Furthermore, a monitoring thread is set up in the SAN storage system, and a master process is set up in the NAS system. SAN systems in multiple nodes constitute a SAN cluster, and NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and NAS cluster communicate via the monitoring thread and the master process, enabling configuration data synchronization between the SAN and NAS clusters. This effectively enables independent yet interconnected cluster management of the SAN and NAS clusters. Information exchange between the monitoring thread and the master thread enables centralized NAS storage under a new unified architecture, resulting in more efficient cluster management.
[0068] In a fourth aspect, the present application provides a NAS-based cluster management device, which is applied to a centralized cluster, wherein the centralized cluster includes a master node and at least one slave node, each node including a storage area network deployed in a host machine and a network attached storage system deployed in a Docker container, wherein a monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system. The device includes:
[0069] The acquisition module is configured to obtain the operation instructions sent by the main process;
[0070] The processing module is configured to execute an operation corresponding to the operation instruction according to the operation instruction to complete the configuration data synchronization operation, wherein the configuration data synchronization operation includes a state switching operation of the network attached storage system or a heartbeat frequency switching operation between the main process and the monitoring thread.
[0071] The NAS-based cluster management device provided in this application has the following advantages:
[0072] In a centralized cluster, there are master and slave nodes. Each node consists of a host and a Docker container. The SAN storage system is deployed in the host, and the NAS system is deployed in the Docker container. This effectively isolates the SAN and NAS using Docker containers, resulting in a more robust isolation. For example, if the NAS requires an upgrade for certain dependency libraries, but the SAN does not, only the dependency libraries within Docker can be upgraded, without requiring any intervention from the SAN cluster. If the NAS requires functional expansion, there's no need to consider the impact of these implementations and newly added dependency libraries on the SAN. The Docker container and its surroundings are like two separate terminals, each independently interfering with the other. Furthermore, by implementing a NAS cluster within Docker, if a user needs to upgrade the NAS functionality of an existing storage device while still using the SAN functionality, they can simply replace the Docker image without impacting the SAN functionality. This management architecture offers improved scalability and minimizes the impact on storage services.
[0073] A monitoring thread is set in the SAN storage system, and a main process is set in the NAS system. The SAN systems in multiple nodes constitute a SAN cluster, and the NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and the NAS cluster are connected in communication via the monitoring thread and the main process. When the main process receives an operation instruction sent by the monitoring thread, it can perform corresponding operations according to the operation instruction to synchronize the configuration data in the SAN cluster and the NAS cluster. The configuration data synchronization operation may include but is not limited to the state switching of the NAS system, or the switching operation of the heartbeat frequency between the main process and the monitoring thread in each node. In this way, it is equivalent to realizing the independent and interrelated cluster management of the SAN cluster and the NAS cluster. Based on the information interaction between the monitoring thread and the main thread, centralized NAS storage under a new unified architecture is realized, and cluster management is more efficient.
[0074] In a fifth aspect, the present application provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the computer executing the computer instructions to thereby execute the NAS-based cluster management method of the above-mentioned first aspect or any corresponding embodiment thereof, or the computer executing the computer instructions to thereby execute the NAS-based cluster management method of the above-mentioned second aspect or any corresponding embodiment thereof.
[0075] In a sixth aspect, the present application provides a computer non-volatile readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the NAS-based cluster management method of the above-mentioned first aspect or any corresponding embodiment thereof, or the computer executes the NAS-based cluster management method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the specific implementation methods of this application or the technical solutions in related technologies, the following is a brief introduction to the drawings required for use in the specific implementation methods or related technical descriptions. Obviously, the drawings described below are some implementation methods of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0077] FIG1 is a schematic diagram of the structure of each node in the centralized cluster provided by this application;
[0078] FIG2 is a schematic diagram of a structure for establishing a communication connection between monitoring threads and a main process in different nodes provided by the present application;
[0079] FIG3 is a schematic diagram of switching between different states provided by the present application;
[0080] FIG4 is a flow chart of a NAS-based cluster management method according to an embodiment of the present application;
[0081] FIG5 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application;
[0082] FIG6 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application;
[0083] FIG7 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application;
[0084] FIG8 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application;
[0085] FIG9 is a block diagram of a cluster management device based on NAS according to an embodiment of the present application;
[0086] FIG10 is a block diagram of another NAS-based cluster management device according to an embodiment of the present application;
[0087] FIG11 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0088] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0089] Centralized storage refers to a central node composed of one or more computers, where data is centrally stored and all business units of the entire system are centrally deployed on this central node. All system functions are centrally processed by it. In a unified NAS storage framework, a SAN storage system is deployed on centralized storage, and NAS file storage services are provided externally based on the SAN-deployed NAS storage, which has broad application prospects. Centralized storage has a simple deployment structure, fast transmission speeds, and low loss, making it suitable for application scenarios with high read / write times (Input / Output Operations Per Second, abbreviated as IOPS) and low latency.
[0090] In unified centralized NAS storage, the NAS system and SAN system are highly dependent on each other, which will affect the scalability and performance of the management architecture to a certain extent.
[0091] To solve the above problems, an embodiment of the present application provides a NAS-based cluster management embodiment. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system (computer device) including, for example, a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0092] In some embodiments, the method is applied to a centralized cluster, comprising a master node and at least one slave node. Each node comprises a storage area network deployed in a host machine and a network attached storage system deployed in a Docker container. The storage area network is provided with a monitoring thread, and the network attached storage system is provided with a master process. Referring to FIG. 1 , FIG. 1 illustrates the aforementioned structure included in each node of the centralized cluster.
[0093] In this architecture, the NAS system's main process, within the Docker container deployed on each node, can communicate with the monitoring process in the SAN system deployed on the master node. The monitoring thread in the master node can instruct each main process to perform corresponding operations. The monitoring thread in each node can also establish a communication connection with the main process in that node to perform query operations. Having the NAS system's main process run in a Docker environment isolates it from the SAN system, preventing the new framework NAS cluster structure from impacting the existing SAN cluster environment. As a lightweight container, the Docker environment can minimize performance losses.
[0094] When both the NAS cluster and the SAN cluster run locally and are not isolated using Docker, the NAS and SAN have the same dependencies. However, both the NAS and SAN can independently provide external services, and the dependencies they require are largely different. In some scenarios, users may perform a hot upgrade on some NAS functions without having to operate the SAN. If both the NAS and SAN run on the local system, such a hot upgrade of some cluster functions will inevitably affect the entire SAN cluster. Therefore, the NAS cluster is run in a Docker environment. At this time, the functions of the SAN cluster and the NAS cluster are completely isolated and do not affect each other. In addition, Docker has low system consumption. Experimental test data shows that the loss of Docker on IO performance is less than 1%.
[0095] Figure 2 is a schematic diagram of the structure of establishing communication connections between monitoring threads and main processes in different nodes. As shown in Figure 2, node 1 is the master node and the other nodes are slave nodes.
[0096] In an optional application scenario, for example, the monitoring thread in the master node needs to control different master processes in different nodes to complete the operation steps corresponding to a certain operation instruction to achieve configuration data synchronization. The operation steps include:
[0097] Step 1: After the monitoring thread in the master node obtains the operation instruction, it generates the operation result according to the operation instruction.
[0098] For example, the operation instruction may include an instruction input by the user in the form of a setting instruction to instruct a normal switch of the NAS system state, or to perform a restart operation of the NAS system, or to perform a state switch when it is determined that an abnormality occurs in the NAS system.
[0099] Step 2: The monitoring thread of the master node synchronizes the operation results to the SAN system corresponding to each slave node to complete configuration data synchronization.
[0100] Step 3: The monitoring thread of the master node sends the operation results to the NAS system corresponding to each node in the centralized cluster in sequence.
[0101] Step 4: The main process deployed by the NAS system in each slave node obtains the operation instruction sent by the monitoring thread in the master node.
[0102] Step 5: Each main process executes the operation corresponding to the operation instruction according to the operation instruction to complete the configuration data synchronization operation.
[0103] The configuration data synchronization operation includes a state switching operation of the network attached storage system or a restart operation of the network attached storage system.
[0104] The purpose of configuring data synchronization is to prevent errors if a node fails, allowing other nodes to take over its tasks. If a master node fails, a randomly selected node from the remaining healthy nodes will be selected as the master node to take over cluster operations, minimizing the impact of the master node failure on storage operations.
[0105] In some embodiments, when performing configuration data synchronization, in an optional implementation, configuration data synchronization between different nodes may be performed based on a Paxos algorithm to ensure data consistency between different nodes.
[0106] In addition to the above operations, the monitoring thread in the master node will also periodically check the working status of its own system. For example, it also includes:
[0107] Step 6: The monitoring thread in the master node periodically obtains the current status of the NAS system stored internally therein and the current environment information of the centralized cluster.
[0108] In an optional embodiment, the environmental information may include, but is not limited to, one or more of the following:
[0109] The status of the storage area network, network attached storage system, file system identification information, file system status, storage pool status, volume status, and acquired alarm information in the current environment.
[0110] In an optional embodiment, the status of the NAS system includes one or more of the following:
[0111] Boot, Active, Standby_Replay, Start, Stop, Stopped, and Offline. Compared to existing NAS storage, the NAS system in this embodiment has fewer states and simpler state switching logic, which can reduce maintenance costs and improve state switching management efficiency.
[0112] Step 7: When the monitoring thread of the master node determines that the network attached storage system is to be switched to the target state based on the current state and environment information, it generates a state switching instruction.
[0113] Step 8: The monitoring thread of the master node sends a state switching instruction to the network attached storage system corresponding to each node in the centralized cluster.
[0114] In some embodiments, the master node's monitoring thread determines whether the NAS system needs to switch state, as well as the target state to switch to, based on the current state and environmental information. This process is relatively mature technology and will not be described in detail here. When it is determined that a switch to the target state is necessary, a state switching instruction is generated and sent to the NAS system deployed on each slave node.
[0115] The so-called state switching is switching between the states mentioned above. Referring to FIG3 , FIG3 is a schematic diagram showing switching between different states.
[0116] For example, when a NAS system is first started, it is set to the boot state. After the startup is complete and the master node confirms that the environment is normal, it allows the NAS cluster to switch to the starting state. During this switchover process, data structures related to cluster management and the file system are created for the NAS cluster. After the creation and initialization of these data structures are completed, the NAS cluster state switches to the active state. If the NAS cluster is actively stopped, the NAS state is written to the stopping state and then to the stopped state. After the cluster is stopped, it can be reactivated and the test state switched to the starting state.
[0117] Furthermore, if a NAS system experiences an abnormal state, the monitoring thread issues a state switch command, controlling the corresponding master process to blacklist the NAS system, set its state to offline, and then select another NAS system to take over the current file system I / O. This implementation also provides a file recovery function for the NAS cluster caused by system errors. Once the environment is repaired, the state can be switched to the boot state, and the state machine switching process can be repeated.
[0118] In addition, it can also include the standby_replay state. After the system startup is completed, it can switch from the starting state to the standby_replay state.
[0119] Hot standby mode means that two main processes are started in the same Docker container. One of these main processes enters the active state, while the other enters the standby_replay state, serving as a hot standby process. The two main processes are spatially isolated. If the active main process experiences an exception (e.g., due to excessive memory usage causing insufficient memory, an inherent bug triggering an interrupt causing the process to exit, or other reasons causing the process to exit the active state), the hot standby process immediately takes over all operations of the active process, continuing to support NAS services and minimizing the impact on NAS services in this scenario.
[0120] In scenarios where hot standby mode is not enabled, when an exception occurs in the main process, it may cause resource drift or process restart. At this time, other controllers (resource drift will cause business interruption, and resource drift to other controllers takes a long time) or newly started processes (process initialization will take some time) will take over the resources, which will greatly increase the time consumption.
[0121] Because the hot standby process is set to reside in memory, it consumes some system resources. Therefore, enabling hot standby mode places high demands on the storage device configuration. Enabling hot standby mode is not recommended in low-spec environments. When hot standby mode is enabled, the two processes act as hot standby processes for each other.
[0122] That is, when primary process A is in the active state, primary process B is in the standby_replay state, with process A as the hot standby. Conversely, if process A becomes abnormal, process B switches to the active state. Once process A is repaired, it automatically switches to the standby_replay state, with process B as the hot standby.
[0123] In addition, the monitoring thread in the master node can periodically obtain the status of the NAS system and the storage environment of the centralized cluster to determine whether to switch the NAS system status. Alternatively, any master process can send a status switch request to the monitoring thread in the master node to determine whether to switch the NAS system status. Therefore, the following method steps can also be included.
[0124] Step 9: The main process in any node periodically obtains the current status of the network attached storage system and the current environment information of the centralized cluster.
[0125] In some embodiments, the first master process is described as an example, wherein the first master process is a master process included in a network attached storage system corresponding to any node in a centralized cluster. The first master process can periodically obtain the current status of the NAS system stored internally therein and the current environment information of the centralized cluster.
[0126] Step 10: When the first main process determines that the network attached storage system is to be switched to a target state based on the current state and environment information, it sends a state switching request to the monitoring thread in the master node.
[0127] In some embodiments, the process of determining whether to switch to the target state can refer to the existing technology and will not be repeated here. When it is determined that the NAS system is to be switched to the target state, a state switching request is sent to the monitoring thread in the master node.
[0128] Step 11: The monitoring thread in the master node receives a state switching request fed back by the first master process.
[0129] Step 12: The monitoring thread in the master node obtains the current state of the network attached storage system and the current environment information of the centralized cluster according to the state switching request.
[0130] Step 13: When the monitoring thread in the master node determines that the network attached storage system is to be switched to a target state based on the current state and environment information, it generates a state switching instruction.
[0131] Step 14: The monitoring thread in the master node sends a state switching instruction to the first master process.
[0132] The first main process is used to complete the state switching operation on the network attached storage system.
[0133] Step 15: When the first master process receives the state switching instruction corresponding to the state switching request fed back by the monitoring thread in the master node, the first master process switches the state of the network attached storage system to the target state.
[0134] In an optional embodiment, in addition to sending the state switching instruction to the first main process, in order to ensure configuration data synchronization, the state switching instruction also needs to be sent to other main processes except the first main process. Therefore, this may include:
[0135] In step 16, the monitoring thread in the master node sends a state switching instruction to other master processes except the first master process, so that the other master processes except the first master process complete the state switching operation on the network attached storage system according to the state switching instruction.
[0136] Step 17, after the master process in each node switches the state of the NAS system to the target state according to the state switching instruction, further includes: generating a response message indicating that the switching is completed, and sending the response message to the monitoring thread corresponding to the master node.
[0137] In step 18, after receiving the response information after the state switching is completed sent by the master process included in the network attached storage system corresponding to all nodes in the centralized cluster, the monitoring thread in the master node synchronously updates the current state of the network attached storage system stored in the storage area network of each node.
[0138] In an optional embodiment, communication between any of the monitoring threads and the main process is implemented via a socket. Furthermore, to detect whether communication anomalies between the monitoring thread and the main process occur, a communication connection is established between the monitoring thread in each node and the main process via a heartbeat, with multiple heartbeat frequencies.
[0139] That is, a heartbeat mechanism is provided between the main process and the monitoring thread, and the heartbeat frequency can be adjusted intelligently. The heartbeat frequency can be divided into four levels, for example, 5s / time, 30s / time, 1min / time, and 5min / time. The initial default value is 5s / time. The main process and the monitoring process each start a child thread. Every 5 seconds, the two processes send heartbeat messages to each other to inform each other of the current state and determine whether a state switch is required. Among them, the message type sent can be defined as the MInsHeartBeat type. In this type of structure, fields such as want_state (indicating the field you want to switch to) and fsid (file system id) are set to record the state that the NAS system needs to switch to and information such as the id of the file system to be taken over.
[0140] After being sent to the monitoring thread of the master node, the monitoring thread parses the message sent by the master process. After confirming that the conditions for state switching are met, it sends a reply message to the master process, informing the master process that the state switching can be performed. At the same time, when the monitoring thread performs its own tick process, it will also detect the current cluster, injecting and detecting the status of the SAN cluster, storage pool status, volume status, file system status, NAS cluster status, etc. After the detection is completed, the MInsHeartBeat type structure is set, and the heartbeat message packet of the monitoring thread (the heartbeat message packet may include a state switching instruction, for example) is sent to the master process, which is parsed by the master process to complete the state switching.
[0141] The cluster supports the creation of multiple file systems and assigns a globally unique id to each file system as an identifier. It also maintains a map structure in the system to record the mapping relationship between the file system id (fsid) and the structure that actually records the file system attribute information (class Filesystem). The file system id and the file system's Filesystem type structure are allocated and initialized by the monitoring thread in the master node, and complete the synchronization between nodes in the cluster. At the same time, the monitoring thread in the master node will also send the map structure to the main process in each node. The monitoring thread in the master node will also regularly write the data in the map structure to the local storage space to avoid data loss caused by the exit of the monitoring thread. The file system id is recorded and passed as the unique identifier of the file system during the entire cluster operation (using fsid as a parameter to pass between different functions, and after the transfer, the file system information corresponding to the fsid is obtained through the map structure).
[0142] Each master process serves a dedicated file system and processes only the metadata for that file system. Therefore, a mapping between the file system and the master process must be maintained. Each master process is only allowed to process the metadata for a single file system, using the file system identifier (FSID) in the mapping. Therefore, when the master process communicates with the monitoring thread on the master node through heartbeats, the heartbeat message includes the FSIID information, indicating that the master process is processing the metadata for the file system corresponding to the FSIID.
[0143] The heartbeat message records the sender of the heartbeat message and the fsid of the file system to which it belongs. At the same time, the monitoring thread in the master node also records the mapping relationship between the main process and the fsid. When the monitoring thread receives the heartbeat message, it checks whether the mapping relationship records of the main process and the fsid recorded by both parties are consistent. If the records are consistent, the verification is successfully completed and other heartbeat message processes continue.
[0144] Alternatively, when an inconsistency in the mapping relationship record is detected, the exception handling process is executed, and the processing process is as follows:
[0145] The automatic replay function configured in the system can automatically restore the configuration in the cluster. Taking the mapping between the file system and the main process as an example, each operation such as creating a file system, switching the status of the main process, creating and removing the mapping relationship between the monitoring thread in the master node and the file system will be recorded and output to a local file for storage. The priority of saving the record is higher than the execution of the actual operation content, that is, the operation is recorded first and then executed.
[0146] Because the mapping relationship between each master process and the file system is globally unique, if the mapping relationship between fsid and the master process is abnormal, it can be considered that serious data inconsistency has occurred in the current cluster. For example, the master process ins_nas_main1 should have been processing the metadata of the file system identified as fsid1, but actually started processing the metadata of the file system identified as fsid2. The current operation will not be allowed. Therefore, first, the peer ins_nas_main1 process is asked to resend the heartbeat and perform another verification. If there is no abnormality in the verification, the current heartbeat process continues;
[0147] If the recheck still fails, immediately replay the previous operation records. This replay will yield the most accurate mapping between the file system and the ins_nas_main1 process. This will confirm which is correct, the record in the master node's monitoring thread or the record in the heartbeat message. If the data in the master node's monitoring thread is incorrect, the data is updated, recorded locally, and synchronized to all nodes. If the heartbeat message is incorrect, an exception is thrown, and the metadata processing records of the current ins_nas_main1 process are replayed. The previous metadata processing flow is then replayed to check for any incorrect records, discarding them. This may result in some data loss. After the replay is complete, the master node's monitoring thread sends a return heartbeat message packet, updates the mapping between the ins_nas_main1 record and the fsid, and continues the current business process.
[0148] In an optional embodiment, the method may further include:
[0149] Step 19: When the monitoring thread in the master node determines that the current state of the NAS system is the first target state and the heartbeat frequency gear is not at the lowest gear, the monitoring thread in the master node sends a first gear adjustment instruction to the master process included in the NAS system corresponding to each node in the centralized cluster. The first gear adjustment instruction is used to instruct to automatically lower the heartbeat frequency gear by one gear.
[0150] or,
[0151] When it is determined that the current state of the network attached storage system has changed, or when it is determined that the current state of the network attached storage system has become abnormal, a second gear adjustment instruction is sent to a master process included in the network attached storage system corresponding to each node in the centralized cluster, where the second gear adjustment instruction is used to adjust the heartbeat frequency gear to the highest gear.
[0152] In some embodiments, when the NAS cluster status is active and standby_replay (the first target state), the NAS cluster is considered to be in a steady state. After entering these two states, the system needs to provide more resources to the storage service. When there is no change in the NAS cluster for 100 consecutive times (after turning on the automatic adaptation of the heartbeat frequency, the number can be adjusted by the user and the default is 100 times), the heartbeat frequency is automatically reduced by one level, up to 5 minutes / time, to reduce the heartbeat monitoring's occupation of system resources.
[0153] Alternatively, when the cluster status changes or a cluster anomaly is detected, the heartbeat frequency is automatically adjusted to the highest frequency.
[0154] In this embodiment, a count field is added to the heartbeat message to record the number of heartbeat messages sent during steady-state operation, so as to facilitate the adjustment of the heartbeat frequency. If the state of the main process recorded in the received heartbeat message is inconsistent with the state of the monitoring thread recorded locally, it indicates that a state switch has occurred, and the heartbeat frequency needs to be adjusted.
[0155] In an optional example, cluster anomalies can occur in a variety of scenarios, including typical scenarios such as alarms reported by the alarm module and node damage caused by node insertion or removal. Furthermore, both the monitoring thread and the main process implement their own tick process, which periodically checks certain internal resources and data structures. If a resource is disconnected during this check, such as when the monitoring thread fails to respond to a message sent to the main process during the tick process, this indicates a cluster problem. If problems are detected in external operations or storage metrics, such as overheating of the CPU, unplugging of the power cord, or removal of the hard drive, these problems are reported to the cluster through an alarm and are also considered cluster anomalies. Intelligent heartbeat frequency adjustment is essentially a trust mechanism for the cluster's historical state. After a cluster has experienced long periods of stable operation, the probability of subsequent problems is low, allowing for a certain degree of trust in the cluster. Lowering the heartbeat frequency reduces the consumption of system resources by the heartbeat. However, the top priority of cluster management is to ensure normal cluster operation. When these issues occur, the cluster's historical state is no longer trustworthy, and the heartbeat frequency should be adjusted to the highest possible level.
[0156] In addition, considering that related technologies usually use open source file systems such as XFS (X File System), ZFS (Z File System), ext (Extended File System), etc. as the basis, CIFS (Common Internet File System), NFS (Network File System), FTP (File Transfer Protocol) and other protocols are provided to the outside world to directly access files on the file system. In other words, the conventional unified storage architecture will first format the block storage provided by the SAN into an open source file system, and then use the open source file system to provide file storage services to the outside world. Development based on open source file systems also has problems such as poor scalability and low performance.
[0157] Therefore, the method may further include:
[0158] In step 20, the main process obtains metadata sent by the main process corresponding to the target service protocol, encapsulates the metadata, and then executes a disk write operation.
[0159] In some embodiments, a metadata processing module is added to the main process. The main processes of protocols such as ganesha (a third-party file system), samba (samba is an implementation method of SMB (Server Message Block), which is mainly used to implement file and print services of Linux systems. Linux users can share resources with Windows users by configuring and using Samba servers), and vsftp (an FTP server software used on Unix-like systems released based on GPL, its full name is Very Secure FTP) are modified. When providing storage services to the outside through these protocols, the main processes of these protocols can automatically send data to the storage pool for disk storage, and send metadata to the metadata processing module of the main process, thereby realizing the diversion of data and metadata processing. After the diversion is completed, the main process encapsulates the metadata and then drops it to the disk. Since the metadata processing is implemented in the main process, there is no need for an external file system to provide functions, thus getting rid of the dependence on open source file systems.
[0160] In some embodiments, the aforementioned contents are all executed by the controller in the node. Based on the different needs of the customer site, controllers with different specifications such as dual controllers, quad controllers, and eight controllers can be provided. For centralized storage, there may be different specifications such as 2 / 4 / 8 controllers. Equivalently, the cluster can include 2, 4 or 8 nodes. The customer needs mentioned here refer to what specifications of storage devices the user needs and what the user's requirements for the storage devices are. The main cluster management process runs in each controller. In the default scenario, the node that executes the create cluster command is used as the initial master node, and the monitoring thread of the node is also used as the main monitoring thread, which is responsible for processing the configuration actions of the NAS cluster, such as NAS cluster status switching, configuration modification, file system creation, etc.
[0161] In addition to the aforementioned commands, each monitoring thread can establish a communication connection with the master process deployed on its own node to perform query operations. Query operations do not involve data modification; they simply query existing data. Furthermore, data from all master processes is synchronized, and queries on any node yield the same results. Therefore, queries can be performed directly on the master process of the node to which they belong, and local node queries are inherently faster than cross-node queries.
[0162] Operational actions may involve data changes. If every node can perform these operations, simultaneous modifications to the same data could easily lead to conflicts. Therefore, all operational actions are sent to the monitoring thread of the master node for execution. After the operation is completed, if there are any data changes, the monitoring thread of the master node will synchronize with the monitoring threads of other nodes and then feedback to the main process of the NAS system of the node that sent the operation request. The main processes of the NAS systems of other nodes will then complete the configuration data synchronization. When implementing configuration data synchronization, you can communicate directly with the monitoring thread in the master node or the monitoring thread in the local node.
[0163] In an optional embodiment, when there are multiple operation instructions, during execution, the operations corresponding to each operation instruction can be executed sequentially according to the receiving timing order of the multiple operation instructions to generate operation results corresponding to each operation instruction respectively.
[0164] In an optional implementation, when a monitoring thread deployed in any slave node receives an operation instruction, the monitoring thread discards the operation instruction.
[0165] The above is a schematic diagram of the overall process of cluster management in the entire centralized cluster system. For a clearer explanation, see below. In this embodiment, a NAS-based cluster management method is provided, which can be used for the above-mentioned terminal devices, such as mobile phones, tablets, etc. Figure 4 is a schematic diagram of the process of a NAS-based cluster management method provided by an embodiment of the present application. As shown in Figure 4, the method process is executed by the monitoring thread in the master node, and the method process includes the following steps:
[0166] Step S401: After obtaining the operation instruction, generate the operation result according to the operation instruction.
[0167] The operation instruction is used to instruct to execute a state switching operation of the network attached storage system or to execute a restart operation of the network attached storage system.
[0168] Step S402: Synchronize the operation result to the corresponding monitoring thread of each slave node.
[0169] The monitoring thread corresponding to the slave node completes configuration data synchronization in the storage area network deployed in the slave node.
[0170] Step S403: Send the operation results in sequence to the network attached storage system corresponding to each node in the centralized cluster.
[0171] The master process deployed in the network attached storage system corresponding to each node completes the configuration data synchronization.
[0172] The NAS-based cluster management method provided in this embodiment is configured with a master node and a slave node in a centralized cluster. Each node includes a host machine and a Docker container. The SAN storage system is deployed in the host machine, and the NAS system is deployed in the Docker container. This is equivalent to isolating the SAN and NAS using Docker containers, and the degree of isolation will be better. For example, when the NAS needs to upgrade certain dependent libraries, but the SAN does not, only the dependent libraries within the Docker can be upgraded, and the SAN cluster does not need to be processed. When the NAS needs to expand its functions, it is not necessary to consider the implementation of these functions and the impact of the newly added dependent libraries on the SAN. The inside and outside of the Docker are equivalent to two terminals that do not interfere with each other. At the same time, the NAS cluster is implemented inside the Docker. For example, if the user needs to upgrade the NAS function of the existing storage device but still uses the SAN function, the Docker image can be directly replaced without affecting the SAN function. Based on this, it can be considered that this management architecture has better scalability and reduces the impact on storage services.
[0173] Furthermore, a monitoring thread is set up in the SAN storage system, and a master process is set up in the NAS system. SAN systems in multiple nodes constitute a SAN cluster, and NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and NAS cluster communicate via the monitoring thread and the master process, enabling configuration data synchronization between the SAN and NAS clusters. This effectively enables independent yet interconnected cluster management of the SAN and NAS clusters. Information exchange between the monitoring thread and the master thread enables centralized NAS storage under a new unified architecture, resulting in more efficient cluster management.
[0174] Based on the above embodiment, another NAS-based cluster management method is provided in this embodiment, which can be used for the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. FIG5 is a flow chart of another NAS-based cluster management method provided in this embodiment. As shown in FIG5 , the flow includes the following steps:
[0175] Step S501 : Periodically obtain the current status of the network attached storage system and the current environment information of the centralized cluster.
[0176] Step S502: When it is determined based on the current state and environment information that the NAS system is to be switched to a target state, a state switching instruction is generated.
[0177] Step S503: Send a state switching instruction to the network attached storage system corresponding to each node in the centralized cluster.
[0178] Used to complete state switching of the master process deployed in each network-attached storage system.
[0179] In an embodiment of the present application, a NAS-based cluster management method is provided. A monitoring thread in a master node periodically monitors the current state of the NAS system and the current environment of the centralized cluster. Based on the current state and the information provided, a determination is made as to whether the NAS system needs to switch state, and the target state to which it should switch. When it is determined that the NAS system needs to switch to the target state, a state switching instruction is generated and sent to the NAS system corresponding to each node in the centralized cluster, for the master process deployed in each NAS system to complete the state switching operation.
[0180] Based on the embodiment shown in FIG. 4 , when a state switching request fed back by the first master process is received, another NAS-based cluster management method is provided in this embodiment, which can be used for the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. FIG. 6 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application. As shown in FIG. 6 , the flow includes the following steps:
[0181] Step S601: acquiring the current state of the network attached storage system and the current environment information of the centralized cluster according to the state switching request.
[0182] Step S602: When it is determined based on the current state and environment information that the NAS system is to be switched to a target state, a state switching instruction is generated.
[0183] Step S603: Send the state switching instruction to the first main process.
[0184] The first main process is used to complete the state switching operation of the network attached storage system, wherein the first main process is the main process included in the network attached storage system corresponding to any node in the centralized cluster.
[0185] In some embodiments, in addition to the monitoring thread in the master node being able to monitor the status of the NAS system and the environmental information of the centralized cluster, each master process can actually also periodically self-check its internal status, that is, self-check the status of the NAS system and the environmental information of the centralized cluster. Then, based on the status of the NAS system and the environmental information of the centralized cluster, determine whether it is necessary to switch the status and determine the target state to be switched. Once it is determined that it is necessary to switch to the target state, it is necessary to send a request message, that is, a state switching request, to the monitoring thread of the master node to ask whether it is possible to switch to the target state. After receiving the state switching request, the monitoring thread will also obtain the status of the NAS system and the current environmental information of the centralized cluster by itself to further verify whether a state switching is necessary. If the verification result is consistent with the result of the first master process's request, a state switching instruction is sent to the first master process so that the first master process can complete the state switching operation on the NAS system.
[0186] Based on any of the foregoing embodiments, the method may further include: sending a state switching instruction to other main processes except the first main process, so that the other main processes except the first main process complete the state switching operation of the network attached storage system according to the state switching instruction.
[0187] In some embodiments, in order to achieve configuration data synchronization, the monitoring thread not only needs to send a state switching instruction to the first main process, but also needs to send a state switching instruction to the main processes set in other nodes, so that all main processes complete the state switching of the NAS system.
[0188] Based on any of the foregoing embodiments, the method may further include: upon receiving a response message after the state switching is completed, sent by a master process included in the network-attached storage system corresponding to all nodes in the centralized cluster, synchronously updating the current state of the network-attached storage system stored in the storage area network of each node.
[0189] In some embodiments, after completing a state switch, each master process needs to send a response message to the master node's monitoring thread to indicate that the state switch has been completed. This allows the master node's monitoring thread to synchronously update the current state of the NAS system recorded by each node's SAN system based on the response message.
[0190] In an optional embodiment, the environmental information includes one or more of the following:
[0191] The status of the storage area network, network attached storage system, file system identification information, file system status, storage pool status, volume status, and acquired alarm information in the current environment.
[0192] In an optional embodiment, the status of the network attached storage system includes one or more of the following: powered on, running, hot backup, started, stopped, stopped, and down.
[0193] In some embodiments, the states in this application document only include these 7 states. Compared with the switching operations of more than a dozen states in the related art, state switching will be simpler, the switching logic for each state will also be simpler, and the state switching efficiency will be higher.
[0194] In an optional embodiment, a communication connection is established between the monitoring thread and the main process in each node via a heartbeat, and the heartbeat frequency includes multiple levels.
[0195] In some embodiments, heartbeat verification is used to verify whether both parties are in normal working state, and different heartbeat frequency gears can be configured according to different working states.
[0196] Based on the above embodiment, the method may further include:
[0197] When it is determined that the current state of the network attached storage system is the first target state and the heartbeat frequency gear is not at the lowest gear, a first gear adjustment instruction is sent to a master process included in the network attached storage system corresponding to each node in the centralized cluster, the first gear adjustment instruction being used to instruct to automatically lower the heartbeat frequency gear by one gear;
[0198] or,
[0199] When it is determined that the current state of the network attached storage system has changed, or when it is determined that the current state of the network attached storage system has become abnormal, a second gear adjustment instruction is sent to a master process included in the network attached storage system corresponding to each node in the centralized cluster, where the second gear adjustment instruction is used to adjust the heartbeat frequency gear to the highest gear.
[0200] In some embodiments, when the current state of the NAS system is the first target state, it indicates that the current NAS system is in a stable state. If the heartbeat frequency gear is not at the lowest gear at this time, a first gear adjustment instruction may be sent to the master process included in the network attached storage system corresponding to each node in the centralized cluster. The first gear adjustment instruction is used to instruct the heartbeat frequency gear to be automatically adjusted down by one gear, thereby reducing the frequency of heartbeat access, reducing resource usage, and avoiding unnecessary resource waste.
[0201] However, once it is determined that the status of the NAS system has changed or an abnormality has occurred, it is necessary to adjust the heartbeat frequency gear to the highest gear. Through frequent heartbeat access, the current system status can be determined in real time to avoid unnecessary losses.
[0202] In this embodiment, another NAS-based cluster management method is provided, which can be used for the above-mentioned mobile terminals, such as mobile phones and tablet computers. FIG7 is a flow chart of another NAS-based cluster management method provided in an embodiment of the present application. As shown in FIG7 , the method flow is executed by the main process in any node, and the method flow includes the following steps:
[0203] Step S701: Obtain an operation instruction sent by a monitoring thread in a master node.
[0204] Step S702: According to the operation instruction, perform the operation corresponding to the operation instruction to complete the configuration data synchronization operation.
[0205] The configuration data synchronization operation includes a state switching operation of the network attached storage system or a restart operation of the network attached storage system.
[0206] The embodiment of the present application provides a NAS-based cluster management method, in which a master node and a slave node are configured in a centralized cluster. Each node includes a host machine and a docker container. The SAN storage system is deployed in the host machine, and the NAS system is deployed in the docker container. This is equivalent to isolating the SAN and NAS using docker containers, and the degree of isolation will be better. For example, when the NAS needs to upgrade certain dependent libraries, but the SAN does not, only the dependent libraries inside the docker can be upgraded, and the SAN cluster does not need to be processed. When the NAS needs to expand its functions, it is not necessary to consider the implementation of these functions and the impact of the newly added dependent libraries on the SAN. The inside and outside of the docker are equivalent to two terminals that do not interfere with each other. At the same time, the NAS cluster is implemented inside the docker. If the user needs to upgrade the NAS function of the existing storage device, but still uses the SAN function at the same time, the docker image can be directly replaced without affecting the SAN function. Based on this, it can be considered that this management architecture has better scalability and reduces the impact on storage services.
[0207] A monitoring thread is set in the SAN storage system, and a main process is set in the NAS system. The SAN systems in multiple nodes constitute a SAN cluster, and the NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and the NAS cluster are connected in communication via the monitoring thread and the main process. When the main process receives an operation instruction sent by the monitoring thread, it can perform corresponding operations according to the operation instruction to synchronize the configuration data in the SAN cluster and the NAS cluster. The configuration data synchronization operation may include but is not limited to the state switching of the NAS system, or the switching operation of the heartbeat frequency between the main process and the monitoring thread in each node. In this way, it is equivalent to realizing the independent and interrelated cluster management of the SAN cluster and the NAS cluster. Based on the information interaction between the monitoring thread and the main thread, centralized NAS storage under a new unified architecture is realized, and cluster management is more efficient.
[0208] Based on the embodiment corresponding to FIG. 7 , another NAS-based cluster management method is provided in this embodiment, which can be used for the above-mentioned mobile terminals, such as mobile phones and tablet computers. FIG. 8 is a flow chart of another NAS-based cluster management method provided in this embodiment of the application. As shown in FIG. 8 , the flow includes the following steps:
[0209] Step S801 : Periodically obtain the current status of the network attached storage system and the current environment information of the centralized cluster.
[0210] Step S802: When it is determined based on the current state and environment information that the NAS system is to be switched to a target state, a state switching request is sent to a monitoring thread in the master node.
[0211] Step S803: When a state switching instruction corresponding to the state switching request is received from the monitoring thread in the master node, the state of the network attached storage system is switched to the target state.
[0212] In some embodiments, each main process can also periodically self-check its internal status, that is, self-check the status of the NAS system and the environmental information of the centralized cluster. Then, based on the status of the NAS system and the environmental information of the centralized cluster, determine whether it is necessary to switch the status and determine the target state to be switched. Once it is determined that it is necessary to switch to the target state, it is necessary to send a request information to the monitoring thread of the master node, that is, a state switching request, to ask whether it is possible to switch to the target state. After receiving the state switching request, the monitoring thread will also obtain the status of the NAS system and the current environmental information of the centralized cluster by itself to further verify whether a state switching is required. If the verification result is consistent with the result of the first main process request, a state switching instruction is sent to the first main process to enable the first main process to complete the state switching operation on the NAS system.
[0213] Based on the embodiment corresponding to FIG8 , the method may further include:
[0214] When receiving the state switching instruction corresponding to the state switching request fed back by the monitoring thread in the master node and switching the state of the network attached storage system to the target state, a switching completion response message is generated and sent to the monitoring thread corresponding to the master node.
[0215] In some embodiments, after completing a state switch, each master process needs to send a response message to the master node's monitoring thread to indicate that the state switch has been completed. This allows the master node's monitoring thread to synchronously update the current state of the NAS system recorded by each node's SAN system based on the response message.
[0216] Based on the embodiment corresponding to FIG. 7 or FIG. 8 , the method may further include:
[0217] Obtain the metadata sent by the main process corresponding to the target service protocol, encapsulate the metadata, and then execute the disk operation. The data corresponding to the metadata is directly sent to the storage pool by the main process corresponding to the target service protocol for disk operation.
[0218] In some embodiments, data and metadata are separated by modifying the target service protocol—that is, adjusting the business logic. Once separated, the process corresponding to the target service protocol automatically sends the data to the storage pool for storage. Simultaneously, a direct communication connection is established with the master process of any node, sending metadata to the master process. The master process then encapsulates and processes the metadata, storing it on disk. Because metadata processing is performed within the master process, no external file system is required, eliminating reliance on open source file systems.
[0219] The implementation process in the above method embodiment has been described in detail at the beginning of the specific implementation method of the embodiment of this application, so it will not be repeated here.
[0220] This embodiment also provides a NAS-based cluster management device, which is configured to implement any of the embodiments and optional implementations shown in Figures 4 to 6 above. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0221] This embodiment provides a NAS-based cluster management device, as shown in FIG9 , including: an acquisition module 901 , a processing module 902 , a synchronization module 903 , and a sending module 904 .
[0222] An acquisition module 901 is configured to provide an operation instruction, wherein the operation instruction is used to instruct the execution of a state switching operation or a restart operation of the network attached storage system;
[0223] The processing module 902 is configured to generate an operation result according to the operation instruction;
[0224] The synchronization module 903 is configured to synchronize the operation result to the monitoring thread corresponding to each slave node, so as to complete the configuration data synchronization in the storage area network deployed in the slave node by the monitoring thread corresponding to the slave node;
[0225] The sending module 904 is configured to sequentially send the operation results to the network attached storage system corresponding to each node in the centralized cluster, so as to complete configuration data synchronization with the main process deployed in the network attached storage system corresponding to each node.
[0226] In an optional embodiment, the acquisition module 901 is further configured to periodically acquire the current state of the network attached storage system and the current environment information of the centralized cluster;
[0227] The processing module 902 is further configured to generate a state switching instruction when determining that the network attached storage system is to be switched to a target state based on the current state and environment information;
[0228] The sending module 904 is further configured to send a state switching instruction to the network attached storage system corresponding to each node in the centralized cluster, so that the main process deployed in each network attached storage system completes the state switching.
[0229] In an optional embodiment, the apparatus further includes: a receiving module 905;
[0230] The receiving module 905 is configured to receive a state switching request fed back by a first master process, wherein the first master process is a master process included in a network attached storage system corresponding to any node in the centralized cluster;
[0231] The processing module 902 is configured to generate a state switching instruction when determining that the network attached storage system is to be switched to a target state based on the current state and environment information;
[0232] The sending module 904 is further configured to send the state switching instruction to the first main process, so that the first main process completes the state switching operation on the network attached storage system.
[0233] In an optional embodiment, the sending module 904 is further configured to send the state switching instruction to other main processes except the first main process, so that the other main processes except the first main process complete the state switching operation of the network attached storage system according to the state switching instruction.
[0234] In an optional embodiment, the receiving module 905 is further configured to receive response information after the state switching is completed, sent by the master process included in the network attached storage system corresponding to all nodes in the centralized cluster;
[0235] The synchronization module 903 is further configured to synchronously update the current status of the network attached storage system stored in the storage area network in each node.
[0236] In an optional embodiment, the environmental information includes one or more of the following:
[0237] The status of the storage area network, network attached storage system, file system identification information, file system status, storage pool status, volume status, and acquired alarm information in the current environment.
[0238] In an optional embodiment, the status of the network attached storage system includes one or more of the following:
[0239] Power on, Running, Hot Backup, Start, Stop, Stopped, and Down.
[0240] In an optional implementation, a communication connection is established between the monitoring thread and the main process in each node via a heartbeat, and the heartbeat frequency includes multiple levels.
[0241] In an optional embodiment, the processing module 902 is further configured to determine the current state of the network attached storage system and the heartbeat frequency level;
[0242] The sending module 904 is configured to, when the processing module 902 determines that the current state of the NAS system is the first target state and the heartbeat frequency gear is not at the lowest gear, send a first gear adjustment instruction to the main process included in the NAS system corresponding to each node in the centralized cluster, the first gear adjustment instruction being used to instruct the heartbeat frequency gear to be automatically adjusted down by one gear; or, when the processing module 902 determines that the current state of the NAS system has changed or that the current state of the NAS system has been abnormal, send a second gear adjustment instruction to the main process included in the NAS system corresponding to each node in the centralized cluster, the second gear adjustment instruction being used to adjust the heartbeat frequency gear to the highest gear.
[0243] The NAS-based cluster management device in this embodiment is presented in the form of a functional module. The module here refers to an application-specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0244] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0245] The embodiment of the present application provides a NAS-based cluster management device, which is configured with a master node and a slave node in a centralized cluster. Each node includes a host machine and a docker container. The SAN storage system is deployed in the host machine, and the NAS system is deployed in the docker container. This is equivalent to isolating the SAN and NAS using docker containers, and the degree of isolation will be better. For example, when the NAS needs to upgrade certain dependent libraries, but the SAN does not, only the dependent libraries inside the docker can be upgraded, and the SAN cluster does not need to be processed. When the NAS needs to expand its functions, it is not necessary to consider the implementation of these functions and the impact of the newly added dependent libraries on the SAN. The inside and outside of the docker are equivalent to two terminals that do not interfere with each other. At the same time, the NAS cluster is implemented inside the docker. If the user needs to upgrade the NAS function of the existing storage device, but still uses the SAN function at the same time, the docker image can be directly replaced without affecting the SAN function. Based on this, it can be considered that this management architecture has better scalability and reduces the impact on storage services.
[0246] Furthermore, a monitoring thread is set up in the SAN storage system, and a master process is set up in the NAS system. SAN systems in multiple nodes constitute a SAN cluster, and NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and NAS cluster communicate via the monitoring thread and the master process, enabling configuration data synchronization between the SAN and NAS clusters. This effectively enables independent yet interconnected cluster management of the SAN and NAS clusters. Information exchange between the monitoring thread and the master thread enables centralized NAS storage under a new unified architecture, resulting in more efficient cluster management.
[0247] This embodiment also provides another NAS-based cluster management device, which is configured to implement the embodiments and optional implementations corresponding to any of the above-mentioned Figures 7 and 8. Details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0248] This embodiment provides a NAS-based cluster management device, as shown in FIG10 , including: an acquisition module 1001 and a processing module 1002 .
[0249] The acquisition module 1001 is configured to acquire an operation instruction sent by the main process;
[0250] The processing module 1002 is configured to execute an operation corresponding to the operation instruction according to the operation instruction to complete the configuration data synchronization operation, wherein the configuration data synchronization operation includes a state switching operation of the network attached storage system or a heartbeat frequency switching operation between the main process and the monitoring thread.
[0251] In an optional embodiment, the apparatus further includes: a sending module 1003 and a receiving module 1004;
[0252] The acquisition module 1001 is further configured to periodically acquire the current status of the network attached storage system and the current environment information of the centralized cluster;
[0253] The processing module 1002 is further configured to determine whether the network attached storage system is switched to a target state based on the current state and environment information;
[0254] The sending module 1003 is further configured to send a state switching request to the monitoring thread in the master node when the processing module 1002 determines that the network attached storage system is to be switched to the target state;
[0255] The receiving module 1004 is further configured to receive a state switching instruction corresponding to the state switching request fed back by the monitoring thread;
[0256] The processing module 1002 is further configured to switch the state of the network attached storage system to a target state according to the state switching instruction.
[0257] In an optional implementation, the processing module 1002 is further configured to generate a handover completion response message;
[0258] The sending module 1003 is further configured to send response information to the monitoring thread corresponding to the master node.
[0259] In an optional embodiment, the acquisition module 1001 is further configured to acquire metadata sent by the main process corresponding to the target service protocol;
[0260] The processing module 1002 is further configured to perform a write operation on the disk after encapsulating the metadata, wherein the data corresponding to the metadata is directly sent to the storage pool by the main process corresponding to the target service protocol for write operation.
[0261] The NAS-based cluster management device in this embodiment is presented in the form of a functional module. The module here refers to an application-specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0262] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0263] The embodiment of the present application provides a NAS-based cluster management device, which is configured with a master node and a slave node in a centralized cluster. Each node includes a host machine and a docker container. The SAN storage system is deployed in the host machine, and the NAS system is deployed in the docker container. This is equivalent to isolating the SAN and NAS using docker containers, and the degree of isolation will be better. For example, when the NAS needs to upgrade certain dependent libraries, but the SAN does not, only the dependent libraries inside the docker can be upgraded, and the SAN cluster does not need to be processed. When the NAS needs to expand its functions, it is not necessary to consider the implementation of these functions and the impact of the newly added dependent libraries on the SAN. The inside and outside of the docker are equivalent to two terminals that do not interfere with each other. At the same time, the NAS cluster is implemented inside the docker. If the user needs to upgrade the NAS function of the existing storage device, but still uses the SAN function at the same time, the docker image can be directly replaced without affecting the SAN function. Based on this, it can be considered that this management architecture has better scalability and reduces the impact on storage services.
[0264] A monitoring thread is set in the SAN storage system, and a main process is set in the NAS system. The SAN systems in multiple nodes constitute a SAN cluster, and the NAS systems in multiple nodes constitute a NAS cluster. The SAN cluster and the NAS cluster are connected in communication via the monitoring thread and the main process. When the main process receives an operation instruction sent by the monitoring thread, it can perform corresponding operations according to the operation instruction to synchronize the configuration data in the SAN cluster and the NAS cluster. The configuration data synchronization operation may include but is not limited to the state switching of the NAS system, or the switching operation of the heartbeat frequency between the main process and the monitoring thread in each node. In this way, it is equivalent to realizing the independent and interrelated cluster management of the SAN cluster and the NAS cluster. Based on the information interaction between the monitoring thread and the main thread, centralized NAS storage under a new unified architecture is realized, and cluster management is more efficient.
[0265] An embodiment of the present application further provides a computer device having the NAS-based cluster management apparatus shown in FIG. 9 or FIG. 10 .
[0266] Please refer to Figure 11, which is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present application. As shown in Figure 11, the computer device includes: one or more processors 10, a memory 20, and interfaces configured to connect various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 11 takes a processor 10 as an example.
[0267] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0268] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0269] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0270] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0271] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means, and FIG11 takes the bus connection as an example.
[0272] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., a light emitting diode), and a tactile feedback device (e.g., a vibration motor). The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0273] The present application also provides a computer non-volatile readable storage medium. The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a non-volatile readable storage medium, or implemented as a computer code that is originally stored in a remote non-volatile readable storage medium or a non-transitory machine non-volatile readable storage medium and is downloaded through a network and will be stored in a local non-volatile readable storage medium, so that the method described herein can be stored in such software processing on a non-volatile readable storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the non-volatile readable storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the non-volatile readable storage medium can also include a combination of the above-mentioned types of memory. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the method shown in the above embodiment is implemented.
[0274] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A cluster management method based on NAS, characterized in that: The method is applied to a centralized cluster, wherein the centralized cluster includes a master node and at least one slave node, each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a docker container, a monitoring thread is provided in the storage area network, and a main process is provided in the network attached storage system. The method is executed by the monitoring thread in the master node, and the method includes: After obtaining the operation instruction, generating an operation result according to the operation instruction, wherein the operation instruction is used to instruct to execute a state switching operation of the network attached storage system or to execute a restart operation of the network attached storage system; Synchronizing the operation result to the monitoring thread corresponding to each of the slave nodes, so that the monitoring thread corresponding to the slave node completes configuration data synchronization in the storage area network deployed in the slave node; The operation results are sequentially sent to the network attached storage system corresponding to each node in the centralized cluster, so that the main process deployed in the network attached storage system corresponding to each node completes the configuration data synchronization.
2. The method according to claim 1, characterized in that The method further comprises: Periodically obtaining the current state of the network attached storage system and the current environment information of the centralized cluster; When it is determined according to the current state and the environmental information that the configuration data network attached storage system is to be switched to a target state, a state switching instruction is generated and sent to the network attached storage system corresponding to each node in the centralized cluster, so that the main process deployed in each of the network attached storage systems completes the state switching.
3. The method according to claim 1, characterized in that When receiving a state switching request fed back by the first main process, the method further includes: According to the state switching request, obtaining the current state of the network attached storage system and the current environment information of the centralized cluster; When it is determined that the network attached storage system is to be switched to a target state according to the current state and the environment information, a state switching instruction is generated; The state switching instruction is sent to the first main process so that the first main process completes the state switching operation on the network attached storage system, wherein the first main process is the main process included in the network attached storage system corresponding to any node in the centralized cluster.
4. The method according to claim 3, characterized in that The method further comprises: The state switching instruction is sent to other main processes except the first main process, so that the other main processes except the first main process complete the state switching operation on the network attached storage system according to the state switching instruction.
5. The method according to claim 4, characterized in that The method further comprises: After receiving the response information after the state switching is completed sent by the main process included in the network attached storage system corresponding to all nodes in the centralized cluster, the current state of the network attached storage system stored in the storage area network of each node is synchronously updated.
6. The method according to claim 2, characterized in that The environmental information includes one or more of the following: The status of the storage area network, the status of the network attached storage system, the file system identification information, the file system status, the storage pool status, the volume status, and the acquired alarm information in the current environment.
7. The method according to claim 2 or 3, characterized in that: The state of the network attached storage system includes one or more of the following: Power On, Running, Hot Standby, Start, Stop, Stopped, and Down.
8. The method according to claim 7, characterized in that A communication connection is established between the monitoring thread and the main process in each node through heartbeats, and the heartbeat frequency includes multiple levels.
9. The method according to claim 8, characterized in that The monitoring thread in each node and the main process establish a communication connection through a heartbeat, including: The main process and the monitoring thread in each node respectively start a sub-thread, and send heartbeat messages to each other at the current heartbeat frequency level through the sub-threads started by each node, wherein the heartbeat messages are used to inform the other party of its current status.
10. The method according to claim 9, characterized in that The heart rate includes 4 heart rate gears, which are 5s / time, 30s / time, 1min / time, and 5min / time, respectively, and 5s / time is the default heart rate gear.
11. The method according to claim 9, characterized in that The heartbeat message includes a want_state field and an fsid field, wherein the want_state field is used to indicate the state to be switched, and the fsid field is used to record the state to which the network attached storage system needs to switch and the id of the file system to be taken over.
12. The method according to claim 8, characterized in that When it is determined that the current state of the network attached storage system is the first target state and the heartbeat frequency gear is not the lowest gear, a first gear adjustment instruction is sent to a main process included in the network attached storage system corresponding to each node in the centralized cluster, wherein the first gear adjustment instruction is used to instruct to automatically lower the heartbeat frequency gear by one gear; or, When it is determined that the current state of the network attached storage system has changed, or when it is determined that the current state of the network attached storage system is abnormal, a second gear adjustment instruction is sent to a main process included in the network attached storage system corresponding to each node in the centralized cluster, and the second gear adjustment instruction is used to adjust the heartbeat frequency gear to the highest gear.
13. A cluster management method based on NAS, characterized in that: The method is applied to a centralized cluster, wherein the centralized cluster includes a master node and at least one slave node, each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a docker container, a monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system. The method is executed by the master process in any node, and the method includes: Obtain the operation instructions sent by the monitoring thread in the master node; According to the operation instruction, an operation corresponding to the operation instruction is performed to complete a configuration data synchronization operation, wherein the configuration data synchronization operation includes a state switching operation of the network attached storage system or a restart operation of the network attached storage system.
14. The method according to claim 13, characterized in that The method further comprises: Periodically obtaining the current state of the network attached storage system and the current environment information of the centralized cluster; When it is determined that the network attached storage system is to be switched to a target state according to the current state and the environment information, sending a state switching request to a monitoring thread in the master node; When a state switching instruction corresponding to the state switching request is received and fed back by the monitoring thread in the master node, the state of the network attached storage system is switched to the target state.
15. The method according to claim 14, characterized in that After receiving the state switching instruction corresponding to the state switching request fed back by the monitoring thread in the master node and switching the state of the network attached storage system to the target state, the method further includes: Generate a response message indicating that the switching is completed, and send it to the monitoring thread corresponding to the master node.
16. The method according to claim 13, characterized in that The method further comprises: The metadata sent by the main process corresponding to the target service protocol is obtained, the metadata is packaged and processed, and then a disk write operation is performed, wherein the data corresponding to the metadata is directly sent by the main process corresponding to the target service protocol to the storage pool for a disk write operation.
17. A cluster management device based on NAS, characterized in that: The device is applied to a centralized cluster, wherein the centralized cluster includes a master node and at least one slave node, each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a docker container, a monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system, and the device includes: An acquisition module is configured to be an operation instruction, wherein the operation instruction is used to instruct to execute a state switching operation of the network attached storage system or to execute a restart operation of the network attached storage system; A processing module, configured to generate an operation result according to the operation instruction; A synchronization module, configured to synchronize the operation result to a monitoring thread corresponding to each slave node, so that the monitoring thread corresponding to the slave node completes configuration data synchronization in a storage area network deployed in the slave node; The sending module is configured to send the operation results to the network attached storage system corresponding to each node in the centralized cluster in sequence, so as to complete the configuration data synchronization with the main process deployed in the network attached storage system corresponding to each node.
18. A cluster management device based on NAS, characterized in that: The device is applied to a centralized cluster, wherein the centralized cluster includes a master node and at least one slave node, each node includes a storage area network deployed in a host machine and a network attached storage system deployed in a docker container, a monitoring thread is provided in the storage area network, and a master process is provided in the network attached storage system, and the device includes: An acquisition module is configured to acquire operation instructions sent by the main process; The processing module is configured to execute an operation corresponding to the operation instruction according to the operation instruction to complete a configuration data synchronization operation, wherein the configuration data synchronization operation includes a state switching operation of a network attached storage system or a heartbeat frequency switching operation between the main process and the monitoring thread.
19. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the computer executes the NAS-based cluster management method according to any one of claims 1 to 12 by executing the computer instructions, or the computer executes the NAS-based cluster management method according to any one of claims 13 to 16 by executing the computer instructions.
20. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the NAS-based cluster management method described in any one of claims 1 to 12, or the computer executes the NAS-based cluster management method described in any one of claims 13 to 16 by executing the computer instructions.
Citation Information
Patent Citations
Method, apparatus and device for designing network attached storage cluster
CN107734026A
Multi-service distributed cluster deployment system and method
CN110519348A
Storage upgrading method and device based on Docker virtualization technology
CN112087516A
Cluster management method and device based on NAS, computer equipment and medium
CN117149095A
Containerized data mover for data protection workloads
US20230267052A1
Cited By
New energy station real-time data acquisition method and system based on edge calculation
CN120879962A
Database operation method and system on network attached storage device
CN121092623A
Message transmission method and electronic equipment
CN121309531A
Data management method and device, computer equipment and storage medium
CN121743312A