System operation method and device, equipment, storage medium and program product

By sending running instructions to the second service node in the distributed file system, loading the distributed file system and closing the shared storage space dependent on by the first service node, the file data access error caused by the client notification delay during the service node switching is solved, and the system reliability and stability are achieved.

CN119652911AActive Publication Date: 2025-03-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411776332.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-18
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In a distributed file system, when the service node is switched, the client notification delay causes some clients to still access the old service node, resulting in file data access errors.

Method used

The management node sends run instructions to the second service node, instructing it to load the distributed file system, and close the target shared storage space that the first service node depends on, thereby avoiding the two service nodes running simultaneously.

Benefits of technology

Ensure the correctness of file data access, avoid access errors, and improve the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652911A_ABST
    Figure CN119652911A_ABST
Patent Text Reader

Abstract

The invention relates to a system operation method and device, equipment, a storage medium and a program product. The method comprises the steps that under the condition that it is determined that a first service node cannot continue to operate the distributed file system, an operation instruction is sent to a second service node so as to instruct the second service node to obtain first file operation data from a management node, and therefore the distributed file system is loaded and operated on the second service node; under the condition that an acquisition request sent by a second service node is received, first file operation data is sent to the second service node; the first file running data is uploaded to the management node in the process of running the distributed file system by the first service node; the operation instruction is further used for instructing the second service node to determine a target shared storage space for storing target operation data corresponding to the first file operation data according to the first file operation data and requesting to close the target shared storage space. By adopting the method, file data access errors can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a system operation method, device, equipment, storage medium and program product. Background Art

[0002] A distributed file system allows clients to access data files in the system through the network. Usually, a distributed file system can run on one service node, but in order to improve the reliability of the system operation, multiple service nodes can be set up, so that when the current service node cannot run, other service nodes can be switched to run the distributed file system. Among them, when the service node running the distributed file system changes, all clients need to be notified of the new service node so that each client can access the file data of the distributed file system through the new service node next time.

[0003] However, if the number of clients is too large, it will take some time to notify all clients of the new service node. In this case, some clients may think that the distributed file system is running on the original service node while other clients may think that the distributed file system is running on the new service node. In this case, if the two clients access the same file data in the distributed file system at the same time, access errors may occur. Summary of the invention

[0004] Based on this, it is necessary to provide a system operation method, device, equipment, storage medium and program product that can avoid file data access errors in response to the above technical problems.

[0005] In a first aspect, the present application provides a system operation method for managing nodes, the method comprising:

[0006] When it is determined that the first service node cannot continue to run the distributed file system, sending an operation instruction to the second service node; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to run the distributed file system after loading the distributed file system on the second service node according to the first file operation data;

[0007] In the case of receiving the acquisition request sent by the second service node, sending the first file operation data to the second service node; the first file operation data is uploaded to the management node during the process of the first service node running the distributed file system;

[0008] The operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

[0009] In one embodiment, sending an operation instruction to the second service node includes:

[0010] When it is determined that the first service node cannot continue to run the distributed file system, the current logical clock is determined and the current logical clock is used as the target logical clock; an operation instruction with the target logical clock is generated according to the target logical clock; the operation instruction is sent to the second service node; wherein, when the second file operation data is generated during the process of the second service node running the distributed file system, the target logical clock is used for the second service node to bind the second file operation data with the target logical clock and then send it to the management node.

[0011] In one embodiment, the method further comprises:

[0012] Receive the latest first file operation data and the first logical clock sent by the first service node; the latest first file operation data is used to request the management node to store the latest first file operation data; when it is determined that the first logical clock is not the target logical clock, refuse to store the latest first file operation data, and send a stop instruction to the first service node; wherein the stop instruction is used to instruct the first service node to stop running the distributed file system.

[0013] In one embodiment, the method further comprises:

[0014] Receive a first notification message sent by the second service node; and when it is determined that the first notification message indicates that the second service node has successfully loaded the distributed file system, send a system view to the client and the first service node; wherein the system view is at least used to describe that the distributed file system is currently running on the second service node.

[0015] In one of the embodiments, the system view is used to instruct the first service node to stop running the distributed file system upon receiving the system view.

[0016] In one of the embodiments, the first file operation data includes at least one of a first file list and a second file list; the first file list includes multiple first group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the first group block identifier; the second file list includes multiple second group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the second group block identifier.

[0017] In a second aspect, the present application also provides a system operation device. For managing nodes, the device includes:

[0018] A first sending module is used to send an operation instruction to the second service node when it is determined that the first service node cannot continue to operate the distributed file system; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to operate the distributed file system after loading the distributed file system on the second service node according to the first file operation data;

