Method for accessing network file system by client and related device
By establishing a direct connection between the client and the storage node, the problem of bandwidth consumption and inefficiency during NFS request processing is solved, and more efficient request processing and bandwidth utilization is achieved.
Patent Information
- Application Number
- CN202311341503.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-18
AI Technical Summary
When existing network file systems (NFS) handle large numbers of NFS requests, they lead to increased bandwidth consumption within the storage cluster, reducing the efficiency of processing requests.
By establishing a direct connection between the client and the storage node, the forwarding path of requests and data is reduced, so that the client can communicate directly with the first storage node and avoid forwarding by requesting the access node.
It reduces the bandwidth consumption within the storage cluster, improves the efficiency of processing NFS requests, and reduces the latency of request forwarding.
Smart Images

Figure CN119854368A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network file systems, and in particular to a method and related devices for a client to access a network file system. Background Art
[0002] The Network File System (NFS) is a protocol for sharing files on a network. It is also a distributed file system that allows clients to access remote file storage space through the network just like accessing a local file system.
[0003] NFS involves a storage cluster between a client and a cloud, and the storage cluster includes multiple storage nodes, and files are stored in the multiple storage nodes. When a client needs to access files on an NFS storage cluster, a common method is that, first, the client establishes a single connection with one of the storage nodes in the NFS storage cluster, such as a request access node, and then the client sends an NFS request to the request access node, and the request access node determines the home node of the NFS request according to the information carried in the NFS request, and forwards the NFS request to the home node. The home node performs corresponding processing according to the NFS request and returns the processing result to the request access node. The request access node returns the processing result to the client and sends a completion instruction to the client. For example, if the client wants to read a file from the NFS storage cluster, the client sends a read request to the request access node. After receiving the read request, the request access node determines that the home node corresponding to the read request is storage node 1 according to the read request, and then the request access node forwards the read request to storage node 1. Storage node 1 sends the file to be read to the request access node according to the read request, and the request access node returns the file to be read and the completion instruction to the client.
[0004] In the above method, when a client accesses a file on the NFS storage cluster, both the NFS request and the file accessed by the NFS request need to be forwarded through the request access node. When the NFS storage cluster receives a large number of NFS requests, the bandwidth between multiple storage nodes needs to be consumed, which reduces the ability of the NFS storage cluster to process NFS requests. Summary of the invention
[0005] The present application provides a method and related devices for a client to access a network file system. The method described in the present application reduces the consumption of internal bandwidth of a storage cluster and improves the efficiency of the storage cluster in processing NFS requests.
[0006] In a first aspect, the present application provides a method for a client to access a network file system NFS, wherein the NFS includes a requesting access node and multiple storage nodes, wherein the multiple storage nodes include a first storage node, and wherein files are stored in the multiple storage nodes. The method includes: the first storage node receives an NFS request sent by the client based on a connection established between the first storage node and the client; the first storage node obtains the file corresponding to the NFS request from the client based on the connection, or the first storage node sends the file corresponding to the NFS request to the client based on the connection.
[0007] When a communication connection is established between the client and the first storage node, the client can send a request to the first storage node in the storage cluster, and the first storage node can also send data (files) to the client, and the transmission of requests, data, and instructions does not need to be forwarded through other nodes in the storage cluster. Compared to establishing a single connection between the client and the request access node in the storage cluster, when the client communicates with other storage nodes in the storage cluster, it needs to be forwarded through the request access node. The method described in this application reduces the consumption of bandwidth within the storage cluster and improves the efficiency of the storage cluster in processing requests.
[0008] Based on the first aspect, in a possible implementation, the NFS request is a write request, and the first storage node obtains the file corresponding to the NFS request from the client based on the connection, including: the first storage node sends a read request to the client based on the connection, and the read request is used to read the file corresponding to the NFS request; the first storage node receives the file corresponding to the NFS request sent by the client based on the connection.
[0009] Based on the first aspect, in a possible implementation method, the NFS request is a read request, and the first storage node sends the file corresponding to the NFS request to the client based on the connection, including: the first storage node sends a write request to the client based on the connection, and the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0010] Based on the first aspect, in a possible implementation, before the first storage node receives the NFS request sent by the client based on the connection established between the first storage node and the client, the method also includes: the first storage node establishes a connection with the client through the requesting access node.
[0011] Based on the first aspect, in a possible implementation, the first storage node establishes a connection with the client through the requesting access node, including: the first storage node receives a connection management CM request sent by the requesting access node, and the CM request is sent by the client to the requesting access node; the first storage node establishes a connection with the requesting access node based on the CM request, so that the requesting access node returns a CM reply to the client.
[0012] Based on the first aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node;
[0013] The method comprises:
[0014] The QP3 on the first storage node receives a connection management CM request sent by the QP2 on the access requesting node, where the CM request is sent by the QP0 on the client to the QP1 on the access requesting node;
[0015] QP3 on the first storage node establishes a connection with QP2 on the requesting access node based on the CM request, so that QP1 on the requesting access node returns a CM reply to QP0 on the client.
[0016] Based on the first aspect, in a possible implementation, the first storage node establishes a connection with the client through the requesting access node based on a remote direct memory access (RDMA) protocol.
[0017] In a second aspect, the present application provides a method for a client to access a network file system NFS, the method being applied to a network device, the network device being used for communication between the client and the NFS, the NFS comprising a requesting access node and a plurality of storage nodes, the plurality of storage nodes comprising a first storage node, the method comprising:
[0018] The network device receives the NFS request sent by the client;
[0019] In response to determining that the home node corresponding to the NFS request is the first storage node, the network device sends the NFS request to the first storage node;
[0020] The network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, or the network device sends the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information.
[0021] In the present application, the functions of the network device include: 1) determining the home node corresponding to the NFS request; 2) based on the pre-configured information, realizing the transmission of requests, files and instructions between the client and the first storage node. Placing the function of determining the home node corresponding to the NFS request in the network device realizes NFS semantic routing, reduces the forwarding of requests, and improves the performance of NFS request processing.
[0022] Based on the second aspect, in a possible implementation method, the NFS request is a write request, and the network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, including: the network device sends the read request sent by the first storage node to the client based on the pre-configuration information, and the read request is used to read the file corresponding to the NFS request; the network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information.
[0023] For the client, the client believes that it has established a reliable connection with the access requesting node, so the client sends the NFS request to the access requesting node. However, in fact, the access requesting node acts as a "bridge". The client establishes a communication connection with the first storage node through the access requesting node. Therefore, it is necessary to set pre-configuration information to forward the NFS request sent by the client to the access requesting node to the first storage node through the network device. Similarly, the first storage node believes that it has established a connection with the access requesting node, so the first storage node sends the request or file to the access requesting node. However, in fact, the access requesting node acts as a "bridge". The first storage node establishes a communication connection with the client through the access requesting node. Therefore, it is necessary to set pre-configuration information to forward the NFS request sent by the first storage node to the access requesting node to the client through the network device.
[0024] Based on the second aspect, in a possible implementation method, the NFS request is a read request, and the network device sends the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information, including: the network device sends the write request sent by the first storage node to the client based on the pre-configuration information, the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0025] Based on the second aspect, in a possible implementation manner, before the network device sends the file corresponding to the NFS request sent by the client to the first storage node based on pre-configuration information, or before the network device sends the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information, the method further includes:
[0026] The network device receives the pre-configuration information sent by the access requesting node, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information;
[0027] The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0028] Based on the second aspect, in a possible implementation, the network device sends the file corresponding to the NFS request sent by the client to the first storage node based on preconfiguration information, including:
[0029] The network device receives the file corresponding to the NFS request sent by the client;
[0030] Determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node;
[0031] In response to determining that the destination address of the file corresponding to the NFS request is the address of the access requesting node, copying and forwarding the file corresponding to the NFS request to the first storage node;
[0032] The network device sends, based on the pre-configuration information, the file corresponding to the NFS request sent by the first storage node to the client, including:
[0033] The network device receives the file corresponding to the NFS request sent by the first storage node;
[0034] Determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node;
[0035] In response to determining that the destination address of the file corresponding to the NFS request is the address of the requesting access node, the file corresponding to the NFS request is copied and forwarded to the client.
[0036] In a third aspect, the present application provides a method for establishing a connection between a client and a network file system NFS, wherein the NFS includes a requesting access node and multiple storage nodes, the multiple storage nodes include a first storage node, and files are stored in the multiple storage nodes. The requesting access node is used to receive an NFS request sent by the client, and the method includes:
[0037] The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node;
[0038] The requesting access node sends pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the first storage node based on the pre-configuration information, or so that the network device is used to implement the first storage node sending a write request or a read request to the client based on the pre-configuration information.
[0039] In the process of establishing a communication connection between the client and the first storage node, the requesting access node acts as a "bridge". In the process of establishing a reliable connection between the client and the requesting access node, the requesting access node establishes a reliable connection with the first storage node, the requesting access node informs the first storage node of the client's starting message sequence number, and informs the client of the first storage node's starting message sequence number. The first storage node and the client both learn each other's starting message sequence number. On this basis, the network device is pre-configured so that the client and the first storage node can communicate. As a result, a communication connection between the client and the first storage node is successfully established, laying a "material" foundation for the subsequent transmission of messages between the client and the first storage node.
[0040] Using a similar method, other storage nodes in the storage cluster can establish communication connections with the client, thereby achieving full connectivity between the client and each node in the storage cluster, laying a "material" foundation for subsequent communication between the client and each node. Full connectivity is the technical support for each storage node in the storage cluster to directly send messages to the client.
[0041] Based on the third aspect, in a possible implementation manner, the CM request is used to establish a connection between the client and the first storage node, including:
[0042] The requesting access node sends the CM request to the first storage node, and establishes a connection with the first storage node based on the CM request;
[0043] The requesting access node sends a CM reply to the client;
[0044] The requesting access node receives a confirmation response returned by the client in response to the CM reply.
[0045] Based on the third aspect, in a possible implementation, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information;
[0046] The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0047] Based on the third aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node;
[0048] The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node, including:
[0049] QP1 on the requesting access node receives a connection management CM request sent by QP0 on the client;
[0050] QP2 on the requesting access node sends the CM request to QP3 on the first storage node, and establishes a connection with QP3 on the first storage node based on the CM request;
[0051] QP1 on the requesting access node sends a CM reply to QP0 on the client;
[0052] QP1 on the requesting access node receives a confirmation response returned by QP0 on the client for the CM reply.
[0053] Based on the third aspect, in a possible implementation, the client further sets a queue pair QP4, and the requesting access node further sets a queue pair QP5; the method further includes: QP5 on the requesting access node establishes a connection with QP4 on the client.
[0054] Two streams are established between the client and the access requesting node, where the stream composed of QP4 and QP5 is used to establish a reliable connection between the client and the access requesting node, and the stream composed of QP0 and QP1 is actually used to establish a communication connection between the client and the first storage node. A communication connection is established between the client and the nodes in the storage cluster based on nconnect technology and RDMA protocol. nconnect allows multiple streams to be established between two devices, each stream is used for different purposes, and one stream occupies one core of the device. This application uses nconnect technology to increase bandwidth and improve the efficiency of message transmission.
[0055] Based on the third aspect, in a possible implementation, port port0 is set on the client, port port1 and port port2 are set on the request access node, and port port3 is set on the first storage node;
[0056] The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node, including:
[0057] The port 1 on the requesting access node receives the connection management CM request sent by the port 0 on the client;
[0058] Port2 on the requesting access node sends the CM request to port3 on the first storage node, and establishes a connection with port3 on the first storage node based on the CM request;
[0059] Port1 on the requesting access node sends a CM reply to port0 on the client;
[0060] Port1 on the requesting access node receives a confirmation response returned by port0 on the client in response to the CM reply.
[0061] Based on the third aspect, in a possible implementation, the client further sets a port port4, and the access requesting node further sets a port port5; the method further includes: establishing a connection between port5 on the access requesting node and port4 on the client.
[0062] Based on the third aspect, in a possible implementation, the requesting access node is used to establish a connection between the first storage node and the client based on a remote direct memory access RDMA protocol or a transmission control protocol TCP.
[0063] In a fourth aspect, the present application provides a method for establishing a connection between a client and a network file system NFS in a cloud, wherein the NFS includes a requesting access node and a plurality of storage nodes, wherein files are stored in the plurality of storage nodes, and wherein the plurality of storage nodes include a first storage node, and the method includes:
[0064] The network device receives the pre-configuration information sent by the requesting access node, so that the network device is used to implement the client sending a write request or a read request to the first storage node based on the pre-configuration information, or the network device is used to implement the first storage node sending a write request or a read request to the client based on the pre-configuration information.
[0065] Based on the fourth aspect, in a possible implementation, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information;
[0066] The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0067] In a fifth aspect, the present application provides a node on the cloud, which can be configured as a first storage node in a network file system on the cloud, the network file system on the cloud also includes a request access node, and the first storage node includes:
[0068] A receiving module, configured to receive an NFS request sent by the client based on a connection established between the first storage node and the client;
[0069] The receiving module is further configured to obtain the file corresponding to the NFS request from the client based on the connection, or the sending module is configured to send the file corresponding to the NFS request to the client based on the connection.
[0070] Based on the fifth aspect, in a possible implementation, the NFS request is a write request,
[0071] The sending module is used to send a read request to the client based on the connection, and the read request is used to read the file corresponding to the NFS request;
[0072] The receiving module is used to receive the file corresponding to the NFS request sent by the client based on the connection.
[0073] Based on the fifth aspect, in a possible implementation, the NFS request is a read request,
[0074] The sending module is used to send a write request to the client based on the connection, and the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0075] Based on the fifth aspect, in a possible implementation manner, the sending module and the receiving module are used in collaboration to establish a connection with the client through the requesting access node.
[0076] Based on the fifth aspect, in a possible implementation, the receiving module is used to receive a connection management CM request sent by the requesting access node, where the CM request is sent by the client to the requesting access node;
[0077] The sending module and the receiving module are used in cooperation to establish a connection with the requesting access node based on the CM request, so that the requesting access node returns a CM reply to the client.
[0078] Based on the fifth aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node;
[0079] The receiving module is used to receive, through QP3 on the first storage node, a connection management CM request sent by QP2 on the access requesting node, wherein the CM request is sent by QP0 on the client to QP1 on the access requesting node;
[0080] The sending module and the receiving module cooperate to establish a connection with QP2 on the requesting access node through QP3 on the first storage node based on the CM request, so that QP1 on the requesting access node returns a CM reply to QP0 on the client.
[0081] Based on the fifth aspect, in a possible implementation, the sending module and the receiving module are used in collaboration to establish a connection with the client through the requesting access node based on a remote direct memory access (RDMA) protocol.
[0082] The functional modules of the fifth aspect are used to implement the method described in the first aspect and some possible implementation methods of the first aspect.
[0083] In a sixth aspect, the present application provides a node on a cloud, which can be configured as a request access node in a network file system on the cloud, wherein the network file system on the cloud also includes a first storage node, and when the node is configured as a request access node, the request access node includes:
[0084] A receiving module, configured to receive a connection management CM request sent by the client, wherein the CM request is used to establish a connection between the client and the first storage node;
[0085] The sending module is used to send pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the first storage node based on the pre-configuration information, or so that the network device is used to implement the first storage node sending a write request or a read request to the client based on the pre-configuration information.
[0086] Based on the sixth aspect, in a possible implementation,
[0087] The sending module is used to send the CM request to the first storage node;
[0088] The sending module and the receiving module are used in cooperation to establish a connection with the first storage node based on the CM request;
[0089] The sending module is used to send a CM reply to the client;
[0090] The receiving module is used to receive a confirmation response returned by the client in response to the CM reply.
[0091] Based on the sixth aspect, in a possible implementation method, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; the pre-configuration information also includes third information, fourth information, and a second mapping relationship between the third information and the fourth information, the third information includes the address of the requested access node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0092] Based on the sixth aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node;
[0093] The receiving module is used to receive the connection management CM request sent by QP0 on the client by requesting QP1 on the access node;
[0094] The sending module is used to send the CM request to QP3 on the first storage node by requesting QP2 on the access node;
[0095] The receiving module and the sending module are used in cooperation to establish a connection with QP3 on the first storage node based on the CM request;
[0096] The sending module is used to send a CM reply to QP0 on the client through QP1 on the requesting access node;
[0097] The receiving module is used for receiving, through QP1 on the requesting access node, a confirmation response returned by QP0 on the client in response to the CM reply.
[0098] Based on the sixth aspect, in a possible implementation, the client further sets a queue pair QP4, and the requesting access node further sets a queue pair QP5; the sending module and the receiving module are used in collaboration to establish a connection between QP5 on the requesting access node and QP4 on the client.
[0099] Based on the sixth aspect, in a possible implementation, port port0 is set on the client, port port1 and port port2 are set on the request access node, and port port3 is set on the first storage node;
[0100] The receiving module is used to receive the connection management CM request sent by the port0 on the client through the port1 on the request access node;
[0101] The sending module is used to send the CM request to port 3 on the first storage node through port 2 on the request access node;
[0102] The receiving module and the sending module are used in cooperation to establish a connection with port3 on the first storage node based on the CM request;
[0103] The sending module is used to send a CM reply to port0 on the client through port1 on the request access node;
[0104] The receiving module is used for receiving, through port1 on the requesting access node, a confirmation response returned by port0 on the client in response to the CM reply.
[0105] Based on the sixth aspect, in a possible implementation, the client further sets a port port4, and the requesting access node further sets a port port5; the receiving module and the sending module cooperate to establish a connection with the port port4 of the client through the port port5.
[0106] Based on the sixth aspect, in a possible implementation, the receiving module and the sending module are used in collaboration to establish a connection between the first storage node and the client based on a remote direct memory access RDMA protocol or a transmission control protocol TCP.
[0107] The various functional modules of the sixth aspect are used to implement the method described in the third aspect and various possible implementation methods of the third aspect.
[0108] In a seventh aspect, the present application provides a network device, the network device being used for communication between a client and the NFS, the NFS comprising a requesting access node and a plurality of storage nodes, the plurality of storage nodes storing files, the plurality of storage nodes comprising a first storage node, the network device comprising:
[0109] A receiving module, used for receiving an NFS request sent by the client;
[0110] A determination module, used to determine which storage node is the home node corresponding to the NFS request;
[0111] a sending module, configured to send the NFS request to the first storage node in response to determining that the home node corresponding to the NFS request is the first storage node;
[0112] The sending module is used to send the file corresponding to the NFS request sent by the client to the first storage node based on pre-configuration information, or to send the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information.
[0113] Based on the seventh aspect, in a possible implementation, the NFS request is a write request,
[0114] The sending module is used for:
[0115] The network device sends the read request sent by the first storage node to the client based on the pre-configuration information, where the read request is used to read the file corresponding to the NFS request;
[0116] Based on the pre-configuration information, the file corresponding to the NFS request sent by the client is sent to the first storage node.
[0117] Based on the seventh aspect, in a possible implementation, the NFS request is a read request,
[0118] The sending module is used to: send the write request sent by the first storage node to the client based on the pre-configuration information, the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0119] Based on the seventh aspect, in a possible implementation manner, the receiving module is further used to:
[0120] Receive the preconfiguration information sent by the access requesting node, the preconfiguration information including first information, second information and a first mapping relationship between the first information and the second information, the first information including the address of the access requesting node, the second information including the address of the first storage node, the first mapping relationship being used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; the preconfiguration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, the third information including the address of the access requesting node, the fourth information including the address of the client, the second mapping relationship being used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0121] Based on the seventh aspect, in a possible implementation,
[0122] A receiving module, used for receiving the file corresponding to the NFS request sent by the client;
[0123] The determination module is used to determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node;
[0124] a sending module, configured to, in response to determining that the destination address of the file corresponding to the NFS request is the address of the requesting access node, copy and forward the file corresponding to the NFS request to the first storage node;
[0125] The receiving module is further used to receive the file corresponding to the NFS request sent by the first storage node;
[0126] The determination module is further used to determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node;
[0127] The sending module is also used for, in response to determining that the destination address of the file corresponding to the NFS request is the address of the requesting access node, copying and forwarding the file corresponding to the NFS request to the client.
[0128] Based on the seventh aspect, in a possible implementation method, the receiving module is also used to receive pre-configuration information sent by the requesting access node, so that the network device is used based on the pre-configuration information to implement the client sending a write request or a read request to the first storage node, or so that the network device is used based on the pre-configuration information to implement the first storage node sending a write request or a read request to the client.
[0129] The various functional modules of the seventh aspect are used to implement the method described in the second aspect and its various possible implementations, or to implement the method described in the fourth aspect and its various possible implementations.
[0130] In an eighth aspect, the present application provides a network device, comprising a memory and a processor, the memory being used to store instructions, and the processor being used to execute the instructions stored in the memory, so as to implement the method described in the second aspect and its various possible implementations, or to implement the method described in the fourth aspect and its various possible implementations, or to implement the method described in the thirteenth aspect and its various possible implementations, or to implement the method described in the fifteenth aspect and its various possible implementations.
[0131] In a ninth aspect, the present application provides a computing device cluster, comprising a requesting access node and multiple storage nodes, wherein the requesting access node and any one of the multiple storage nodes comprise a memory and a processor, and the processor is used to execute instructions stored in the memory so that the computing device cluster executes the method described in the first aspect and various possible implementations of the first aspect, or so that the computing device cluster executes the method described in the third aspect and various possible implementations of the third aspect, or so that the computing device cluster executes the method described in the following twelfth and fourteenth aspects and various possible implementations of the twelfth and fourteenth aspects.
[0132] In a tenth aspect, the present application provides a system including a network device and a network file system NFS in the cloud, the NFS including a requesting access node and multiple storage nodes, the multiple storage nodes including a first storage node, the multiple storage nodes storing files, the requesting access node being an entry node for the client to send a request to the NFS via the network device, the system being used to implement the method described in the first aspect and any possible implementation of the first aspect, or the system being used to implement the method described in the second aspect and any possible implementation of the second aspect, or the system being used to implement the method described in the third aspect and any possible implementation of the third aspect, or the system being used to implement the method described in the fourth aspect and any possible implementation of the fourth aspect, or the system being used to implement the method described in the following twelfth, thirteenth, fourteenth, and fifteenth aspects and any possible implementation of the twelfth, thirteenth, fourteenth, and fifteenth aspects.
[0133] In the eleventh aspect, the present application provides a computer-readable storage medium, comprising program instructions. When the program instructions are executed on a processor, the processor executes the method described in the first aspect and any possible implementation of the first aspect, or the processor executes the method described in the second aspect and any possible implementation of the second aspect, or the processor executes the method described in the third aspect and any possible implementation of the third aspect, or the processor executes the method described in the fourth aspect and any possible implementation of the fourth aspect, or the processor executes the method described in the following twelfth, thirteenth, fourteenth, and fifteenth aspects and any possible implementation of the twelfth, thirteenth, fourteenth, and fifteenth aspects.
[0134] In a twelfth aspect, the present application provides a method for a client to establish a connection with a network file system NFS, wherein the NFS includes a requesting access node and multiple other nodes, wherein the multiple other nodes include at least a first node, and the method includes:
[0135] The requesting access node receives a first connection management CM request sent by the client, where the first CM request is used to establish a connection between the client and the first node;
[0136] The requesting access node sends first pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the first node based on the pre-configuration information.
[0137] Based on the twelfth aspect, in a possible implementation manner, the NFS further includes a second node, and the method further includes:
[0138] The requesting access node receives a second connection management CM request sent by the client, where the second CM request is used to establish a connection between the client and the second node;
[0139] The requesting access node sends second pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the second node based on the pre-configuration information.
[0140] Based on the twelfth aspect, in a possible implementation manner, the CM request is used to establish a connection between the client and the first node, including:
[0141] The requesting access node sends the first CM request to the first node, and establishes a connection with the first node based on the first CM request;
[0142] The requesting access node sends a CM reply to the client;
[0143] The requesting access node receives a confirmation response returned by the client in response to the CM reply.
[0144] Based on the twelfth aspect, in a possible implementation method, the first pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the node indicated by the second information.
[0145] Based on the twelfth aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first node;
[0146] The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node, including:
[0147] QP1 on the requesting access node receives a connection management CM request sent by QP0 on the client;
[0148] QP2 on the requesting access node sends the CM request to QP3 on the first node, and establishes a connection with QP3 on the first node based on the CM request;
[0149] QP1 on the requesting access node sends a CM reply to QP0 on the client;
[0150] QP1 on the requesting access node receives a confirmation response returned by QP0 on the client for the CM reply.
[0151] Based on the twelfth aspect, in a possible implementation manner, the client further sets a queue pair QP4, and the request access node further sets a queue pair QP5; the method further includes:
[0152] QP5 on the requesting access node establishes a connection with QP4 on the client.
[0153] Based on the twelfth aspect, in a possible implementation, port port0 is set on the client, port port1 and port port2 are set on the requesting access node, and port port3 is set on the first node;
[0154] The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first node, including:
[0155] The port 1 on the requesting access node receives the connection management CM request sent by the port 0 on the client;
[0156] Port2 on the requesting access node sends the CM request to port3 on the first node, and establishes a connection with port3 on the first node based on the CM request;
[0157] Port1 on the requesting access node sends a CM reply to port0 on the client;
[0158] Port1 on the requesting access node receives a confirmation response returned by port0 on the client in response to the CM reply.
[0159] Based on the twelfth aspect, in a possible implementation manner, the client further sets a port port4, and the request access node further sets a port port5; and the method further includes:
[0160] The port 5 on the requesting access node establishes a connection with the port 4 on the client.
[0161] Based on the twelfth aspect, in a possible implementation, the requesting access node is used to establish a connection between the first node and the client based on a remote direct memory access RDMA protocol or a transmission control protocol TCP.
[0162] In a thirteenth aspect, the present application provides a method for establishing a connection between a client and a network file system NFS, the method comprising:
[0163] The network device receives the first pre-configuration information sent by the requesting access node, so that the network device is used to implement the client sending a write request or a read request to the first node based on the first pre-configuration information.
[0164] Based on the thirteenth aspect, in a possible implementation method, the first pre-configuration information includes first information, second information and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the node indicated by the second information.
[0165] In a fourteenth aspect, the present application provides a method for a client to access a network file system NFS, the NFS system including a requesting access node and a first node, the method including:
[0166] The first node receives an NFS request sent by the client based on a connection established between the first node and the client;
[0167] The first node determines a home node corresponding to the NFS request;
[0168] The first node sends the NFS request to the corresponding home node, so that the corresponding home node processes the NFS request.
[0169] Based on the fourteenth aspect, in a possible implementation, when the NFS request is a read request, the method further includes: the first node receives the file corresponding to the NFS request sent by the corresponding home node, and sends the file corresponding to the NFS request to the client.
[0170] Based on the fourteenth aspect, in a possible implementation manner, the NFS system further includes a second node, and the method further includes:
[0171] The second node receives an NFS request sent by the client based on a connection established between the second node and the client;
[0172] The second node determines a home node corresponding to the NFS request;
[0173] The second node sends the NFS request to the corresponding home node, so that the corresponding home node processes the NFS request.
[0174] In a fifteenth aspect, the present application provides a method for a client to access a network file system NFS, the NFS including a requesting access node and a first node, the method comprising:
[0175] The network device receives the NFS request sent by the client;
[0176] The network device sends the NFS request sent by the client to the first node based on the first preconfiguration information.
[0177] Based on the fifteenth aspect, in a possible implementation manner, before the network device sends the NFS request sent by the client to the first node based on the first preconfiguration information, the method further includes:
[0178] The network device receives the first pre-configuration information sent by the access requesting node, the first pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information;
[0179] Based on the fifteenth aspect, in a possible implementation manner, the network device sends the NFS request sent by the client to the first node based on the first preconfiguration information, including:
[0180] The network device receives the NFS request sent by the client;
[0181] Determine that the destination address of the NFS request is the address of the requesting access node;
[0182] In response to determining that the destination address of the NFS request is the address of the requesting access node, the NFS request is copied and forwarded to the first node.
[0183] In a sixteenth aspect, the present application provides a node, which can be configured as a request access node in a network file system NFS, including:
[0184] A receiving module, configured to receive a first connection management CM request sent by the client, where the first CM request is used to establish a connection between the client and the first node;
[0185] The sending module is used to send first pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the first node based on the pre-configuration information.
[0186] Based on the sixteenth aspect, in a possible implementation,
[0187] A receiving module, configured to receive a second connection management CM request sent by the client, where the second CM request is used to establish a connection between the client and the second node;
[0188] The sending module is used to send second pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the second node based on the pre-configuration information.
[0189] Based on the sixteenth aspect, in a possible implementation,
[0190] The sending module is further used to send the first CM request to the first node, and establish a connection with the first node based on the first CM request;
[0191] The sending module is further used to send a CM reply to the client;
[0192] The receiving module is further configured to receive a confirmation response returned by the client in response to the CM reply.
[0193] Based on the sixteenth aspect, in a possible implementation method, the first pre-configuration information includes first information, second information and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the node indicated by the second information.
[0194] Based on the sixteenth aspect, in a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first node;
[0195] The receiving module is used to receive the connection management CM request sent by QP0 on the client through QP1 on the requesting access node;
[0196] The sending module is used to send the CM request to QP3 on the first node through QP2 on the requesting access node;
[0197] The receiving module and the sending module are used in cooperation to establish a connection with QP3 on the first node based on the CM request;
[0198] The sending module is used to send a CM reply to QP0 on the client through QP1 on the requesting access node;
[0199] The receiving module is used for receiving, through QP1 on the requesting access node, a confirmation response returned by QP0 on the client in response to the CM reply.
[0200] Based on the sixteenth aspect, in a possible implementation, the client further sets a queue pair QP4, and the requesting access node further sets a queue pair QP5; the receiving module and the sending module are used in collaboration to establish a connection with QP4 on the client through QP5 on the requesting access node.
[0201] Based on the sixteenth aspect, in a possible implementation, the client is provided with a port port0, the requesting access node is provided with a port port1 and a port port2, and the first node is provided with a port port3;
[0202] The receiving module is used to receive the connection management CM request sent by the port0 on the client through the port1 on the request access node;
[0203] The sending module is used to send the CM request to port3 on the first node through port2 on the request access node;
[0204] The receiving module and the sending module are used in cooperation to establish a connection with port3 on the first node based on the CM request;
[0205] The sending module is used to send a CM reply to port0 on the client through port1 on the request access node;
[0206] The receiving module is used for receiving, through port1 on the requesting access node, a confirmation response returned by port0 on the client in response to the CM reply.
[0207] Based on the sixteenth aspect, in a possible implementation, the client is further provided with port port4, and the requesting access node is further provided with port port5; the receiving module and the sending module are used in collaboration to establish a connection with port4 on the client through port5 on the requesting access node.
[0208] Based on the sixteenth aspect, in a possible implementation, the receiving module and the sending module are used in collaboration to: establish a connection between the first node and the client based on a remote direct memory access RDMA protocol or a transmission control protocol TCP.
[0209] The various functional modules of the sixteenth aspect are used to implement the method described in the twelfth aspect and various possible implementation methods of the twelfth aspect.
[0210] In a seventeenth aspect, the present application provides a network device, including:
[0211] The receiving module is used to receive the first pre-configuration information sent by the requesting access node, so that the network device is used to implement the client sending a write request or a read request to the first node based on the first pre-configuration information.
[0212] Based on aspect seventeen, in a possible implementation, the first pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the node indicated by the second information.
[0213] Based on the seventeenth aspect, in a possible implementation, the receiving module is further used to receive an NFS request sent by the client; the sending module is further used to send the NFS request sent by the client to the first node based on first preconfiguration information.
[0214] Based on the seventeenth aspect, in a possible implementation,
[0215] The receiving module is further used to receive the NFS request sent by the client;
[0216] The determination module is further used to determine that the destination address of the NFS request is the address of the requesting access node;
[0217] The sending module is further configured to, in response to determining that the destination address of the NFS request is the address of the requesting access node, copy and forward the NFS request to the first node.
[0218] The various functional modules of the seventeenth aspect are used to implement the method described in the thirteenth aspect and various possible implementations of the thirteenth aspect, or are used to implement the method described in the fifteenth aspect and various possible implementations of the fifteenth aspect.
[0219] In an eighteenth aspect, the present application provides a network file system NFS, wherein the NFS system includes a first node, and the first node includes:
[0220] A receiving module, configured to receive an NFS request sent by the client based on a connection established between the first node and the client;
[0221] A determination module, used to determine a home node corresponding to the NFS request;
[0222] The sending module is used to send the NFS request to the corresponding home node, so that the corresponding home node processes the NFS request.
[0223] Based on the eighteenth aspect, in a possible implementation manner, when the NFS request is a read request, the receiving module is further used to receive a file corresponding to the NFS request sent by the corresponding home node;
[0224] The sending module is further used to send the file corresponding to the NFS request to the client.
[0225] The various functional modules of the eighteenth aspect are used to implement the method described in the fourteenth aspect and various possible implementation methods of the fourteenth aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0226] Figure 1 A schematic diagram of a system architecture provided for this application;
[0227] Figure 2 A schematic diagram of a process for establishing a connection between a client and a cloud NFS provided in this application;
[0228] Figure 3 A schematic diagram of a scenario provided for this application;
[0229] Figure 4 Another scenario schematic diagram provided for this application;
[0230] Figure 5 A flowchart of a method for a client to access NFS in the cloud provided by the present application;
[0231] Figure 6 A schematic diagram of a scenario provided for this application;
[0232] Figure 7 A partial flow chart of a method for a client to access NFS in the cloud provided by the present application;
[0233] Figure 8 A flowchart of another method for a client to access NFS in the cloud provided by the present application;
[0234] Fig. 9 A schematic diagram of a scenario provided for this application;
[0235] Fig.10 A schematic diagram of the structure of a node provided in this application;
[0236] Fig.11 A schematic diagram of the structure of a network device provided for this application;
[0237] Fig.12 A schematic diagram of the structure of a hardware device provided for this application. DETAILED DESCRIPTION
[0238] 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.
[0239] To facilitate understanding, before introducing the system architecture and method embodiments of the present application, the technical terms involved in the present application are first introduced.
[0240] A network file system NFS request refers to an access request sent by a client to the cloud NFS, which includes a read request, a write request, and other requests.
[0241] The home node refers to the storage node corresponding to the file accessed by the NFS request. For example, if the NFS request is a write request and the purpose is to write a file to storage node 1, then the home node of the NFS request is storage node 1. For another example, if the NFS request is a read request and the purpose is to read a file in storage node 2, then the home node of the NFS request is storage node 2.
[0242] The request access node refers to a node in the storage cluster that is used to receive NFS requests sent by the client. The request access node may also be called a proxy node, which is used to proxy the storage cluster to receive NFS requests sent by the client.
[0243] This application provides a system, see Figure 1 , Figure 1 A schematic diagram of a system architecture provided for the present application, wherein the system includes at least one client, a network device and a cloud storage cluster.
[0244] The client can be a user's mobile phone terminal, desktop computer, notebook, physical server or other electronic device.
[0245] A network file system NFS is set on the storage cluster, and the storage cluster includes multiple storage nodes, and files are stored in the multiple storage nodes. The storage cluster can be located in a public cloud, a private cloud, or a hybrid cloud.
[0246] In one example, a storage node may include a controller and a hard disk, wherein the controller and the hard disk are located on different physical devices, and the controller is used to process control instructions, for example, the controller is used to process read requests and write requests, and the hard disk is used to store files. When the storage node needs to write a file, the controller controls the writing of the file into the hard disk, and when the file needs to be read out, the controller controls the reading of the file from the hard disk. The hard disk may also be other storage devices with persistent storage media, which is not limited in this application. In one example, the storage node may be a physical server, which includes a controller and a hard disk, that is, the controller and the hard disk are located on the same physical device. The storage node may also be in other forms, for example, the storage node includes a virtual machine deployed on a physical server, and the control instructions are processed by the virtual machine to realize the reading or writing of files in the hard disk. The hard disk may be located on the physical server where the virtual machine is located, or on other physical servers.
[0247] The network device may be a switch, a router, etc. The network device is used to receive a request sent by a client. The request may be a connection management (CM) request. The CM request is used to request to establish a connection. The request may also be an NFS request. The NFS request includes a read request and a write request, and the received request is sent to the storage cluster. The network device is also used to receive a request, a file, or data sent by the storage cluster, and the received request, file, or data is sent to the client.
[0248] In one scenario, the client, network device, and storage cluster may be located in the same data center or in multiple interconnected data centers. In the case where the client, network device, and storage cluster are located in multiple interconnected data centers, any one or more devices in the client, network device, and multiple storage nodes in the storage cluster may be located in the same data center.
[0249] In another scenario, the network file system NFS on the storage cluster is a cloud service rented or purchased by the user, the client may be the server where the user is located, and the user accesses the network file system NFS of the cloud storage cluster through a network device on the client.
[0250] Based on the above system, an embodiment of the present application provides a method for establishing a connection between a client and an NFS in the cloud. In the present application, a connection is established between the client and each storage node in the storage cluster in the cloud, that is, the client and the storage cluster are fully connected. The following description takes the establishment of a connection between the client and one of the storage nodes in the storage cluster as an example.
[0251] See also Figure 2 and Figure 3 , Figure 2 A schematic diagram of a process of establishing a connection between a client and a cloud NFS provided in an embodiment of the present application, Figure 3 A schematic diagram of a scenario provided for an embodiment of the present application. Figure 3 In the scenario diagram, the storage cluster includes nodes A0, B0, A1, and B1. Figure 3 The method for establishing a connection between a client and a cloud NFS provided in an embodiment of the present application is described below. The method includes but is not limited to the following description.
[0252] S101. A client sends a first CM request to a requesting access node. The first CM request carries a starting message sequence number of the client.
[0253] A request access node refers to a node in a storage cluster that is used to receive requests sent by a client. A request access node may also be called a proxy node, which is used to proxy the storage cluster to receive requests sent by a client. It is understood that any storage node in a storage cluster can be set as a request access node. For example, Figure 3 In the schematic diagram shown, the A0 node can be set as an access requesting node.
[0254] The client sends a first CM request to the requesting access node, where the first CM request is used to request to establish a connection, wherein the first CM request carries the starting message sequence number of the client, which indicates the sequence number of the first message sent by the client after the connection is established. Accordingly, the requesting access node receives the first CM request sent by the client and obtains the starting message sequence number of the client. Optionally, the client sends the first CM request to the requesting access node through a network device.
[0255] S102: The requesting access node uses the initial message sequence number of the client to establish a connection with the first storage node, and obtains the initial message sequence number of the first storage node.
[0256] The first storage node is any node in the storage cluster except the node requesting access.
[0257] The requesting access node uses the client's starting message sequence number to establish a connection with the first storage node and obtain the starting message sequence number of the first storage node, specifically including: the requesting access node sends a first CM request to the first storage node, wherein the first CM request carries the client's starting message sequence number (or it can be understood that the first CM request carries the starting message sequence number of the requesting access node, but the starting message sequence number of the requesting access node uses the client's starting message sequence number), the first storage node receives the first CM request and obtains the client's starting message sequence number (first handshake); the first storage node returns a first CM reply to the requesting access node, the first CM reply carries the first storage node's starting message sequence number, the message sequence number of the first storage node indicates the sequence number of the first message sent by the first storage node after the connection is established, the requesting access node receives the first CM reply from the first storage node and obtains the starting message sequence number of the first storage node (second handshake); the requesting access node then sends a confirmation response to the first CM reply to the first storage node to inform the first storage node to confirm receipt of the first CM reply (third handshake). Therefore, through the three-way handshake, a reliable connection (RC) is established between the access requesting node and the first storage node, the first storage node obtains the client's starting message sequence number, and the access requesting node obtains the first storage node's starting message sequence number.
[0258] It can be understood that, in the process of establishing a connection between the client and the access requesting node (in the three-way handshake process), a reliable connection is established between the access requesting node and the first storage node.
[0259] Optionally, the process of requesting the access node to establish a connection with the first storage node may also go through the network device. For example, the requesting access node sends the first CM request to the first storage node through the network device, the first storage node returns the first CM reply to the requesting access node through the network device, and the requesting access node returns a confirmation response of the first CM reply to the first storage node through the network device.
[0260] For example, in Figure 3In the schematic diagram shown, if the requested access node is A0 and the first storage node is A1, the client sends a first CM request to the A0 node, and the first CM request carries the client's starting message sequence number. After A0 receives the client's first CM request, A0 establishes a reliable connection with A1 through a three-way handshake. A1 obtains the client's starting message sequence number, and A0 obtains A1's starting message sequence number. That is, in the process of establishing a connection between the client and the AO node, the A0 node establishes a reliable connection with the A1 node. The first storage node can also be other nodes in the storage cluster, for example, it can be a B0 node or a B1 node.
[0261] S103: Request the access node to send pre-configuration information to the network device.
[0262] S104: The network device is configured according to the pre-configuration information.
[0263] The request access node sends pre-configuration information to the network device, and the network device receives the pre-configuration information and performs configuration according to the pre-configuration information. The purpose of step S103 and step S104 is to configure the network device to realize communication between the client and the first storage node in the subsequent message transmission process, specifically, to realize communication between the client and the first storage node through the network device.
[0264] In order to facilitate understanding of the meaning of the pre-configuration information and the solution of the embodiment of the present application, the specific content and related introduction of the pre-configuration information are described after step S106.
[0265] S105 . The requesting access node returns a first CM reply to the client, where the first CM reply carries a starting message sequence number of the first storage node.
[0266] S106. The client sends a confirmation response to the first CM reply to the access requesting node.
[0267] Step S101 may be understood as the first handshake for establishing a connection between the client and the access requesting node, and steps S105 and S106 may be understood as the second and third handshakes for establishing a connection between the client and the access requesting node.
[0268] The access requesting node returns the first CM reply to the client, and the first CM reply carries the starting message sequence number of the first storage node (or it can be understood that the first CM reply carries the starting message sequence number of the access requesting node, and the message sequence number of the access requesting node uses the message sequence number of the first storage node). The client receives the first CM reply and obtains the starting message sequence number of the first storage node (second handshake). The client then sends a confirmation response to the first CM reply to the access requesting node (third handshake). At this point, a reliable connection is established between the client and the access requesting node.
[0269] It can be seen that in the process of establishing a connection between the client and the access requesting node, a connection is established between the access requesting node and the first storage node. Through steps S101 to S106, the client obtains the initial message sequence number of the first storage node, and the first storage node obtains the initial message sequence number of the client, and is ready for the transmission of subsequent messages.
[0270] The specific content of the pre-configuration information in step S103 and step S104 and the reason for setting the pre-configuration information in this way are introduced below.
[0271] The preconfiguration information includes the first information, the second information, and the first mapping relationship between the first information and the second information, the first information includes the address of the access request node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information. The preconfiguration information also includes the third information, the fourth information, and the second mapping relationship between the third information and the fourth information, the third information includes the address of the access request node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information. In the present application, "copy and forward" includes copying the original request or message, then modifying the destination address of the request or message obtained after the copy, and then sending the request or message obtained by copying and modifying the destination address.
[0272] Optionally, "copy forwarding" is only one of the implementation methods, and it can also be implemented through "modify forwarding". "Modify forwarding" means modifying the destination address in the original request or original message, and then sending the request or message with the modified destination address.
[0273] The preconfiguration information may exist in the form of a file or an instruction. When the preconfiguration information exists in the form of an instruction, the preconfiguration information includes: modifying the message sent by the client to the access requesting node to be sent to the first storage node. After the instruction is configured, during the subsequent message transmission, when the network device receives the message sent by the client to the access requesting node, the network device executes the configuration instruction and sends the message to the first storage node. That is, by configuring the instruction, the communication between the client and the first storage node via the network device is realized without passing through the access requesting node, and the message or request does not need to be forwarded through the access requesting node. The preconfiguration information also includes: modifying the message sent by the first storage node to the access requesting node to be sent to the client. After the instruction is configured, during the subsequent message transmission, when the network device receives the message sent by the first storage node to the access requesting node, the network device executes the configuration instruction and sends the message to the client. It should be noted that the client is unaware of the configuration process of the network device. From the client's perspective, the client believes that it has successfully established a reliable connection with the access requesting node, but in reality: in the process of establishing a connection between the client and the access requesting node, the access requesting node uses the client's starting message sequence number to establish a reliable connection with the first storage node. The access requesting node acts as a trusted "middleman". The access requesting node informs the first storage node of the client's starting message sequence number, and informs the client of the first storage node's starting message sequence number, which prepares for the subsequent transmission of messages between the client and the first storage node. After the network device is configured, in the subsequent message transmission process, when the network device receives a message sent from the client to the access requesting node, if it is determined that the home node corresponding to the message is the first storage node, the network device executes the pre-configuration information and directly sends the message to the first storage node without forwarding it through the access requesting node.
[0274] For the first storage node, the first storage node believes that it has established a connection with the access requesting node, but in fact: the access requesting node has established a connection with both the client and the first storage node, and the access requesting node acts as a "bridge" to achieve communication between the client and the first storage node. During the subsequent message transmission, the first storage node receives the NFS request and believes that the NFS request is sent by the access requesting node (actually sent by the client). Therefore, the first storage node will send the response message of the NFS request to the access requesting node. When the network device receives the message sent by the first storage node to the access requesting node, the network device executes the pre-configuration information and sends the message to the client.
[0275] In this application, whether it is a CM request, a CM reply, a confirmation response, or an NFS request, a message for transmitting data, or a completion instruction, they all exist in the form of messages, but the types of messages are different. Some are request type messages, some are data type messages, and some are completion type messages.
[0276] It should be noted that the above content only realizes the communication connection between the client and the first storage node. The client can also realize the connection with other storage nodes (non-request access nodes) through similar methods. Figure 3 In the example, the communication connection between the client and the B0 node or the B1 node can also be realized. Taking the B0 node as an example: the client sends a second CM request to the A0 node, and the second CM request carries the client's starting message sequence number; the A0 node establishes an RC connection with the B0 node through the starting message sequence number in the second CM request, so the B0 node obtains the client's starting message sequence number, and the A0 node also obtains the starting message sequence number of the B0 node; the A0 node sends pre-configuration information to the network device, and the pre-configuration information includes: when it is determined that the home node corresponding to the NFS request is the B0 node, the NFS request sent by the client to the A0 node is modified to be sent to the B0 node, and the message sent by the B0 node to the A0 node is modified to be sent to the client; A0 returns a second CM reply to the client, and the second CM reply carries the starting message sequence number of the B0 node, and the client obtains the starting message sequence number of the B0 node; the client returns a confirmation response to the CM reply to the A0 node. At this point, the communication connection between the client and the B0 node is realized. Similarly, the communication connection between the client and the B1 node can also be realized, which will not be described in detail here.
[0277] The client can also establish a reliable connection RC with the requesting access node. For example, Figure 3 In the example, a reliable connection can be established between the client and the A0 node through a three-way handshake, and the specific process is not repeated here. The client establishes communication connections with the access requesting node and each storage node, thereby achieving full connection between the client and the storage cluster.
[0278] To facilitate understanding of the technical solution of the embodiment of the present application, two examples are used to explain the technical solution. In one implementation, a connection is established between the client and the storage cluster based on remote direct memory access (RDMA) technology. For example, see Figure 4 The schematic diagram shown below Figure 4 The A0 node is the requesting access node, and the A1 node is the first storage node. Describe how the communication connection is established between the client and the first storage node.
[0279] Assume that the client's address is IP0, the address of the A0 node is IP1, and the address of the A1 node is IP2. Mount the address IP1 of the A0 node on the client. Assume that a queue pair (QP) QP0 is set on the client, queue pairs QP1 and QP2 are set on the A0 node, and queue pair QP3 is set on the A1 node. Among them, the client's QP0 and the A0 node's QP1 form a flow, and the A0 node's QP2 and the A1 node's QP3 form a flow.
[0280] The process of establishing a communication connection between the client and the A1 node is as follows.
[0281] 1) The client sends a CM request from {IP0, QP0} to the A0 node. The CM request carries the client's starting message sequence number. The A0 node receives the CM request through QP1.
[0282] 2) Node A0 establishes an RC connection with QP3 of node A1 through {IP1, QP2} using the client's starting message sequence number. A0 obtains the starting message sequence number of node A1, and node A1 also obtains the client's starting message sequence number.
[0283] 3) Node A0 sends pre-configuration information to the network device, and the network device is configured according to the pre-configuration information. The pre-configuration information includes: modifying the message with the destination address {IP1, QP1} to its destination address {IP2, QP3}, and modifying the message with the destination address {IP1, QP2} to its destination address {IP0, QP0}. It can be known that {IP1, QP1} and {IP0, QP0} constitute a flow, and the message with the destination address {IP1, QP1} refers to the message sent by the client to the A0 node. If the network device confirms that the belonging node of the message is A1, the network device executes the instruction "modify the message with the destination address {IP1, QP1} to its destination address {IP2, QP3}", so that the message (NFS request) sent by the client can be directly transmitted to the belonging node A1 without being forwarded by the A0 node. {IP2, QP3} and {IP1, QP2} form a flow. The message with the destination address {IP1, QP2} refers to the message sent by the A1 node to the A0 node. When the message passes through the network device, the network device executes the instruction "modify the message with the destination address {IP1, QP2} to its destination address {IP0, QP0}". In this way, the message sent by the first storage node can be directly transmitted to the client without being forwarded by the A0 node.
[0284] 4) Node A0 sends a CM reply to client {IP0, QP0} via {IP1, QP1}, where the CM reply carries the start message sequence number of node A1 QP3.
[0285] 5) The client sends a confirmation response to the CM reply to the A0 node {IP1, QP1} through {IP0, QP0}. It should be noted that steps 1), 4) and 5) are all implemented on one stream, so Figure 4 It is represented by a line with a double-headed arrow.
[0286] At this point, a communication connection relationship is established between the client and the A1 node.
[0287] exist Figure 4 In this example, QP4 is also set on the client (not in Figure 4 ), QP5 is set on the A0 node (not shown in Figure 4 As shown in FIG. 1 , QP4 and QP5 form a flow, which can be used to implement a reliable connection RC between the client and the A0 node. For example, the client sends a third CM request to the A0 node {IP1, QP5} through {IP0, QP4}, and the third CM request carries the client's starting message sequence number. After receiving the third CM request, the A0 node obtains the client's starting message sequence number and returns a third CM reply to the client through {IP1, QP5}, and the third CM reply carries the A0 node's starting message sequence number. After receiving the third CM reply, the client obtains the A0 node's starting message sequence number and sends a confirmation response to {IP1, QP5} for the third CM reply.
[0288] Understandably, Figure 4 In the example, the client can also establish communication connections with the B0 and B1 nodes in a similar way to establishing communication connections with the A1 node, which will not be described here. This enables full connection between the client and the storage cluster.
[0289] In another implementation, a connection is established between the client and the storage cluster based on the transmission control protocol (TCP). In this implementation, ports are set on the client and each node in the storage cluster. For example, port0 is set on the client, queue pairs port1 and port2 are set on the A0 node, and queue pair port3 is set on the A1 node, wherein port0 of the client and port1 of the A0 node form a flow, and port2 of the A0 node and port3 of the A1 node form a flow. Different from the above implementation, in the above implementation, the client and the storage node communicate through QP, and in this implementation, the client and the storage node communicate through port, thereby realizing full connection between the client and each node in the storage cluster. For the sake of simplicity of the specification, the specific implementation is not repeated here.
[0290] The present application provides a method for establishing a connection between a client and a cloud NFS. In the process of establishing a communication connection between the client and the first storage node, the requesting access node acts as a "bridge". In the process of establishing a reliable connection between the client and the requesting access node, the requesting access node establishes a reliable connection with the first storage node, the requesting access node informs the first storage node of the client's starting message sequence number, and informs the client of the starting message sequence number of the first storage node. The first storage node and the client both learn the other party's starting message sequence number. On this basis, the network device is pre-configured so that the client and the first storage node can communicate, thereby successfully establishing a communication connection between the client and the first storage node, laying a "material" foundation for the subsequent transmission of messages between the client and the first storage node.
[0291] Using a similar method, other storage nodes in the storage cluster can establish communication connections with the client, thereby achieving full connectivity between the client and each node in the storage cluster, laying a "material" foundation for subsequent communication between the client and each node. Full connectivity is the technical support for each storage node in the storage cluster to directly send messages to the client.
[0292] According to the above method embodiment, after the client establishes a full connection with the cloud NFS, the present application also provides a method for the client to access the cloud NFS. Figure 5 and Figure 6 , Figure 5 A flowchart of a method for a client to access NFS in the cloud provided by this application is shown in FIG. Figure 6 A schematic diagram of a scenario provided for this application is shown below. Figure 5 and Figure 6 , describing the method provided by the present application for a client to access NFS in the cloud, the method including but not limited to the description of the following content.
[0293] S201. A client sends an NFS request to a requesting access node via a network device, wherein the NFS request is a write request.
[0294] For the client, the client believes that it has established a connection with the access requesting node. The client sends an NFS request to the access requesting node, wherein the NFS request includes a write request and a read request. In this embodiment, the NFS request is taken as an example for introduction. The NFS request carries a field representing the home node corresponding to the NFS request.
[0295] S202: The network device determines a home node corresponding to the NFS request.
[0296] The NFS request sent by the client to the access requesting node passes through the network device. When the network device receives the NFS request sent by the client to the access requesting node, it determines the home node corresponding to the NFS request based on the file service partition identifier (fspid for short, which can be understood as home representation information) field carried in the NFS request.
[0297] Optionally, the network device receives an NFS request sent by a client to a requesting access node. First, the network device copies the NFS request based on pre-configured information, modifies the destination address of the copied NFS request, and then sends the copied NFS request with the modified destination address. Then, the network device determines the home node corresponding to the NFS request and sends the NFS request to the home node. It is understandable that the storage node where the destination address is located may be the same as the home node corresponding to the NFS request, or may not be the same.
[0298] Among them, the NFS request with the destination address modified after being copied is sent out, and the network device adds a label in the NFS request. After the storage node where the destination address is located receives the marked request, it only backs up and does not respond to it. The label is used to indicate that the NFS request is only backed up and does not respond to it.
[0299] S203: When the network device determines that the home node corresponding to the NFS request is the first storage node, the network device sends the NFS request to the first storage node.
[0300] When the network device determines that the home node corresponding to the NFS request is the first storage node, the network device sends the NFS request to the first storage node.
[0301] For example, see Figure 6 The schematic diagram shown, 1. indicates that the network device receives an NFS request sent by the client to the access requesting node, 2. indicates that the network device forwards the NFS request to the first storage node, wherein the first storage node refers to the A1 node and the access requesting node refers to the A0 node.
[0302] S204: The client sends the file corresponding to the NFS request to the first storage node.
[0303] The NFS request is a write request, and the home node corresponding to the NFS request is the first storage node, that is, the client wants to write a file to the first storage node. A communication connection is established between the client and the first storage node, so the client can send the file corresponding to the NFS request to the first storage node via the network device. After receiving the file, the first storage node writes the file to the persistent medium. For example, see Figure 6As shown in the schematic diagram, 3, it indicates that the client sends the file corresponding to the NFS request to the first storage node.
[0304] The client sends the file corresponding to the NFS request to the first storage node, which may specifically include the following steps S2041 to S2044, see Figure 7 shown.
[0305] S2041. The first storage node initiates a read request to the requesting access node via a network device according to the NFS request.
[0306] The first storage node receives an NFS request, which is a write request. The first storage node knows that a file needs to be written to its own device. The first storage node believes that it has established a connection with the access requesting node. Therefore, after receiving the NFS request, the first storage node initiates a read request to the access requesting node. The read request is used to read / obtain the file corresponding to the NFS request.
[0307] S2042: The network device receives a read request sent from the first storage node to the access requesting node, and sends the read request to the client based on pre-configuration information.
[0308] After receiving a read request sent by the first storage node to the access requesting node, the network device sends the read request to the client based on the pre-configuration information of the network device. The pre-configuration information is completed when the client establishes a communication connection with the first storage node, and the pre-configuration information includes: first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information.
[0309] S2043: The client sends the file corresponding to the NFS request to the requesting access node via the network device according to the read request.
[0310] After receiving the read request, the client sends the file corresponding to the NFS request to the requesting access node via the network device.
[0311] S2044: The network device receives the file sent by the client to the access requesting node, and sends the file to the first storage node based on the pre-configured information.
[0312] The network device receives a file sent by the client to the access requesting node, and based on the pre-configuration information of the network device, sends the file to the first storage node. After receiving the file, the first storage node writes the file to the persistent medium. The pre-configuration information also includes: third information, fourth information, and a second mapping relationship between the third information and the fourth information. The third information includes the address of the access requesting node, and the fourth information includes the address of the client. The second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information. In the present application, "copy and forward" includes copying the original request or message, then modifying the destination address of the request or message obtained after the copy, and then sending the copied request or message with the modified destination address.
[0313] S205. The first storage node sends a request completion instruction to the client.
[0314] After receiving the file, the first storage node sends a request completion instruction to the client via the network device, and the request completion instruction is used to indicate that the NFS request (write request) is completed. For example, Figure 6 4. indicates that the first storage node sends a request completion instruction to the client.
[0315] The first storage node sends a request completion instruction to the client, and the specific implementation includes: the first storage node sends the request completion instruction to the requesting access node via the network device; the network device receives the request completion instruction sent by the first storage node to the requesting access node, and based on the pre-configuration information of the network device, sends the request completion instruction to the client.
[0316] To facilitate understanding of the technical solution, a specific example is used below to explain how a client accesses NFS in the cloud.
[0317] For example, Figure 4In the example, the client sends an NFS write request to the A0 node {IP1, QP5}; after receiving the NFS write request, the network device determines the home node corresponding to the NFS write request according to the fspid field carried in the NFS write request. When the home node is determined to be the A1 node, the network device copies the NFS write request and forwards the copied NFS write request to the A1 node; the A1 node receives the NFS write request and initiates an RDMA read request to the A0 node {IP1, QP2}. The network device receives the RDMA read request sent by the A1 node to the A0 node and forwards the read request to the client {IP0, QP0} according to the pre-configured information; the client receives To the read request, send the file corresponding to the NFS request to the A0 node {IP1, QP1}; after the network device receives the file sent by the client to the A0 node {IP1, QP1}, it forwards the file to the A1 node {IP2, QP3} according to the pre-configuration information; after the A1 node receives the file, it writes the file to the persistent medium and sends a request completion instruction to the client. Specifically, the A1 node sends the request completion instruction to the A0 node {IP1, QP2} through {IP2, QP3}. The network device receives the request completion instruction sent by the A1 node to the A0 node {IP1, QP2}, and sends the request completion instruction to the client according to the pre-configuration information.
[0318] This application also provides a method for a client to access NFS in the cloud. Figure 8 , Figure 8 A flowchart of another method for a client to access NFS in the cloud provided in the present application, the method includes but is not limited to the description of the following content.
[0319] S301. A client sends an NFS request to a requesting access node via a network device, wherein the NFS request is a read request.
[0320] S302: The network device determines a home node corresponding to the NFS request.
[0321] S303: When the network device determines that the home node corresponding to the NFS request is the first storage node, the network device sends the NFS request to the first storage node.
[0322] S304: The first storage node sends the file corresponding to the NFS request to the client.
[0323] The NFS request is a read request, that is, the client wants to read a file in the first storage node. After the first storage node receives the NFS request, the first storage node sends the file corresponding to the NFS request to the client.
[0324] The first storage node sends the file corresponding to the NFS request to the client, which specifically includes: the first storage node sends the file corresponding to the NFS request to the requesting access node via the network device, the network device receives the file sent by the first storage node to the requesting access node, and sends the file to the client according to the pre-configuration information.
[0325] S305. The first storage node sends a request completion instruction to the client.
[0326] In this embodiment, steps S301, S302, S303 and S305 can refer to Figure 5 The description of the contents of steps S201, S202, S203 and S205 in the method embodiment is not repeated here for the sake of brevity. The difference between step S301 and step S201 is that the NFS request in S301 is a write request, while the NFS request in step S301 of this embodiment is a read request.
[0327] It can be seen that on the basis of establishing a communication connection between the client and each node in the storage cluster, the client can send requests to each node in the storage cluster, and each node can also send data (files) to the client, and the transmission of requests, data, and instructions does not need to be forwarded through other nodes in the storage cluster. Compared with establishing a single connection between the client and the request access node in the storage cluster, when the client communicates with other storage nodes in the storage cluster, it needs to be forwarded through the request access node. The method described in this application reduces the consumption of internal bandwidth of the storage cluster and improves the efficiency of the storage cluster in processing requests.
[0328] This application also provides a system architecture, such as Fig. 9 As shown, Fig. 9 Another system architecture diagram provided for the present application. The system includes a client, a network device and a storage cluster, an NFS system is set on the storage cluster, and the storage cluster includes multiple nodes. For example, in this example, the storage cluster includes an A0 node, an A1 node, an A2 node, an A3 node, a B0 node, a B1 node, a B2 node and a B3 node. The multiple nodes shown here are only examples and do not constitute a limitation on the present application.
[0329] Fig. 9 In the system shown, the network device does not have the function of determining the home node corresponding to the NFS request. The request access node (proxy node) in the storage cluster has the function of determining the home node corresponding to the NFS request.
[0330] The traditional method is that the client establishes a single connection with the network file system NFS in the storage cluster. For example, if the A0 node is the access request node, the client and the storage cluster are connected through the A0 node. First, a reliable connection is established between the client and the A0 node based on the TCP protocol or the RDMA protocol. Then, the client sends an NFS request to the A0 node through a network device. The NFS request carries a field representing the home node. The A0 node determines the home node corresponding to the NFS request based on the field representing the home node carried in the NFS request, and sends the NFS request to the corresponding home node.
[0331] However, when the number of NFS requests received by the A0 node is large, the A0 node is in a high load state. Considering load balancing and reducing the load pressure of the A0 node, the present application provides a method to set the A1 node in the storage cluster as a request access node (agent node) and adopt the above Figure 2 and Figure 3 The method for establishing a connection between the client and the A1 node described above establishes a connection between the client and the A1 node in the present system, that is, the A0 node is used as a "bridge" to establish a connection between the client and the A1 node through the A0 node. After the connection between the client and the A1 node is established, the A1 node can be used to receive the NFS request sent by the client, and the A1 node and the A0 node can jointly bear the NFS request sent by the client, thereby reducing the load pressure of the A0 node.
[0332] Similarly, the B0 node and the B1 node can also be set as request access nodes (proxy nodes), and the same method can be used to establish a connection between the client and the B0 node, and a connection between the client and the B1 node. Then, the B0 node and the B1 node can also be used to receive NFS requests sent by the client. In this way, the A0 node, the A1 node, the B0 node and the B1 node can all be used to process the NFS request, determine the home node corresponding to the NFS request, and then send the NFS request to the corresponding home node.
[0333] The method described in this system architecture can achieve load balancing, reduce the load pressure of the A0 node, and improve the efficiency of request processing.
[0334] The above content is a description of a method embodiment. The following introduces a device embodiment corresponding to the method embodiment.
[0335] See also Fig.10 , Fig.10A structural diagram of a node 600 in a storage cluster provided in the present application, in which a network file system NFS is deployed, the node 600 can be configured as a request access node in the above method embodiment, or can be configured as any storage node in the above method embodiment, for example, the first storage node.
[0336] When the node 600 is configured to request an access node, the node 600 includes a receiving module 601 and a sending module 602, wherein:
[0337] The receiving module 601 is used to receive a connection management CM request sent by a client, where the CM request carries a starting message sequence number of the client;
[0338] The receiving module 601 and the sending module 602 are used in cooperation to establish a reliable connection RC with the first storage node using the starting message sequence number of the client, and obtain the starting message sequence number of the first storage node;
[0339] The sending module 602 is used to send pre-configuration information to the network device, the network device is used to realize the connection between the client and the requesting access node and the first storage node, and the pre-configuration information is used for the configuration of the network device;
[0340] The sending module 602 is used to return a CM reply to the client, where the CM reply carries the start message sequence number of the first storage node;
[0341] The receiving module 601 is used to receive a confirmation response returned by the client in response to the CM reply.
[0342] In a possible implementation, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; the pre-configuration information also includes third information, fourth information, and a second mapping relationship between the third information and the fourth information, the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0343] In a possible implementation, a queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node;
[0344] The receiving module 601 is used to receive, through the queue pair QP1, a CM request sent by the client through the queue pair QP0, where the CM request carries the starting message sequence number of the client;
[0345] The receiving module 601 and the sending module 602 are used in cooperation to establish a reliable connection RC between the queue pair QP2 and the queue pair QP3 on the first storage node using the starting message sequence number of the client, and obtain the starting message sequence number of the first storage node;
[0346] The sending module 602 is used to send pre-configuration information to the network device, so that the network device is configured according to the pre-configuration information to realize communication between the client and the first storage node through the network device; the pre-configuration information includes: modifying the NFS request sent to the queue pair QP1 of the access requesting node to be sent to the queue pair QP3 of the first storage node; modifying the message sent to the queue pair QP2 of the access requesting node to be sent to the queue pair QP0 of the client;
[0347] The sending module 602 is used to return a CM reply to the queue pair QP0 of the client through the queue pair QP1, and the CM reply carries the starting message sequence number of the first storage node;
[0348] The receiving module 601 is used to receive, through the queue pair QP1, a confirmation response returned by the client through the queue pair QP0 in response to the CM reply, thereby establishing a communication connection between the client and the first storage node.
[0349] In a possible implementation, the client further sets a queue pair QP4, and the requesting access node further sets a queue pair QP5; the receiving module 601 and the sending module 602 cooperate to establish a reliable connection RC with the queue pair QP4 of the client through the queue pair QP5.
[0350] In a possible implementation, port port0 is set on the client, port port1 and port port2 are set on the requesting access node, and port port3 is set on the first storage node;
[0351] The receiving module 601 is used to receive, through port port1, a CM request sent by a client through port port0, where the CM request carries a starting message sequence number of the client;
[0352] The receiving module 601 and the sending module 602 are used in cooperation to establish a connection with the port port3 on the first storage node through the port port2 using the starting message sequence number of the client, and obtain the starting message sequence number of the first storage node;
[0353] The sending module 602 is used to send pre-configuration information to the network device, where the pre-configuration information is used for configuration of the network device;
[0354] The sending module 602 is used to return a CM reply to the port port0 of the client through the port port1, and the CM reply carries the starting message sequence number of the first storage node;
[0355] The receiving module 601 is used to receive, through port port1, a confirmation response returned by the client through port port0 in response to the CM reply, thereby establishing a communication connection between the client and the first storage node.
[0356] In a possible implementation, the client further sets port port4, and the requesting access node further sets port port5; the receiving module 601 and the sending module 602 cooperate to establish a connection with the client's port port4 through port port5.
[0357] In a possible implementation, the client establishes a connection with the access requesting node and any one of the multiple storage nodes based on the Remote Direct Memory Access (RDMA) protocol or the Transmission Control Protocol (TCP).
[0358] When the node 600 is configured as any storage node in the storage cluster, for example, it may be the first storage node, the node 600 includes a receiving module 601 and a sending module 602, wherein:
[0359] Receiving module 601, used for receiving NFS request sent by client;
[0360] A sending module 602 is used to obtain a file corresponding to an NFS request from a client, or to send a file corresponding to an NFS request to a client;
[0361] The sending module 602 is further used to send a request completion instruction to the client.
[0362] In a possible implementation, the NFS request is a write request, the sending module 602 is used to send a read request to the client, and the read request is used to read the file corresponding to the NFS request; the receiving module 601 is used to receive the file corresponding to the NFS request sent by the client.
[0363] In a possible implementation, the NFS request is a read request, and the sending module 602 is used to send a write request to the client, where the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0364] The above modules are divided according to their functions. In practical applications, there may be other division methods, or the modules may be divided into a greater or lesser number, which is not limited in this application.
[0365] Each functional module can be used to implement the methods described in the above method embodiments. For details, please refer to the description of the relevant content of the above method embodiments. For the sake of brevity of the specification, it will not be repeated here.
[0366] The present application also provides a network device 700, see Fig.11 , Fig.11 A schematic diagram of the structure of a network device 700 provided in the present application, the network device 700 includes:
[0367] The receiving module 701 is used to receive a connection management CM request sent by a client;
[0368] A sending module 703 is used to send a CM request to a requesting access node, wherein the CM request carries a starting message sequence number of the client;
[0369] The receiving module 701 is also used to receive pre-configuration information sent by the access requesting node, where the pre-configuration information is used for configuration of the network device;
[0370] The receiving module 701 is further used to receive a CM reply sent by the access requesting node, and the sending module 703 is further used to send the CM reply to the client, where the CM reply carries the starting message sequence number of the first storage node;
[0371] The receiving module 701 is further used to receive a confirmation response returned by the client in response to the CM reply, and the sending module 703 is further used to send the confirmation response to the access requesting node, thereby establishing a connection between the client and the first storage node.
[0372] In a possible implementation, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; the pre-configuration information also includes third information, fourth information, and a second mapping relationship between the third information and the fourth information, the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node, and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
[0373] In a possible implementation, the receiving module 701 is used to receive an NFS request sent by a client;
[0374] A determination module 702, configured to determine a home node corresponding to the NFS request;
[0375] A sending module 703, configured to send the NFS request to the first storage node in response to determining that the home node corresponding to the NFS request is the first storage node;
[0376] The sending module 703 is further used to send the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, or to send the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information;
[0377] The sending module 703 is further configured to send the request completion instruction sent by the first storage node to the client based on the pre-configuration information.
[0378] In a possible implementation, the NFS request is a write request, and the sending module 703 is used to send the read request sent by the first storage node to the client based on pre-configuration information, and the read request is used to read the file corresponding to the NFS request; the sending module 703 is used to send the file corresponding to the NFS request sent by the client to the first storage node based on pre-configuration information.
[0379] In a possible implementation, the NFS request is a read request, and the sending module 703 is used to send the write request sent by the first storage node to the client based on pre-configuration information. The write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
[0380] Fig.11 The modules in the system are divided according to their functions. In practical applications, there may be other division methods, or the system may be divided into a greater number or a smaller number of modules, which is not limited in this application.
[0381] Each functional module can be used to implement the operations performed by the network device in the above-mentioned method embodiments. For details, please refer to the description of the relevant content of the above-mentioned method embodiments. For the sake of brevity of the specification, it will not be repeated here.
[0382] See also Fig.12 , Fig.12 A structural diagram of a hardware device 800 provided in the present application, the hardware device 800 can be configured as any node in the storage cluster in the above method embodiment, such as a requesting access node or a first storage node, and can also be configured as a network device in the above method embodiment.
[0383] The hardware device 800 includes: a bus 802, a processor 804, a memory 806 and a communication interface 808. The processor 804, the memory 806 and the communication interface 808 communicate with each other via the bus 802. It should be understood that the present application does not limit the number of processors and memories in the hardware device 800.
[0384] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 The bus 802 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 802 may include a path for transmitting information between various components of the hardware device 800 (eg, the memory 806, the processor 804, and the communication interface 808).
[0385] The processor 804 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0386] The memory 806 may include a volatile memory, such as a random access memory (RAM). The processor 804 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0387] The memory 806 stores executable program codes.
[0388] When the hardware device 800 is configured as any node in the storage cluster, such as being configured as a requesting access node or a first storage node, the processor 804 executes the executable program code in the memory 806 to respectively implement the functions of the aforementioned receiving module 601 and the sending module 602, thereby implementing all or part of the method for the client to access the network file system NFS on the cloud, and implementing all or part of the method for the client to establish a connection with the network file system NFS on the cloud. That is, the memory 806 stores all or part of the instructions for executing the method for the client to access the network file system NFS on the cloud, and executing all or part of the instructions for executing the method for the client to establish a connection with the network file system NFS on the cloud.
[0389] When the hardware device 800 is configured as a network device, the processor 804 executes the executable program code in the memory 806 to respectively implement the functions of the aforementioned receiving module 701, the determining module 702, and the sending module 703, thereby implementing all or part of the method for the client to access the network file system NFS on the cloud, and implementing all or part of the method for the client to establish a connection with the network file system NFS on the cloud. That is, the memory 806 stores all or part of the instructions for executing the method for the client to access the network file system NFS on the cloud, and executing all or part of the instructions for executing the method for the client to establish a connection with the network file system NFS on the cloud.
[0390] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the hardware device 800 and other devices or a communication network.
[0391] In some possible embodiments, the above network device may be implemented as a virtualized device.
[0392] For example, a virtualized device may be a virtual machine (VM) running a program for sending a message, and the virtual machine is deployed on a hardware device, for example, the hardware device may be a physical server, or the hardware device may be a cloud storage device. A virtual machine refers to a complete computer system that runs in a completely isolated environment and has complete hardware system functions simulated by software, and a virtual machine may be configured as a network device. For example, a network device may be implemented based on a general physical server in combination with network function virtualization (NFV) technology. The network device is a virtual host, a virtual router, or a virtual switch. Those skilled in the art can virtualize a network device with the above functions on a general physical server in combination with NFV technology by reading this application, and will not go into details here.
[0393] The virtualized device may be a container, which is an entity used to provide an isolated virtualized environment. For example, the container may be a docker container, which may be configured as a network device. For example, a network device may be created through a corresponding image, such as through an image of a container proxy-container that provides a proxy service, a container proxy-container instance may be created for the proxy-container, and the container instance proxy-container may be provided as a network device. When implemented using container technology, the network device may run using the kernel of a physical machine, and multiple network devices may share the operating system of a physical machine. Different network devices may be isolated through container technology. Containerized network devices may run in a virtualized environment, such as a virtual machine, or they may run directly in a physical machine.
[0394] For example, a virtualized device may be a Pod, which is a basic unit for deploying, managing, and orchestrating containerized applications in Kubernetes (Kubernetes is an open source container orchestration engine from Google, referred to as K8s). A Pod may include one or more containers. Each container in the same Pod is usually deployed on the same host, so each container in the same Pod can communicate through the host and can share the storage resources and network resources of the host. A Pod may be configured as a network device. For example, specifically, a container as a service (CaaS, a container-based PaaS service) may be instructed to create a Pod and provide the Pod as a network device. Of course, network devices may also be other virtualized devices, which are not listed here one by one.
[0395] An embodiment of the present application also provides a system, including a client, a network device and a network file system NFS in the cloud, the NFS includes a requesting access node and multiple storage nodes, the multiple storage nodes include a first storage node, the multiple storage nodes store files, the requesting access node is an entry node for the client to send a request to the NFS via the network device, the first storage node, the requesting access node and the network device are used to implement all or part of the methods described in the above method embodiments.
[0396] The present application embodiment also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a processor or stored in any available medium. When the computer program product is run on a processor, the processor executes all or part of the methods described in the above method embodiment.
[0397] The present application embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the processor to execute the method described in the above method embodiment.
[0398] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for a client to access a network file system NFS, characterized in that: The NFS includes a requesting access node and a plurality of storage nodes, the plurality of storage nodes includes a first storage node, and files are stored in the plurality of storage nodes. The method includes: The first storage node receives an NFS request sent by the client based on a connection established between the first storage node and the client; The first storage node obtains the file corresponding to the NFS request from the client based on the connection, or the first storage node sends the file corresponding to the NFS request to the client based on the connection.
2. The method according to claim 1, characterized in that: The NFS request is a write request. The first storage node obtains the file corresponding to the NFS request from the client based on the connection, including: The first storage node sends a read request to the client based on the connection, where the read request is used to read the file corresponding to the NFS request; The first storage node receives the file corresponding to the NFS request sent by the client based on the connection.
3. The method according to claim 1, characterized in that The NFS request is a read request. The first storage node sends the file corresponding to the NFS request to the client based on the connection, including: The first storage node sends a write request to the client based on the connection, where the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
4. The method according to any one of claims 1 to 3, characterized in that: Before the first storage node receives the NFS request sent by the client based on the connection established between the first storage node and the client, the method further includes: The first storage node establishes a connection with the client through the request access node.
5. The method according to claim 4, characterized in that The first storage node establishes a connection with the client through the request access node, including: The first storage node receives a connection management CM request sent by the access requesting node, where the CM request is a request sent by the client to the access requesting node; The first storage node establishes a connection with the requesting access node based on the CM request, so that the requesting access node returns a CM reply to the client.
6. The method according to claim 5, characterized in that A queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node; The method comprises: The QP3 on the first storage node receives a connection management CM request sent by the QP2 on the access requesting node, where the CM request is a request sent by the QP0 on the client to the QP1 on the access requesting node; QP3 on the first storage node establishes a connection with QP2 on the requesting access node based on the CM request, so that QP1 on the requesting access node returns a CM reply to QP0 on the client.
7. The method according to any one of claims 4 to 6, characterized in that: The first storage node establishes a connection with the client through the request access node based on a remote direct memory access (RDMA) protocol.
8. A method for a client to access a network file system NFS, characterized in that: The method is applied to a network device, the network device is used for communication between the client and the NFS, the NFS includes a request access node and multiple storage nodes, the multiple storage nodes store files, the multiple storage nodes include a first storage node, and the method includes: The network device receives the NFS request sent by the client; In response to determining that the home node corresponding to the NFS request is the first storage node, the network device sends the NFS request to the first storage node; The network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, or the network device sends the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information.
9. The method according to claim 8, characterized in that The NFS request is a write request. The network device sends, based on the pre-configuration information, the file corresponding to the NFS request sent by the client to the first storage node, including: The network device sends the read request sent by the first storage node to the client based on the pre-configuration information, where the read request is used to read the file corresponding to the NFS request; The network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information.
10. The method according to claim 8, characterized in that The NFS request is a read request. The network device sends, based on the pre-configuration information, the file corresponding to the NFS request sent by the first storage node to the client, including: The network device sends the write request sent by the first storage node to the client based on the pre-configuration information, where the write request is used to write the file corresponding to the NFS request, and the write request includes the file corresponding to the NFS request.
11. The method according to any one of claims 8 to 10, characterized in that: Before the network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, or before the network device sends the file corresponding to the NFS request sent by the first storage node to the client based on the pre-configuration information, the method further includes: The network device receives the pre-configuration information sent by the access requesting node, the pre-configuration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the access requesting node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
12. The method according to any one of claims 8 to 11, characterized in that The network device sends the file corresponding to the NFS request sent by the client to the first storage node based on the pre-configuration information, including: The network device receives the file corresponding to the NFS request sent by the client; Determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node; In response to determining that the destination address of the file corresponding to the NFS request is the address of the access requesting node, copying and forwarding the file corresponding to the NFS request to the first storage node; The network device sends, based on the pre-configuration information, the file corresponding to the NFS request sent by the first storage node to the client, including: The network device receives the file corresponding to the NFS request sent by the first storage node; Determine that the destination address of the file corresponding to the NFS request is the address of the requesting access node; In response to determining that the destination address of the file corresponding to the NFS request is the address of the requesting access node, the file corresponding to the NFS request is copied and forwarded to the client.
13. A method for establishing a connection between a client and a network file system NFS, characterized in that: The NFS includes a requesting access node and a plurality of storage nodes, the plurality of storage nodes includes a first storage node, and files are stored in the plurality of storage nodes. The method includes: The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node; The requesting access node sends pre-configuration information to the network device, so that the network device is used to implement the client sending a write request or a read request to the first storage node based on the pre-configuration information, or so that the network device is used to implement the first storage node sending a write request or a read request to the client based on the pre-configuration information.
14. The method according to claim 13, characterized in that The CM request is used to establish a connection between the client and the first storage node, including: The requesting access node sends the CM request to the first storage node, and establishes a connection with the first storage node based on the CM request; The requesting access node sends a CM reply to the client; The requesting access node receives a confirmation response returned by the client in response to the CM reply.
15. The method according to claim 13 or 14, characterized in that The preconfiguration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
16. The method according to any one of claims 13 to 15, characterized in that A queue pair QP0 is set on the client, a queue pair QP1 and a queue pair QP2 are set on the request access node, and a queue pair QP3 is set on the first storage node; The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node, including: QP1 on the requesting access node receives a connection management CM request sent by QP0 on the client; QP2 on the requesting access node sends the CM request to QP3 on the first storage node, and establishes a connection with QP3 on the first storage node based on the CM request; QP1 on the requesting access node sends a CM reply to QP0 on the client; QP1 on the requesting access node receives a confirmation response returned by QP0 on the client for the CM reply.
17. The method according to claim 16, characterized in that The client further sets a queue pair QP4, and the request access node further sets a queue pair QP5; the method further includes: QP5 on the requesting access node establishes a connection with QP4 on the client.
18. The method according to any one of claims 13 to 15, characterized in that Port port0 is set on the client, port port1 and port port2 are set on the request access node, and port port3 is set on the first storage node; The requesting access node receives a connection management CM request sent by the client, where the CM request is used to establish a connection between the client and the first storage node, including: The port 1 on the requesting access node receives the connection management CM request sent by the port 0 on the client; Port2 on the requesting access node sends the CM request to port3 on the first storage node, and establishes a connection with port3 on the first storage node based on the CM request; Port1 on the requesting access node sends a CM reply to port0 on the client; Port1 on the requesting access node receives a confirmation response returned by port0 on the client in response to the CM reply.
19. The method according to claim 18, characterized in that The client further sets a port port4, and the request access node further sets a port port5; the method further comprises: The port 5 on the requesting access node establishes a connection with the port 4 on the client.
20. The method according to any one of claims 13 to 19, characterized in that The requesting access node is used to establish a connection between the first storage node and the client based on a remote direct memory access RDMA protocol or a transmission control protocol TCP.
21. A method for establishing a connection between a client and a network file system NFS, characterized in that: The NFS includes a requesting access node and a plurality of storage nodes, the plurality of storage nodes store files, the plurality of storage nodes include a first storage node, and the method includes: The network device receives the pre-configuration information sent by the requesting access node, so that the network device is used to implement the client sending a write request or a read request to the first storage node based on the pre-configuration information, or the network device is used to implement the first storage node sending a write request or a read request to the client based on the pre-configuration information.
22. The method according to claim 21, characterized in that The preconfiguration information includes first information, second information, and a first mapping relationship between the first information and the second information, the first information includes the address of the requested access node, the second information includes the address of the first storage node, and the first mapping relationship is used to indicate that when the network device receives a read request or a write request sent by the client, and the destination address of the read request or the write request is the first information, the network device is triggered to copy and forward the read request or the write request to the storage node indicated by the second information; The pre-configuration information also includes third information, fourth information and a second mapping relationship between the third information and the fourth information, wherein the third information includes the address of the access requesting node, the fourth information includes the address of the client, and the second mapping relationship is used to indicate that when the network device receives a message sent by the first storage node and the destination address of the message is the third information, the network device is triggered to copy and forward the message to the device indicated by the fourth information.
23. A network device, characterized in that: It comprises a memory and a processor, wherein the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the method as described in any one of claims 8 to 12, or to implement the method as described in any one of claims 21 to 22.
24. A computing device cluster, characterized in that: It includes a requesting access node and multiple storage nodes, wherein the requesting access node and any one of the multiple storage nodes include a memory and a processor, and the processor is used to execute instructions stored in the memory so that the computing device cluster executes the method as described in any one of claims 1-7, or so that the computing device cluster executes the method as described in any one of claims 13-20.
25. A system, characterized in that: It includes a network device and a network file system NFS, the NFS includes a requesting access node and multiple storage nodes, the multiple storage nodes include a first storage node, the multiple storage nodes store files, the requesting access node is used to receive an NFS request sent by a client, the system is used to implement the method described in any one of claims 1-7, or the system is used to implement the method described in any one of claims 8-12, or the system is used to implement the method described in any one of claims 13-20, or the system is used to implement the method described in any one of claims 21-22.
26. A computer-readable storage medium, characterized in that: The method comprises program instructions, which, when executed on a processor, cause the processor to execute the method as described in any one of claims 1 to 7, or cause the processor to execute the method as described in any one of claims 8 to 12, or cause the processor to execute the method as described in any one of claims 13 to 20, or cause the processor to execute the method as described in any one of claims 21 to 22.
Citation Information
Cited By
Method for client to access network file system and related apparatus
EP4790971A1
Method for client to access network file system and related apparatus
WO2025082319A1