[0019] A second sending module is used to send the first file operation data to the second service node when receiving the acquisition request sent by the second service node; the first file operation data is uploaded to the management node during the process of the first service node running the distributed file system;

[0020] The operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

[0021] In one embodiment, the first sending module is specifically configured to:

[0022] When it is determined that the first service node cannot continue to run the distributed file system, the current logical clock is determined and the current logical clock is used as the target logical clock; an operation instruction with the target logical clock is generated according to the target logical clock; the operation instruction is sent to the second service node; wherein, when the second file operation data is generated during the process of the second service node running the distributed file system, the target logical clock is used for the second service node to bind the second file operation data with the target logical clock and then send it to the management node.

[0023] In one embodiment, the device further includes a first receiving module, configured to:

[0024] Receive the latest first file operation data and the first logical clock sent by the first service node; the latest first file operation data is used to request the management node to store the latest first file operation data; when it is determined that the first logical clock is not the target logical clock, refuse to store the latest first file operation data, and send a stop instruction to the first service node; wherein the stop instruction is used to instruct the first service node to stop running the distributed file system.

[0025] In one embodiment, the device further includes a second receiving module, configured to:

[0026] Receive a first notification message sent by the second service node; and when it is determined that the first notification message indicates that the second service node has successfully loaded the distributed file system, send a system view to the client and the first service node; wherein the system view is at least used to describe that the distributed file system is currently running on the second service node.

[0027] In one of the embodiments, the system view is used to instruct the first service node to stop running the distributed file system upon receiving the system view.

[0028] In one of the embodiments, the first file operation data includes at least one of a first file list and a second file list; the first file list includes multiple first group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the first group block identifier; the second file list includes multiple second group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the second group block identifier.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect above.

[0031] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0032] The above-mentioned system operation method, device, equipment, storage medium and program product, when it is determined that the first service node cannot continue to run the distributed file system, sends an operation instruction to the second service node; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and run the distributed file system after loading the distributed file system on the second service node according to the first file operation data; when receiving the acquisition request sent by the second service node, the first file operation data uploaded to the management node during the process of the first service node running the distributed file system is sent to the second service node; wherein the operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space. In this way, the second service node can close the target shared storage space that the first service node depends on for operation after loading the distributed file system, so that the first service node cannot access the target shared storage space and thus cannot run, thereby avoiding the situation where two service nodes run the distributed file system at the same time, and avoiding the occurrence of file data access errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 An application environment diagram of a system operation method in an embodiment;

[0035] Figure 2 A schematic diagram of a flow chart of a system operation method in one embodiment;

[0036] Figure 3 A schematic diagram of the operation of a service node in an embodiment;

[0037] Figure 4 A schematic diagram of an architecture for accessing a distributed file system in one embodiment;

[0038] Figure 5 A schematic diagram of a flow chart of sending an operation instruction in an embodiment;

[0039] Figure 6 A schematic diagram of storing a first file list and a second file list in one embodiment;

[0040] Figure 7 A schematic diagram of a data update process in an embodiment;

[0041] Figure 8 is a schematic diagram of a process of sending a stop instruction to a first service node in an embodiment;

[0042] Fig. 9 A schematic diagram of system switching operation in an embodiment;

[0043] Fig.10 It is a structural block diagram of a system operation device in one embodiment;

[0044] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It should be understood that many specific details are set forth in the following description to facilitate a full understanding of the present application, but the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0047] A distributed file system allows clients to access data files in the system through the network. Usually, a distributed file system can run on one service node, but in order to improve the reliability of the system operation, multiple service nodes can be set up, so that when the current service node cannot run, other service nodes can be switched to run the distributed file system. Among them, when the service node running the distributed file system changes, all clients need to be notified of the new service node so that each client can access the file data of the distributed file system through the new service node next time.

[0048] However, if the number of clients is too large, it will take some time to notify all clients of the new service node. In this case, some clients may think that the distributed file system is running on the original service node while other clients may think that the distributed file system is running on the new service node. In this case, if the two clients access the same file data in the distributed file system at the same time, access errors may occur.

[0049] The system operation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the management node 101 is connected to multiple service nodes 102 and at least one client 103. Any service node can be used as a first service node. When the first service node is running, one of the other service nodes can be used as a second service node. The management node, the service node and the client can be services running on a computer device. In other words, the management node, the service node and the client can be a computer device. Among them, the computer device can be but not limited to various personal computers, laptops, tablet computers or servers, etc., and the server can be implemented with an independent server or a server cluster composed of multiple servers.

[0050] In one embodiment, Figure 2 As shown, a system operation method is provided, which is applied to Figure 1 Taking the management node 101 in FIG. 1 as an example, the following steps are included:

[0051] Step 201: When it is determined that the first service node cannot continue to run the distributed file system, a running instruction is sent to the second service node.

[0052] The distributed file system is, for example, DBFS (Database File System), which is not fully exemplified here. The distributed file system is referred to as a file system hereinafter.

[0053] When the file system runs on the first service node, the client can access the file system based on the first service node and process the files in the file system, such as performing opening operations, expansion operations, and writing operations on the files, etc., which are not specifically limited here.

[0054] Optionally, the first service node can be implemented by streamfs mds. Streamfs mds is a streaming file system metadata service node, responsible for loading the metadata service of the file system namespace (namespace), responding to metadata access and update requests transmitted by streamfs client, and ensuring the semantics of file write-once-read-many. streamfsclient is the semantic interface SDK of streamfs append-type file system, used to map the semantics of files to shared storage space, and provide file access interface, such as supporting file operations such as append, read, delete, and modify name.

[0055] Here, streamfs is an append-only distributed file system based on a shared storage subsystem (chunk subsystem) in the storage engine. The append-only distributed file system is a special distributed file system. Its core feature is that data can only be written in an appending manner, and does not support traditional in-place modification operations. Among them, streamfs allows clients to access resources in streamfs through the network after connecting to the streamfs client, and provides a shared access method of one write and multiple reads for the same file. Streamfs provides data access services with eventual consistency. In the case of one write and multiple reads, non-local reading clients may not be able to read the latest data, but they can eventually read the latest data. In the distributed engine, streamfs, as the underlying file system of the KV database, can support large files of the order of hundreds of billions through its own powerful horizontal expansion capabilities, thereby supporting ultra-large-scale clusters and distributed KV databases of the order of hundreds of billions.

[0056] In an optional implementation, the first service node relies on a lease to run, and when the lease expires, the first service node cannot continue to run the distributed file system.

[0057] In an optional implementation, when the first service node is disconnected from the network and loses connection with the management node, the management node believes that the first service node cannot continue to run the distributed file system.

[0058] Among them, relying on the expiration of the lease is a technology used in distributed systems to ensure data consistency and prevent resource competition. Most distributed file systems rely on the expiration of the lease. In a distributed file system, a lease is a time-limited authorization that allows the holder to have exclusive access to a resource for a certain period of time. When the lease expires, if the holder does not renew the lease, the system will automatically reclaim the resource, which is the so-called "expiration end".

[0059] However, in a distributed system, when a process is in an "uninterruptible sleep" (D) state because it is waiting for IO operations, it may not be able to respond immediately to the end-of-run signal or request, resulting in a brain split and loss of contact with other nodes. For example, due to a network failure or a node failure, the first service node loses connection with other nodes and becomes isolated. This may lead to inconsistent data and unavailable services. In addition, in the related art, in order to ensure that the service nodes running the distributed file system do not have a brain split, the system needs to be restarted at this time. However, restarting the system will cause all services on the system to be restarted, which has a high execution cost. If containers or virtual machines are used to implement microservices, the ultimate latency cannot be guaranteed.

[0060] Exemplary, reference Figure 3 The service node operation diagram shown in the figure shows that service nodes 1 to n are connected to the management node. When service node 1 runs the file system, if a network disconnection or other failure occurs, resulting in network partition, the management node considers that the lease of service node 1 is invalid and instructs service node 2 to start loading the data of the file system. The lease system requires that the process of service node 1 must exit at this time, but in a Linux system, for example, when the process is in the D state while waiting for IO to return, the process cannot exit. At this time, service node 1 and service node 2 are both running the file system. In addition, both access the shared storage space.

[0061] In the embodiment of the present application, when the management node determines that the first service node cannot continue to run the distributed file system, the management node sends an operation instruction to the second service node. The operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to run the distributed file system after loading the distributed file system on the second service node according to the first file operation data.

[0062] The first file operation data is uploaded to the management node during the process of the first service node running the distributed file system. In this way, it is equivalent to migrating the file system to the second service node for operation. By providing multiple service nodes, the high reliability of the file system operation is guaranteed.

[0063] Step 202: When receiving the acquisition request sent by the second service node, send the first file operation data to the second service node.

[0064] After receiving the operation instruction, the second service node sends a request to the management node. The management node receives the request and sends the first file operation data to the second service node. In this way, the second service node loads the distributed file system according to the first file operation data.

[0065] The operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

[0066] Among them, each service node can access the shared storage space when running the file system. During the operation process, the first service node stores the target operation data in the target shared storage space in the shared storage space, obtains the identifier of the target shared storage space storing the target operation data as the first file operation data, and uploads it to the management node. In this way, the second service node can access the target storage space according to the first file operation data to run the file system.

[0067] In the embodiment of the present application, the shared storage space can be implemented by the chunk subsystem. The chunk subsystem is a subsystem that provides chunks, and operations such as applying for chunks, accessing and updating chunks can be performed through the chunk subsystem's SDK (Software Development Kit).

[0068] The chunk subsystem includes multiple chunks. The Chinese name of chunk is group block. Each chunk has a unique identifier. Each chunk provides a byte stream space that supports appending, similar to the mapping function of virtual address memory when writing. Optionally, the maximum storage capacity of each chunk can be set to 128M by default, and chunk operation interfaces for reading, appending, closing, deleting, and querying length are provided.

[0069] Correspondingly, the above-mentioned target shared storage space can be at least one target chunk in the chunk subsystem. Exemplarily, during the operation of the first service node, the client generates operation information after operating a certain file, and uses the operation information as the target operation data. The first service node applies for chunk1 from the shared storage space to store the target operation data. Then, the target operation data is stored in chunk1, and the identifier of chunk1 is used as the first file operation data and uploaded to the management node. For example, when an open operation is performed on file 1, the information of the open operation is used as the target operation data. In addition, when the first service node applies for a new chunk, the identifier of the new chunk is uploaded to the management node.

[0070] It can be seen that requesting to close the target shared storage space means closing the chunks that write the target operation data. In this way, since the first service node is using these chunks, closing them can prevent the first service node from continuing to write, making it impossible for the first service node to run the file system, ensuring that only the second service node runs the file system. In this way, when multiple clients access the file system, they can only successfully access it based on the second service node, avoiding file data processing errors.

[0071] The above system operation method, when it is determined that the first service node cannot continue to run the distributed file system, sends an operation instruction to the second service node; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and run the distributed file system after loading the distributed file system on the second service node according to the first file operation data; when receiving the acquisition request sent by the second service node, the first file operation data uploaded to the management node during the process of the first service node running the distributed file system is sent to the second service node; wherein the operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space. In this way, the second service node can close the target shared storage space that the first service node depends on for operation after loading the distributed file system, so that the first service node cannot access the target shared storage space and thus cannot run, thereby avoiding the situation where two service nodes run the distributed file system at the same time, and avoiding the occurrence of file data access errors.

[0072] In one embodiment, the management node may be implemented by a streamfs master, which is a streaming file system management cluster responsible for file system mounting, namespace creation, namespace loading, view management, and cluster configuration persistence.

[0073] Exemplarily, the streamfs master includes multiple cluster node masters, and the management node can be one of the cluster nodes.

[0074] Optionally, multiple cluster node masters may be run as multiple management nodes, wherein one management node is connected to each service node when running, and when the management node fails, a new management node is determined from other management nodes to connect to each service node.

[0075] For example, please refer to Figure 4 Schematic diagram of the architecture for accessing a distributed file system. Here, there are service nodes 1 (mds1) to service nodes n (mdsn), and management nodes 1 to management nodes m. The client accesses the file system through the streamfs interface to the working service node 1. In addition, Figure 4 The paths for other data updates are also shown.

[0076] In one embodiment, Figure 5 The schematic diagram of the process of sending the operation instruction is shown. Sending the operation instruction to the second service node includes:

[0077] Step 501: When it is determined that the first service node cannot continue to run the distributed file system, the current logical clock is determined and the current logical clock is used as the target logical clock.

[0078] Among them, a globally unique logical clock is maintained in the management node.

[0079] Optionally, a 64-bit binary representation of the logical clock can be used, so that time overflow can be guaranteed not to occur. In other words, the logical clock is long enough and will not be easily reset, thus ensuring the long-term operation of the file system.

[0080] During the operation of the file system, the logical clock is continuously updated. When it is determined that the first service node cannot continue to operate the distributed file system, the management node determines the current logical clock as the target logical clock. For example, if the current logical clock is logical clock 35, then logical clock 35 is used as the target logical clock.

[0081] Step 502: Generate an operation instruction with the target logical clock according to the target logical clock, and send the operation instruction to the second service node.

[0082] In other words, the running instruction with the target logical clock is sent to the second service node.

[0083] Optionally, the operation instruction includes a target logical clock and indication information. The second service node receives and parses the operation instruction to obtain the target logical clock and indication information. The target logical clock is stored, and after obtaining the indication information, an acquisition instruction is sent to the management node to operate the file system.

[0084] In which, when the second service node generates second file operation data during the operation of the distributed file system, the target logical clock is used for the second service node to bind the second file operation data with the target logical clock and then send it to the management node.

[0085] That is, when each service node runs the file system, it needs to send the latest file operation data to the management node after each file operation data is updated. For example, after each update of the first file operation data by the first service node, the latest first file operation data is uploaded. Similarly, after each update of the second file operation data by the second service node, the latest second file operation data is uploaded. In this way, when other service nodes run the file system, they can obtain the file operation data from the management node in a timely manner and load the file system.

[0086] In one embodiment, the first file operation data includes at least one of a first file list and a second file list; the first file list includes multiple first group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the first group block identifier; the second file list includes multiple second group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the second group block identifier.

[0087] In one embodiment, the second file operation data includes a third file list and a fourth file list; the third file list includes multiple third group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the third group block identifier; the fourth file list includes multiple fourth group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the fourth group block identifier.

[0088] Among them, the block shared space is the chunk mentioned above.

[0089] The following uses the example that the first file operation data includes at least one of the first file list and the second file list to illustrate the file operation data. The update of the second file operation data is similar to this and will not be described in detail.

[0090] The first service node applies for a shared storage space chunk1 to store file operation information. After the application is successful, the identifier of chunk1 is used as the first chunk identifier and put into the first file list. The first file list is uploaded to the management node.

[0091] In this way, after the first service node receives the first operation request from the client for the target file, it performs the first operation on the target file, generates a log of performing the first operation, and obtains the first operation information (the same as the file operation information above). The first operation information is written into chunk1. When chunk1 is full, the first service node applies to the shared storage space for the group shared space chunk2 for storing the file operation information. After the application is successful, the identifier of chunk2 is used as the first group block identifier and is put into the first file list. At this time, the first file list is updated, and the updated first file list including the chunk1 identifier and the chunk2 identifier is uploaded to the management node.

[0092] The first service node also stores the file operation information in the form of logs in the memory, and periodically generates snapshots to persist the data in the memory to the shared storage space. The file operation information corresponding to the generated snapshots can be deleted to release the shared storage space. Therefore, the first service node also needs to apply for the block shared space for storing snapshots.

[0093] For example, the first service node applies for a shared storage space chunk3 for storing snapshots. After the application is successful, the identifier of chunk3 is used as the second chunk identifier and put into the second file list. The second file list is then uploaded to the management node.

[0094] After writing the file operation information to the shared space of the chunk corresponding to the first chunk identifier (e.g., chunk1), the file operation information is also stored in the memory. When multiple file operation information is stored in the memory, snapshots of the file operation information are generated regularly and stored in chunk3. At this time, the file operation information in chunk1 is deleted to release the space of chunk1. In this way, the persistence of the file operation information is achieved, and since the data in the memory can be modified, a data modification function is provided. The released chunk1 can continue to store other file operation information.

[0095] It is understandable that during the operation of the file system, multiple snapshots will be continuously generated. When multiple snapshots are written into chunk3, making chunk3 full, the first service node applies to the shared storage space for chunk4 to store data snapshots. After the application is successful, the identifier of chunk4 is used as the second chunk identifier and put into the second file list. At this time, the second file list is updated, and the updated second file list including the identifiers of chunk3 and chunk4 is uploaded to the management node.

[0096] In other words, each time the first file list and / or the second file list is updated, new first file operation data is obtained and uploaded to the management node.

[0097] For example, Figure 6 The storage diagram of the first file list and the second file list is shown. meta is a data snapshot, and log is file operation information. Optionally, the second file list includes an authoritative list and a non-authoritative list, wherein the data snapshot stored in the chunk corresponding to the chunk identifier in the non-authoritative list is incomplete, while the data snapshot stored in the chunk corresponding to the chunk identifier in the authoritative list is complete. In addition, Figure 7 The following is a schematic diagram of the data update process corresponding to the above description.

[0098] As mentioned above, the target logical clock is stored in the second service node. Similarly, when the first service node is instructed to load the file system, the management node also obtains the logical clock at that time as the first logical clock and sends it to the first service node for storage by the first service node.

[0099] Optionally, the first logical clock is earlier than the target logical clock, which indicates that the service node runs the file system earlier than the second service node.

[0100] For example, if the logical clock at that time is logical clock 6, then logical clock 6 is used as the first logical clock. At this time, the management node uses logical clock 6 as the detection logical clock and records it.

[0101] Taking the first logical clock as logical clock 6 and the second logical clock as logical clock 35 as an example, during the normal operation of the file system by the first service node, the management node uses logical clock 6 as the detection logical clock and records it. When the first service node uploads the updated first file operation data, the updated first file operation data and the first logical clock are sent to the management node together. In this way, when the management node receives the data, it first determines whether the first logical clock is the recorded detection logical clock, and if so, stores the updated first file operation data.

[0102] Similarly, when the first service node is operating the file system normally, the management node uses the logical clock 35 as the detection logical clock and records it. When the second service node uploads the updated second file operation data, the updated second file operation data and the target logical clock are sent to the management node. In this way, when the management node receives the data, it first determines whether the target logical clock is the detection logical clock. If so, it stores the updated second file operation data.

[0103] The logical clock is used to identify the file operation data uploaded by each service node. In this way, the management node can identify whether the currently received data is sent by the second service node that is allowed to run the file system based on the logical clock, thereby ensuring that the data of the second service node is stored and the data of the first service node does not need to be stored, thereby ensuring the correctness of the file operation data stored in the management node.

[0104] The following continues to describe the process of the second service node loading the distributed file system according to the first file operation data.

[0105] In one embodiment, the process of the second service node loading the distributed file system according to the first file execution data includes:

[0106] Read at least one file operation information in the block shared space corresponding to the first block identifier, and execute the file operation action corresponding to the at least one file operation information; and read at least one data snapshot in the block shared space corresponding to the second block identifier, and store the at least one data snapshot in the second service node; wherein the data snapshot describes the information of the data stored in the memory at the target time.

[0107] Optionally, each data snapshot is stored locally in the second service node. Alternatively, the second service node stores each data snapshot in a block shared space corresponding to the applied fourth block identifier.

[0108] Exemplarily, at least one file operation information in the group block shared space corresponding to the first group block identifier includes operation information for opening file 1 and operation information for expanding file 1, then the second service node executes the operations of opening file 1 and expanding file 1.

[0109] In this way, the second service node can reasonably replace the first service node to continue running the file system, thereby ensuring the integrity of the file system migration.

[0110] Since it is determined that the first service node cannot continue to run the distributed file system, the management node also needs to ensure the authenticity and reliability of the first service node stopping running the first service node in time. The process of controlling the first service node to stop running the file system is described below.

[0111] In an optional embodiment, if Figure 8 A schematic diagram of a process of sending a stop instruction to the first service node is shown. The method further includes:

[0112] Step 801: Receive the latest first file operation data and first logical clock sent by a first service node.

[0113] The latest first file operation data is used to request the management node to store the latest first file operation data.

[0114] Optionally, if it is considered that the first service node cannot continue to run the file system because the first service node network is disconnected, the first service node will still upload data to the management node after the first service node network is restored.

[0115] Step 802: When it is determined that the first logical clock is not the target logical clock, the storage of the latest first file operation data is refused, and a stop instruction is sent to the first service node.

[0116] The stop instruction is used to instruct the first service node to stop running the distributed file system.

[0117] As can be seen from the above description, at this time, the management node believes that the second service node runs the file system, and the management node records the target logical clock as the detection logical clock. Therefore, after receiving the latest first file operation data and the first logical clock sent by the first service node, it is determined that the first logical clock is not the target logical clock, and the latest first file operation data is not stored.

[0118] Furthermore, at this time, the management node learns that the first service node is still running the file system, but needs it to stop running the file system. Therefore, a stop instruction can be sent to the first service node.

[0119] After receiving the stop instruction, the first service node stops running the distributed file system.

[0120] In this way, it can be ensured in time that the file system only runs on one service node, avoiding access errors.

[0121] In another optional embodiment, the method further includes: receiving first notification information sent by the second service node; and sending a system view to the client and the first service node when it is determined that the first notification information indicates that the second service node has successfully loaded the distributed file system.

[0122] That is, after successfully loading the distributed file system, the second service node sends the first notification information to the management node to inform the management node that it has successfully loaded the file system and continues to run.

[0123] Optionally, first notification information bound to a target logical clock and sent by a second service node is received, thereby determining, based on the target logical clock, that the first notification information is from the second service node.

[0124] The system view is at least used to describe that the distributed file system is currently running on the second service node.

[0125] Optionally, since the service node runs on a server, the system view can also be used to describe the identifier of the server running the second service node. In this way, the management node can connect to the server based on the identifier of the server, thereby communicating with the second service node.

[0126] In this way, after receiving the system view, the client can know that the file system is subsequently accessed through the second service node.

[0127] In addition, optionally, the system view is used to instruct the first service node to stop running the distributed file system when receiving the system view. That is, the management node also sends the system view to all other service nodes except the second service node. At this time, for the first service node, after receiving the system view, it determines that the current file system is running on the second service node, and then stops running the distributed file system.

[0128] In this way, the first service node can be notified in a variety of ways to stop running the file system in a timely manner, thereby improving the flexibility of ensuring that the first service node stops running the file system in a timely manner.

[0129] For ease of understanding, the system operation method provided by the present application is fully described below with a complete embodiment.

[0130] Please refer to Fig. 9 The system switching operation diagram shown in FIG. A global logical clock is maintained in the management node. It is set that the first service node mds1 runs the file system when the logical clock 6 arrives. Therefore, when the logical clock 6 arrives, the logical clock 6 and the operation instruction are sent to mds1, and mds1 runs the distributed file system. At this time, the first file list contained in the distributed file system includes the identifier of chunk2, and the second file list is empty.

[0131] The first file list currently updated is bound to the logical clock 6 and sent to the management node for storage by the management node. The first file list includes the identifier of chunk2, which means that the file operation data for a certain file is currently written in chunk2. For example, the log of the operation of opening file 1 is a file operation data, which is written to chunk2. In addition, a chunk can write logs of multiple operations until it is full, and a new chunk is requested from the chunk subsystem.

[0132] Thereafter, the management node records the detected logical clock as logical clock 6. It is assumed that on logical clock 6, mds1 runs a distributed file system and allows mds1 to periodically upload the first file list to the management node.

[0133] When the management node determines that it is disconnected from mds1 or the lease of mds1 has expired, it uses the current logical time 35 as the detection logical clock, and sends the logical time 35 and the running instructions to the second service node mds3, so that mds3 runs the distributed file system. At this time, the management node only recognizes that the distributed file system runs based on mds3 at the logical time 35.

[0134] After receiving the run instruction, mds3 obtains the currently existing first file list and second file list from the management node. Furthermore, it obtains file operation information and data snapshots from the chunks corresponding to the chunk identifiers in the two lists, stores the data snapshots, and performs the operations described by the file operation information. Furthermore, it requests the chunk subsystem to close the chunks in the first file list and the second file list.

[0135] After the distributed system runs successfully, mds3 notifies the management node that it has run successfully. At this time, the management node sends the updated system view of the distributed file system to each client and each service node.

[0136] During the operation of mds3, a new chunk can be requested from the chunk subsystem for writing file operation information and data snapshots, etc. Also, the updated third file list and / or fourth file list is bound to the logical clock 35 and sent to the management node. After storing the updated third file list and / or fourth file list, the management node returns feedback information of successful list storage to mds3.

[0137] When the lease of mds1 expires and stops running, the distributed file system fails to stop running due to factors such as being in the D state, so the distributed system continues to run.

[0138] At this time, when both mds1 and mds3 are running the file system, because mds3 requests the chunk subsystem to close chunk2 when running the system, mds1 fails to update the metadata using chunk2. Then mds1 continues to apply to the chunk subsystem for chunk5 to write file operation data, and updates the first file list, and sends the updated first file list and logical clock 6 to the management node.

[0139] After receiving the data of mds1, the management node determines that the logical clock 6 is different from the current detection logical clock (ie, logical clock 35), and then sends an uninstall request to mds1. After receiving the uninstall request, mds1 stops running the distributed file system.

[0140] In addition, if mds1 receives the system view sent by the management node and determines that the system is running on mds3 based on the system view, it will actively uninstall the system.

[0141] In an embodiment of the present application, a system switching method is provided that is jointly implemented through a variety of mechanism strategies, based on which metadata is loaded, thereby providing consistent services and simplifying the data loading logic. First, the space of the old time file system can be closed and the old time file system can be prohibited from applying for space; second, the file system metadata can be loaded only after the new time file system successfully closes the target shared space applied for by the old time file system; third, the old time file system cannot use the space it holds and cannot apply for new space, and can only provide read services; fourth, after the new time file system view is diffused, the old time file system also exits the service. In summary, it can be ensured that the old time file system is uninstalled in time and does not continue to run, thereby avoiding the situation where multiple file systems are running at the same time and causing access errors to a certain file data.

[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0143] Based on the same inventive concept, the embodiment of the present application also provides a system operation device for implementing the system operation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more system operation device embodiments provided below can refer to the limitations on the system operation method above, and will not be repeated here.

[0144] In one embodiment, Fig.10 As shown, a system operation device is provided, and the system operation device 1000 includes: a first sending module 1001 and a second sending module 1002, wherein:

[0145] The first sending module 1001 is used to send an operation instruction to the second service node when it is determined that the first service node cannot continue to operate the distributed file system; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to operate the distributed file system after loading the distributed file system on the second service node according to the first file operation data;

[0146] The second sending module 1002 is used to send the first file operation data to the second service node when receiving the acquisition request sent by the second service node; the first file operation data is uploaded to the management node during the process of the first service node running the distributed file system;

[0147] The operation instruction is also used to instruct the second service node to determine the target shared storage space storing the target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

[0148] In one embodiment, the first sending module 1001 is specifically used for:

[0149] When it is determined that the first service node cannot continue to run the distributed file system, the current logical clock is determined and the current logical clock is used as the target logical clock; an operation instruction with the target logical clock is generated according to the target logical clock; the operation instruction is sent to the second service node; wherein, when the second file operation data is generated during the process of the second service node running the distributed file system, the target logical clock is used for the second service node to bind the second file operation data with the target logical clock and then send it to the management node.

[0150] In one embodiment, the device further includes a first receiving module, configured to:

[0151] Receive the latest first file operation data and the first logical clock sent by the first service node; the latest first file operation data is used to request the management node to store the latest first file operation data; when it is determined that the first logical clock is not the target logical clock, refuse to store the latest first file operation data, and send a stop instruction to the first service node; wherein the stop instruction is used to instruct the first service node to stop running the distributed file system.

[0152] In one embodiment, the device further includes a second receiving module, configured to:

[0153] Receive a first notification message sent by the second service node; and when it is determined that the first notification message indicates that the second service node has successfully loaded the distributed file system, send a system view to the client and the first service node; wherein the system view is at least used to describe that the distributed file system is currently running on the second service node.

[0154] In one of the embodiments, the system view is used to instruct the first service node to stop running the distributed file system upon receiving the system view.

[0155] In one of the embodiments, the first file operation data includes at least one of a first file list and a second file list; the first file list includes multiple first group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the first group block identifier; the second file list includes multiple second group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the second group block identifier.

[0156] Each module in the above system operation device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0157] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store system operation data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a system operation method is implemented.

[0158] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0159] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0160] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0161] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A system operation method, characterized in that: For managing a node, the method comprises: When it is determined that the first service node cannot continue to run the distributed file system, sending an operation instruction to the second service node; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to load the distributed file system on the second service node according to the first file operation data and then run the distributed file system; In the case of receiving the acquisition request sent by the second service node, sending the first file operation data to the second service node; the first file operation data is uploaded to the management node during the process of the first service node running the distributed file system; The operation instruction is also used to instruct the second service node to determine a target shared storage space storing target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

2. The method according to claim 1, characterized in that The sending the operation instruction to the second service node includes: In the case where it is determined that the first service node cannot continue to run the distributed file system, determining a current logical clock, and using the current logical clock as a target logical clock; Generate an operation instruction accompanied by the target logical clock according to the target logical clock; Sending the execution instruction to the second service node; In which, when the second service node generates second file operation data during the operation of the distributed file system, the target logical clock is used for the second service node to bind the second file operation data with the target logical clock and then send it to the management node.

3. The method according to claim 2, characterized in that The method further comprises: receiving the latest first file operation data and the first logical clock sent by the first service node; the latest first file operation data is used to request the management node to store the latest first file operation data; If it is determined that the first logical clock is not the target logical clock, refusing to store the latest first file running data, and sending a stop instruction to the first service node; The stop instruction is used to instruct the first service node to stop running the distributed file system.

4. The method according to claim 1, characterized in that: The method further comprises: receiving first notification information sent by the second service node; In a case where it is determined that the first notification information indicates that the second service node has successfully loaded the distributed file system, sending a system view to the client and the first service node; The system view is at least used to describe that the distributed file system is currently running on the second service node.

5. The method according to claim 4, characterized in that The system view is used to instruct the first service node to stop running the distributed file system when receiving the system view.

6. The method according to any one of claims 1 to 5, characterized in that: The first file operation data includes at least one of a first file list and a second file list; The first file list includes a plurality of first group block identifiers, and at least one file operation information is stored in the group block shared space corresponding to the first group block identifier; The second file list includes a plurality of second group block identifiers, and at least one data snapshot is stored in the group block shared space corresponding to the second group block identifier.

7. A system operation device, characterized in that: Used to manage nodes, the device includes: A first sending module is used to send an operation instruction to a second service node when it is determined that the first service node cannot continue to operate the distributed file system; the operation instruction is used to instruct the second service node to obtain the first file operation data from the management node, and to operate the distributed file system after loading the distributed file system on the second service node according to the first file operation data; a second sending module, configured to send the first file operation data to the second service node upon receiving the acquisition request sent by the second service node; the first file operation data is uploaded to the management node during the process of the first service node running the distributed file system; The operation instruction is also used to instruct the second service node to determine a target shared storage space storing target operation data corresponding to the first file operation data according to the first file operation data after the distributed file system is successfully loaded, and request to close the target shared storage space.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data processing method and device for cluster file system

    CN105511805A

  • Distributed file system and data management method

    CN111796767A

  • File access method and system, electronic equipment and machine readable storage medium

    CN116680233A

  • Data object storage method and device, computer equipment and storage medium

    CN117215477A

  • System and method for storage during virtual machine migration

    US20200117497A1