WO2016065610A1 - Method for accessing files, distributed storage system and storage node - Google Patents

Method for accessing files, distributed storage system and storage node Download PDF

Info

Publication number
WO2016065610A1
WO2016065610A1 PCT/CN2014/090017 CN2014090017W WO2016065610A1 WO 2016065610 A1 WO2016065610 A1 WO 2016065610A1 CN 2014090017 W CN2014090017 W CN 2014090017W WO 2016065610 A1 WO2016065610 A1 WO 2016065610A1
Authority
WO
WIPO (PCT)
Prior art keywords
space
virtual address
local
address
storage node
Prior art date
Application number
PCT/CN2014/090017
Other languages
French (fr)
Chinese (zh)
Inventor
朱冠宇
徐君
刘海燕
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201480037251.5A priority Critical patent/CN105765542B/en
Priority to PCT/CN2014/090017 priority patent/WO2016065610A1/en
Publication of WO2016065610A1 publication Critical patent/WO2016065610A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems

Definitions

  • the present invention relates to the field of storage technologies, and in particular, to a method for accessing a file, a distributed storage system, and a storage node.
  • New non-violate memory (NVM) media such as Phase Change Memory (PCM), Resistive RAM (ReRAM), Magnetic Random Access Memory (Magnetic Random Access Memory) , MRAM), etc., with similar dynamic random access memory (DRAM) read and write characteristics, can be hung on the memory bus for access.
  • PCM Phase Change Memory
  • ReRAM Resistive RAM
  • MRAM Magnetic Random Access Memory
  • DRAM dynamic random access memory
  • NFS Network File System
  • CIFS Common Internet File System
  • RPC Remote Procedure Call
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the embodiment of the invention provides a method for accessing a file, a distributed storage system and a storage node, which can improve the efficiency of file access.
  • a method for accessing a file is provided, the method being applied to a distributed storage system, the distributed storage system comprising a management node, a plurality of storage nodes, and a network device, each storage node in the distributed storage system
  • the local virtual address space corresponds to a portion of the global virtual address space of the distributed storage system, and the method includes:
  • the first storage node Receiving, by the first storage node, an access request of the host forwarded by the network device, where the access request is used to access a first virtual space of the target file, where the first virtual space is the management node allocates the target file in the global virtual address space.
  • the destination address of the access request is the first virtual a global virtual address of the space, the first storage node being a storage node of the plurality of storage nodes for storing the target file;
  • the first storage node accesses the target file according to the local virtual address.
  • the number of bits of the destination address is 2N bits, where N is the number of bits of the local virtual address, and the high N bits of the destination address include the first storage node
  • the device information, the lower N bits of the destination address is the local virtual address, and the access request is forwarded by the network device to the first storage node according to the device information of the first storage node.
  • the first storage node accesses the target file according to the local virtual address.
  • the first storage node determines that there is a local physical space address corresponding to the local virtual address, the first storage node writes the data in the write request to the local physical space corresponding to the local physical space address;
  • the first storage node determines that there is no local physical space address corresponding to the local virtual address, the first storage node allocates a local physical space for the target file, and writes the data in the write request to the allocated local physical In space.
  • the first storage node accesses the target file according to the local virtual address.
  • the first storage node determines a local physical space address corresponding to the local virtual address, and reads data in the local physical space corresponding to the local physical space address.
  • the first storage node receives the network device forwarding Before the host's access request, the method also includes:
  • the first storage node allocates the local virtual address space to the target file according to the space allocation request
  • the first storage node establishes a correspondence between the destination address and a local virtual address of the local virtual address space.
  • the method further includes:
  • the first storage node deletes the correspondence between the destination address and the local virtual address according to the space collection message, and recovers the local virtual address space;
  • the first storage node reclaims the local physical space corresponding to the local virtual address space.
  • a distributed storage system including: a management node, a plurality of storage nodes, and a network device;
  • a local virtual address space of each of the plurality of storage nodes corresponds to a portion of a global virtual address space of the distributed storage system
  • the management node is configured to allocate a first virtual space to the target file in the global virtual address space
  • the network device is configured to forward an access request of the host to the first storage node, where the access request is used to access the first virtual space, and the destination address of the access request is a global virtual address of the first virtual space, the first storage node a storage node for storing the target file among the plurality of storage nodes;
  • the first storage node is configured to receive the access request by the network device, and determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node, according to the The local virtual address accesses the target file.
  • the number of bits of the destination address is 2N bits
  • N is the number of bits of the local virtual address
  • the high N bits of the destination address include the device of the first storage node.
  • Information the lower N bits of the destination address are the local virtual address
  • the network device is specifically configured to forward the access request to the first storage node according to the device information of the first storage node.
  • the first storage node when the access request is a write request, is specifically configured to determine the presence and the local The local physical space address corresponding to the virtual address, the data in the write request is written to the The local physical space corresponding to the local physical space address; or, if it is determined that there is no local physical space address corresponding to the local virtual address, allocate a local physical space for the target file, and write the data in the write request to the allocated In the local physical space.
  • the first storage node when the access request is a read request, is specifically configured to determine the local virtual address Corresponding local physical space address, reading data in the local physical space corresponding to the local physical space address.
  • the first storage node is further configured to receive the management node a space allocation request for allocating a local virtual address space for the target file, the space allocation request carrying a global virtual address of the first virtual space;
  • the first storage node is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local a virtual address space, where the space reclaim message carries a global virtual address of the first virtual space;
  • a storage node including:
  • a receiving module configured to receive an access request of a host forwarded by a network device in the distributed storage system, where the access request is used to access a first virtual space of the target file, where the first virtual space is a management node in the distributed storage system a space allocated for the target file in the global virtual address space of the distributed storage system, where a local virtual address space of each storage node in the distributed storage system corresponds to a part of the global virtual address space, and the destination address of the access request a global virtual address for the first virtual space;
  • the processing module is configured to determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the storage node, and access the target file according to the local virtual address.
  • the number of bits of the destination address is 2N. Bit, N is the number of bits of the local virtual address, the high N bits of the destination address contain device information of the storage node, and the lower N bits of the destination address are the local virtual address, and the access request is determined by the network device according to the storage The device information of the node is forwarded to the storage node.
  • the processing module when the access request is a write request, is specifically configured to:
  • the data in the write request is written to the local physical space corresponding to the local physical space address
  • the local physical space is allocated to the target file, and the data in the write request is written into the allocated local physical space.
  • the processing module when the access request is a read request, is specifically configured to determine, corresponding to the local virtual address.
  • the local physical space address reads the data in the local physical space corresponding to the local physical space address.
  • the receiving module is further configured to receive the sending by the management node a space allocation request, the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries a global virtual address of the first virtual space;
  • the processing module is further configured to allocate the local virtual address space to the target file according to the space allocation request, and establish a correspondence between the destination address and a local virtual address of the local virtual address space.
  • the receiving module is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local virtual address. a space, the space reclaim message carrying a global virtual address of the first virtual space;
  • the processing module is further configured to delete the correspondence between the destination address and the local virtual address according to the space collection message, recover the local virtual address space, and recover the local physical space corresponding to the local virtual address space.
  • a computer program product comprising a computer readable storage medium storing program code, the program code comprising instructions for performing the method of the first aspect described above.
  • the method for accessing a file, the distributed storage system, and the storage node in the embodiment of the present invention access the distributed storage system according to the local virtual address corresponding to the destination address by receiving an access request whose destination address is a global virtual address.
  • the files in the file enable the host to directly access files in the distributed storage system, thereby improving the efficiency of file access.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for accessing a file according to an embodiment of the present invention.
  • FIG. 3 is a schematic block diagram of a distributed storage system in accordance with an embodiment of the present invention.
  • FIG. 4 is a schematic block diagram of a storage node in accordance with an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a storage node according to an embodiment of the present invention.
  • virtual address space may also be expressed as “virtual space”, that is, “virtual address space” and “virtual space” are common; similarly, “local physical storage space” “Common with “local physical space.”
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention.
  • host 130, storage node 120, and management node 110 are interconnected by network 140.
  • Storage node 120, management node 110, and network 140 form a distributed storage system.
  • the host 130 can be a computer or other user device, and the host 130 can communicate with the distributed storage system through a network.
  • Host 130 may include any computing device known in the art, such as a server, desktop computer, etc., with an operating system and other applications installed in host 130, and there may be multiple hosts 130.
  • Host 130 can access files of the distributed storage system.
  • the host 130 can provide a file access interface to an application on the host through the file interface module.
  • the storage node 120 is configured to store file data and process access requests to the file.
  • Storage node 120 may include at least one type of memory, for example, a new type of NVM having the ability to address and access in bytes, such as PCM, ReRAM, MRAM, and the like.
  • the file is stored in the NVM memory, and the storage node 120 can implement access to the new NVM through the memory bus.
  • the management node 110 is configured to manage metadata of the file, process metadata query, update request, and the like of the host to the file.
  • the metadata of the file may include information such as the starting address of the file, the size of the allocated space, and the actual size of the file.
  • the management node 110 can also be used to manage the global virtual address space of the distributed storage system.
  • the management node 110 and the storage node 120 may also be combined, that is, one node may have the functions of both the management node and the storage node.
  • the management node may be independently set (for example, the metadata management node 110 in FIG. 1), or may be a node having the functions of the metadata management node and the storage node at the same time.
  • the management node 110 will be described below as an example.
  • the physical layer and link layer of the network 140 may be based on Ethernet, a PCIE switching network, an InfiniBand network, and an optical network.
  • the network 140 is used to route access requests and access responses. Specifically, the routes may be performed by a network device such as a router or a switch. For convenience of description, the following describes a network device as an example.
  • FIG. 2 shows a schematic flow diagram of a method 200 of accessing a file in accordance with an embodiment of the present invention.
  • the method 200 is applied to a distributed storage system including a management node, a plurality of storage nodes, and a network device.
  • the local virtual address space of each storage node in the distributed storage system corresponds to a portion of the global virtual address space of the distributed storage system.
  • the first storage node receives an access request of the host forwarded by the network device, where the access request is used to access a first virtual space of the target file, where the first virtual space is the management node in the global virtual address space.
  • a space allocated by the file, the destination address of the access request is a global virtual address of the first virtual space, and the first storage node is a storage node of the plurality of storage nodes for storing the target file.
  • the global virtual address space of a distributed storage system is the space that is virtualized for managing files in the distributed storage system.
  • the local virtual address space of the different storage nodes in the distributed storage system corresponds to different portions of the global virtual address space of the distributed storage system. For example, global virtual Mapping a first portion of the virtual address space to a local virtual address space of the first storage node in the distributed storage system, and mapping a second portion of the global virtual address space to a second storage node in the distributed storage system
  • the local virtual address space wherein the first part of the space is different from the second part of the space.
  • the management node may allocate a continuous space (represented as the first virtual space) from the global virtual address space of the distributed storage system to the target file. Since the local virtual address space of each storage node in the distributed storage system corresponds to a portion of the global virtual address space of the distributed storage system, the first virtual space can be mapped to the local virtual address space of the storage node.
  • the local virtual address space may use an unused interval of the virtual address space of an operating system (OS) OS.
  • OS operating system
  • the 64-bit OS has a virtual address space size of 2 to the 64th power.
  • the local virtual address space can use the virtual address reserved by the OS. space. You can also re-divide the virtual address space of the operating system as needed, and divide a virtual address space into a local virtual address space.
  • the number of bits in the address of the local virtual address space is the number of bits in the OS. For example, for a 64-bit OS, the number of bits in the local virtual address is 64 bits.
  • the address of the global virtual address space is the global virtual address.
  • the number of bits in the global virtual address can be greater than the number of bits in the local virtual address.
  • the number of bits of the global virtual address may be twice the number of bits of the local virtual address, that is, if the number of bits of the local virtual address is N, the number of bits of the global virtual address is 2N.
  • the global virtual address can have 128 bits.
  • the global virtual address space of the distributed storage system can be mapped to the local virtual address space of the storage node by the correspondence between the global virtual address and the local virtual address.
  • the high N bits of the global virtual address may correspond to the device information of the node (eg, ID, or ID and node type), globally.
  • the lower N bits of the virtual address may correspond to a local virtual address within the node, such that the global virtual address space may correspond to the local virtual address space of each storage node. It should be understood that only a portion of the high N bits may carry the device information of the storage node (eg, the highest 8 bits are the ID of the first storage node), and the remaining bits may be reserved or reserved for other purposes.
  • the correspondence between the global virtual address and the local virtual address may be established in advance, or may be established when space is allocated for the target file.
  • the management node can configure the locals of all storage nodes on the management node.
  • Corresponding relationship between the local virtual address and the global virtual address (which may be referred to as a total mapping table), and the mapping between the local virtual address of the storage node and the global virtual address (which may be referred to as a sub-mapping table) is configured on each storage node.
  • the total mapping table can also be configured on each storage node. In this manner, the local virtual address of all available local virtual address spaces of each storage node is already in the global virtual address and local virtual address correspondence.
  • the management node allocates the first virtual space to the target file, the global virtual address in the corresponding relationship is allocated. Based on the correspondence, the first virtual space is automatically mapped to the local virtual address space of the storage node, and further mapped through the local virtual address space. Go to the local physical storage space.
  • the management node allocates the first virtual space to the target file, the global virtual address in the global virtual address space is allocated, and a space allocation request is sent to the storage node, and the allocated global virtual is carried.
  • the storage node allocates a local virtual address space for the target file, and associates the local virtual address of the allocated local virtual address space with the global virtual address in the space allocation request, that is, establishes the global virtual address of the first virtual space and the allocated local address.
  • the correspondence between the local virtual addresses of the virtual address space may also return the local virtual address of the local virtual address space allocated for the target file to the management node, and the management node establishes a correspondence between the global virtual address of the first virtual space and the local virtual address on the management node.
  • the host When the host accesses the target file in the distributed storage system, the host sends an access request to the network device to access the first virtual space of the target file.
  • the destination address of the access request is the global virtual address of the first virtual space.
  • the network device forwards the access request to the first storage node.
  • the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address in the first storage node corresponding to the destination address, and the high N bit of the destination address includes the The device information of the first storage node, the lower N bits of the destination address is the local virtual address, and the access request is forwarded by the network device to the first storage node according to the device information of the first storage node.
  • the number of bits of the destination address of the access request is 2N
  • the high N bits of the destination address of the access request include device information (eg, ID, or ID and node type) of the first storage node
  • the lower N bits of the destination address of the access request are the local virtual addresses in the first storage node for storing the local virtual address space of the target file.
  • the network device may forward the access request of the host to the first storage node according to the device information of the first storage node.
  • the first storage node determines a local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node.
  • the first storage node After receiving the access request sent by the network device, the first storage node converts the destination address of the access request into a local virtual address in the first storage node.
  • the correspondence between the destination address and the local virtual address may be in the form of a correspondence table, that is, the correspondence relationship table is used to record the destination address corresponding to the local virtual address, in this case, the first storage.
  • the node determines a local virtual address corresponding to the destination address according to the correspondence relationship table; the correspondence between the destination address and the local virtual address may also be intangible, that is, pre-defining a part of the destination address (for example, a low of 2N bits)
  • the N-bit is the local virtual address corresponding to the destination address.
  • the first storage node directly determines the corresponding bit in the destination address as the local virtual address corresponding to the destination address.
  • the first storage node accesses the target file according to the local virtual address.
  • the first storage node accesses the target file according to the local virtual address obtained in S220.
  • the first storage node determines a local physical space address corresponding to the local virtual address, and reads a local physical medium corresponding to the local physical space address. Data in space.
  • the first storage node queries the local physical space address corresponding to the local virtual address, and if there is no corresponding local physical space address, the access error is generated, so an access error is sent to the network device. Access response. If there is a corresponding local physical space address, the data in the local physical space corresponding to the local physical space address is read, and the data is carried in the access response and sent to the network device.
  • the access request is a write request
  • the first storage node determines that there is a local physical space address corresponding to the local virtual address
  • the data in the write request is written to the local physical space corresponding to the local physical space address.
  • the first storage node allocates the local physical space for the target file, and writes the local physical space.
  • the data in the request is written to the allocated local physical space.
  • the first storage node queries the local physical space address corresponding to the local virtual address, and if the corresponding local physical space address does not exist, the local physical space is not allocated to the target file. Allocating a local physical space for the target file, then writing the data in the write request to the allocated local physical space, and sending a successful access response to the network device; if there is a corresponding local physical space address, the request is written The data in the local data space is written in the local physical space corresponding to the local physical space address, and the access to the network device is successfully sent. should.
  • the method for accessing a file in the embodiment of the present invention by receiving an access request whose destination address is a global virtual address, accessing a file in the distributed storage system according to a local virtual address corresponding to the destination address, enables the host to directly access the distributed storage. Files in the system, which can improve the efficiency of file access.
  • the method 200 further includes:
  • the first storage node allocates the local virtual address space to the target file according to the space allocation request
  • the first storage node establishes a correspondence between the destination address and a local virtual address of the local virtual address space.
  • the space allocation request may carry a starting global virtual address and size of the first virtual space of the target file.
  • the first storage node may first determine whether the local virtual address space satisfies the size requirement, and if not, return an error response; if yes, allocate a local virtual address space for the target file, and establish a corresponding The corresponding relationship returns a successful response.
  • the method 200 further includes:
  • the first storage node deletes the correspondence between the destination address and the local virtual address according to the space collection message, and recovers the local virtual address space;
  • the first storage node reclaims the local physical space corresponding to the local virtual address space.
  • the management node When the target file space is reclaimed, the management node sends a space reclamation message to the first storage node.
  • the space reclamation message may carry the global virtual address of the first virtual space.
  • the first storage node may first determine whether there is a local virtual address corresponding to the global virtual address, and if not, return an error response; if yes, delete the correspondence between the global virtual address and the local virtual address, and recycle the first The local virtual address space corresponding to the virtual space, and the local physical space corresponding to the local virtual address space is recovered, and a successful response is returned.
  • a method of accessing a file according to an embodiment of the present invention is described in detail above, and a distributed storage system and a storage node according to an embodiment of the present invention will be described below.
  • FIG. 3 shows a schematic block diagram of a distributed storage system 300 in accordance with an embodiment of the present invention.
  • the distributed storage system 300 includes a management node 310, a plurality of storage nodes 320, and a network device 330.
  • the local virtual address space of each of the plurality of storage nodes 320 corresponds to a portion of the global virtual address space of the distributed storage system 300.
  • the management node 310 is configured to allocate a first virtual space for the target file in the global virtual address space.
  • the network device 330 is configured to forward an access request of the host to the first storage node, where the access request is used to access the first virtual space, and the destination address of the access request is a global virtual address of the first virtual space, the first storage
  • the node is a storage node of the plurality of storage nodes 320 for storing the target file
  • the first storage node is configured to receive the access request by the network device 330, and determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node.
  • the target file is accessed according to the local virtual address.
  • the distributed storage system of the embodiment of the present invention can directly access the distributed storage by accessing the file in the distributed storage system according to the local virtual address corresponding to the destination address by receiving the access request with the destination address being the global virtual address. Files in the system, which can improve the efficiency of file access.
  • the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address, and the high N bits of the destination address include device information of the first storage node, and the destination address The lower N bits are the local virtual address;
  • the network device 330 is specifically configured to forward the access request to the first storage node according to the device information of the first storage node.
  • the access request is a write request
  • the access request is a write request
  • the first storage node determines that there is a local physical space address corresponding to the local virtual address
  • the data in the write request is written into the local physical space corresponding to the local physical space address.
  • the first storage node determines that there is no local physical space address corresponding to the local virtual address
  • the local physical space is allocated to the target file, and the data in the write request is written to the allocation. In the local physical space.
  • the first storage node when the access request is a read request, is specifically configured to determine a local physical space address corresponding to the local virtual address, and read the local physical space address. Data in the local physical space.
  • the first storage node is further configured to receive a space allocation request sent by the management node 310, where the space allocation request is used to allocate a local virtual address space to the target file, where the space allocation request is Carrying a global virtual address of the first virtual space;
  • the first storage node is further configured to receive a space collection message sent by the management node 310, where the space collection message is used to recover the local virtual address space, where the space recovery message carries the first a global virtual address of a virtual space;
  • the distributed storage system 300 may correspond to the distributed storage system in the foregoing method embodiments, and the first storage node may perform the corresponding processes of the foregoing various methods. For brevity, no further details are provided herein.
  • FIG. 4 shows a schematic block diagram of a storage node 400 in accordance with an embodiment of the present invention.
  • the storage node 400 includes:
  • the receiving module 410 is configured to receive an access request of a host forwarded by a network device in the distributed storage system, where the access request is used to access a first virtual space of the target file, where the first virtual space is a management in the distributed storage system.
  • the space allocated by the node in the global virtual address space of the distributed storage system for the target file, where the local virtual address space of each storage node in the distributed storage system corresponds to a part of the global virtual address space, and the purpose of the access request The address is a global virtual address of the first virtual space;
  • the processing module 420 is configured to: according to the destination address and a local virtual address in the storage node Corresponding relationship, determining the local virtual address corresponding to the destination address of the access request, and accessing the target file according to the local virtual address.
  • the storage node of the embodiment of the present invention can access the distributed storage system by directly accessing the file in the distributed storage system according to the local virtual address corresponding to the destination address by receiving the access request with the destination address being the global virtual address. Files, which can improve the efficiency of file access.
  • the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address, and the high N bits of the destination address include device information of the storage node, and the destination address is low.
  • the N bit is the local virtual address, and the access request is forwarded by the network device to the storage node according to the device information of the storage node.
  • the processing module 420 is specifically configured to determine that a local physical space address corresponding to the local virtual address exists, and write the data in the write request to The local physical space address corresponds to the local physical space; or,
  • the processing module 420 when the access request is a read request, is specifically configured to determine a local physical space address corresponding to the local virtual address, and read the local corresponding to the local physical space address. Data in physical space.
  • the receiving module 410 is further configured to receive a space allocation request sent by the management node, where the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries the The global virtual address of the first virtual space;
  • the processing module 420 is further configured to allocate the local virtual address space to the target file according to the space allocation request, and establish a correspondence between the destination address and a local virtual address of the local virtual address space.
  • the receiving module 410 is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local virtual address space, where the space recovery message carries the first virtual The global virtual address of the space;
  • the processing module 420 is further configured to delete the correspondence between the destination address and the local virtual address according to the space collection message, recover the local virtual address space, and recover the local physical space corresponding to the local virtual address space.
  • the storage node 400 may correspond to a first storage node in the method 200 of accessing a file according to an embodiment of the present invention, and the above and other operations and/or functions of the respective modules in the storage node 400 are respectively The corresponding processes of the various methods are not described here for brevity.
  • FIG. 5 illustrates a structure of a storage node provided by still another embodiment of the present invention, including at least one processor 502 (eg, a CPU), at least one network interface 505 or other communication interface, memory 506, and at least one communication bus 503. among them:
  • Communication bus 503 is used to implement connection communication between these devices.
  • the processor 502 is configured to execute executable modules, such as computer programs, stored in the memory 506.
  • the memory 506 may include a high speed random access memory (RAM: Random Access Memory) and may also include an NVM, such as at least one disk storage.
  • RAM Random Access Memory
  • NVM such as at least one disk storage.
  • the storage node implements a communication connection with the network through at least one network interface 505, which may be wired or wireless.
  • the memory 506 stores a program 5061 that is used to execute the program 5061 to implement the various methods in the foregoing method embodiments.
  • the term "and/or” is merely an association relationship describing an associated object, indicating that there may be three relationships.
  • a and/or B may indicate that A exists separately, and A and B exist simultaneously, and B cases exist alone.
  • the character "/" in this article generally indicates that the contextual object is an "or" relationship.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative
  • the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be Ignore, or not execute.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, or an electrical, mechanical or other form of connection.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for accessing files, a distributed storage system, and a storage node. The method comprises: a first storage node receives a host access request forwarded by a network device, said access request being used for accessing a first virtual space of a target file, said first virtual space being a space in the global virtual address space allocated for the target file by a management node, and the target address of the access request being the global virtual address of said first virtual space (S210), the first storage node being a storage node used for storing said target file; the first storage node, on the basis of the correspondence between the target address and the local virtual address of the first storage node, determines the local virtual address corresponding to the target address of the access request (S220); and the first storage node, on the basis of the local virtual address, accesses the target file (S230). The efficiency of file access can thereby be improved.

Description

访问文件的方法、分布式存储系统和存储节点Method of accessing files, distributed storage systems, and storage nodes 技术领域Technical field
本发明涉及存储技术领域,具体涉及访问文件的方法、分布式存储系统和存储节点。The present invention relates to the field of storage technologies, and in particular, to a method for accessing a file, a distributed storage system, and a storage node.
背景技术Background technique
新型非易失存储(non-violate memory,NVM)介质,比如相变内存(Phase Change Memory,PCM)、可变电阻式随机存取器(Resistive RAM,ReRAM)、磁性随机存储器(Magnetic Random Access Memory,MRAM)等,具有类似动态随机存取存储器(Dynamic Random Access Memory,DRAM)的读写特点,能够挂在内存总线上进行访问。目前,基于非易失存储介质的存储系统是业界研究的热点。New non-violate memory (NVM) media, such as Phase Change Memory (PCM), Resistive RAM (ReRAM), Magnetic Random Access Memory (Magnetic Random Access Memory) , MRAM), etc., with similar dynamic random access memory (DRAM) read and write characteristics, can be hung on the memory bus for access. At present, storage systems based on non-volatile storage media are hotspots in the industry.
现有远程访问文件系统的方法包括采用网络文件系统(Network File System,NFS)或者通用网络文件系统(Common Internet File System,CIFS)协议等。这些传统的访问文件的方式本质上都是基于远程过程调用(Remote Procedure Call,RPC),是建立在传输控制协议/因特网互联协议(Transmission Control Protocol/Internet Protocol,TCP/IP)之上的访问方式。对于基于NVM的存储系统来说,如果仍然采用传统的远程访问文件系统的访问方法,仍需要经过主机的内核TCP/IP协议栈处理,访问效率较低。Existing methods for remotely accessing a file system include using a Network File System (NFS) or a Common Internet File System (CIFS) protocol. These traditional ways of accessing files are essentially based on Remote Procedure Call (RPC), which is based on the Transmission Control Protocol/Internet Protocol (TCP/IP). . For an NVM-based storage system, if the traditional remote access file system access method is still used, it still needs to be processed by the host's kernel TCP/IP protocol stack, and the access efficiency is low.
发明内容Summary of the invention
本发明实施例提供了一种访问文件的方法、分布式存储系统和存储节点,能够提高文件访问的效率。The embodiment of the invention provides a method for accessing a file, a distributed storage system and a storage node, which can improve the efficiency of file access.
第一方面,提供了一种访问文件的方法,该方法应用于分布式存储系统中,该分布式存储系统包括管理节点、多个存储节点和网络设备,该分布式存储系统中每一个存储节点的本地虚拟地址空间对应该分布式存储系统的全局虚拟地址空间的一部分,该方法包括:In a first aspect, a method for accessing a file is provided, the method being applied to a distributed storage system, the distributed storage system comprising a management node, a plurality of storage nodes, and a network device, each storage node in the distributed storage system The local virtual address space corresponds to a portion of the global virtual address space of the distributed storage system, and the method includes:
第一存储节点接收该网络设备转发的主机的访问请求,该访问请求用于访问目标文件的第一虚拟空间,该第一虚拟空间为该管理节点在该全局虚拟地址空间中为该目标文件分配的空间,该访问请求的目的地址为该第一虚拟 空间的全局虚拟地址,该第一存储节点为该多个存储节点中用于存储该目标文件的存储节点;Receiving, by the first storage node, an access request of the host forwarded by the network device, where the access request is used to access a first virtual space of the target file, where the first virtual space is the management node allocates the target file in the global virtual address space. Space, the destination address of the access request is the first virtual a global virtual address of the space, the first storage node being a storage node of the plurality of storage nodes for storing the target file;
该第一存储节点根据该目的地址与该第一存储节点中的本地虚拟地址的对应关系,确定该访问请求的目的地址对应的该本地虚拟地址;Determining, by the first storage node, the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node;
该第一存储节点根据该本地虚拟地址访问该目标文件。The first storage node accesses the target file according to the local virtual address.
结合第一方面,在第一种可能的实现方式中,该目的地址的位数为2N位,其中,N为该本地虚拟地址的位数,该目的地址的高N位包含该第一存储节点的设备信息,该目的地址的低N位为该本地虚拟地址,该访问请求由该网络设备根据该第一存储节点的设备信息转发给该第一存储节点。With reference to the first aspect, in a first possible implementation, the number of bits of the destination address is 2N bits, where N is the number of bits of the local virtual address, and the high N bits of the destination address include the first storage node The device information, the lower N bits of the destination address is the local virtual address, and the access request is forwarded by the network device to the first storage node according to the device information of the first storage node.
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,在该访问请求为写请求时,该第一存储节点根据该本地虚拟地址访问该目标文件,包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, when the access request is a write request, the first storage node accesses the target file according to the local virtual address. ,include:
若该第一存储节点确定存在与该本地虚拟地址对应的本地物理空间地址,则该第一存储节点将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中;或者,If the first storage node determines that there is a local physical space address corresponding to the local virtual address, the first storage node writes the data in the write request to the local physical space corresponding to the local physical space address; or
若该第一存储节点确定不存在与该本地虚拟地址对应的本地物理空间地址,则该第一存储节点为该目标文件分配本地物理空间,并将该写请求中的数据写到分配的本地物理空间中。If the first storage node determines that there is no local physical space address corresponding to the local virtual address, the first storage node allocates a local physical space for the target file, and writes the data in the write request to the allocated local physical In space.
结合第一方面或第一方面的第一种可能的实现方式,在第三种可能的实现方式中,在该访问请求为读请求时,该第一存储节点根据该本地虚拟地址访问该目标文件,包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation, when the access request is a read request, the first storage node accesses the target file according to the local virtual address. ,include:
该第一存储节点确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。The first storage node determines a local physical space address corresponding to the local virtual address, and reads data in the local physical space corresponding to the local physical space address.
结合第一方面或第一方面的第一至三种可能的实现方式中的任一种可能的实现方式,在第四种可能的实现方式中,在该第一存储节点接收该网络设备转发的主机的访问请求之前,该方法还包括:With reference to the first aspect or any one of the first to the third possible implementation manners of the first aspect, in a fourth possible implementation, the first storage node receives the network device forwarding Before the host's access request, the method also includes:
该第一存储节点接收该管理节点发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space allocation request sent by the management node, where the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries a global virtual address of the first virtual space;
该第一存储节点根据该空间分配请求,为该目标文件分配该本地虚拟地址空间; The first storage node allocates the local virtual address space to the target file according to the space allocation request;
该第一存储节点建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。The first storage node establishes a correspondence between the destination address and a local virtual address of the local virtual address space.
结合第一方面的第四种可能的实现方式,在第五种可能的实现方式中,该方法还包括:In conjunction with the fourth possible implementation of the first aspect, in a fifth possible implementation, the method further includes:
该第一存储节点接收该管理节点发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space reclaiming message sent by the management node, where the space reclaiming message is used to reclaim the local virtual address space, where the space reclaiming message carries a global virtual address of the first virtual space;
该第一存储节点根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间;The first storage node deletes the correspondence between the destination address and the local virtual address according to the space collection message, and recovers the local virtual address space;
该第一存储节点回收该本地虚拟地址空间对应的本地物理空间。The first storage node reclaims the local physical space corresponding to the local virtual address space.
第二方面,提供了一种分布式存储系统,包括:管理节点、多个存储节点和网络设备;In a second aspect, a distributed storage system is provided, including: a management node, a plurality of storage nodes, and a network device;
该多个存储节点中的每一个存储节点的本地虚拟地址空间对应该分布式存储系统的全局虚拟地址空间的一部分;A local virtual address space of each of the plurality of storage nodes corresponds to a portion of a global virtual address space of the distributed storage system;
该管理节点用于在该全局虚拟地址空间中为目标文件分配第一虚拟空间;The management node is configured to allocate a first virtual space to the target file in the global virtual address space;
该网络设备用于向第一存储节点转发主机的访问请求,该访问请求用于访问该第一虚拟空间,该访问请求的目的地址为该第一虚拟空间的全局虚拟地址,该第一存储节点为该多个存储节点中用于存储该目标文件的存储节点;The network device is configured to forward an access request of the host to the first storage node, where the access request is used to access the first virtual space, and the destination address of the access request is a global virtual address of the first virtual space, the first storage node a storage node for storing the target file among the plurality of storage nodes;
该第一存储节点用于接收该网络设备转发该访问请求,根据该目的地址与该第一存储节点中的本地虚拟地址的对应关系,确定该访问请求的目的地址对应的该本地虚拟地址,根据该本地虚拟地址访问该目标文件。The first storage node is configured to receive the access request by the network device, and determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node, according to the The local virtual address accesses the target file.
结合第二方面,在第一种可能的实现方式中,该目的地址的位数为2N位,N为该本地虚拟地址的位数,该目的地址的高N位包含该第一存储节点的设备信息,该目的地址的低N位为该本地虚拟地址;With reference to the second aspect, in a first possible implementation manner, the number of bits of the destination address is 2N bits, N is the number of bits of the local virtual address, and the high N bits of the destination address include the device of the first storage node. Information, the lower N bits of the destination address are the local virtual address;
该网络设备具体用于根据该第一存储节点的设备信息向该第一存储节点转发该访问请求。The network device is specifically configured to forward the access request to the first storage node according to the device information of the first storage node.
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现方式中,在该访问请求为写请求时,该第一存储节点具体用于若确定存在与该本地虚拟地址对应的本地物理空间地址,则将该写请求中的数据写到该 本地物理空间地址对应的本地物理空间中;或者,若确定不存在与该本地虚拟地址对应的本地物理空间地址,则为该目标文件分配本地物理空间,将该写请求中的数据写到分配的本地物理空间中。With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, when the access request is a write request, the first storage node is specifically configured to determine the presence and the local The local physical space address corresponding to the virtual address, the data in the write request is written to the The local physical space corresponding to the local physical space address; or, if it is determined that there is no local physical space address corresponding to the local virtual address, allocate a local physical space for the target file, and write the data in the write request to the allocated In the local physical space.
结合第二方面或第二方面的第一种可能的实现方式,在第三种可能的实现方式中,在该访问请求为读请求时,该第一存储节点具体用于确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。With reference to the second aspect, or the first possible implementation manner of the second aspect, in a third possible implementation, when the access request is a read request, the first storage node is specifically configured to determine the local virtual address Corresponding local physical space address, reading data in the local physical space corresponding to the local physical space address.
结合第二方面或第二方面的第一至三种可能的实现方式中的任一种可能的实现方式,在第四种可能的实现方式中,该第一存储节点还用于接收该管理节点发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;With reference to the second aspect or any one of the first to the third possible implementation manners of the second aspect, in a fourth possible implementation, the first storage node is further configured to receive the management node a space allocation request for allocating a local virtual address space for the target file, the space allocation request carrying a global virtual address of the first virtual space;
根据该空间分配请求,为该目标文件分配该本地虚拟地址空间;Allocating the local virtual address space to the target file according to the space allocation request;
建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。Establish a correspondence between the destination address and a local virtual address of the local virtual address space.
结合第二方面的第四种可能的实现方式,在第五种可能的实现方式中,该第一存储节点还用于接收该管理节点发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;In conjunction with the fourth possible implementation of the second aspect, in a fifth possible implementation, the first storage node is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local a virtual address space, where the space reclaim message carries a global virtual address of the first virtual space;
根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间;Deleting the correspondence between the destination address and the local virtual address according to the space collection message, and recovering the local virtual address space;
回收该本地虚拟地址空间对应的本地物理空间。Reclaims the local physical space corresponding to the local virtual address space.
第三方面,提供了一种存储节点,包括:In a third aspect, a storage node is provided, including:
接收模块,用于接收分布式存储系统中的网络设备转发的主机的访问请求,该访问请求用于访问目标文件的第一虚拟空间,该第一虚拟空间为该分布式存储系统中的管理节点在该分布式存储系统的全局虚拟地址空间中为该目标文件分配的空间,该分布式存储系统中每一个存储节点的本地虚拟地址空间对应该全局虚拟地址空间的一部分,该访问请求的目的地址为该第一虚拟空间的全局虚拟地址;a receiving module, configured to receive an access request of a host forwarded by a network device in the distributed storage system, where the access request is used to access a first virtual space of the target file, where the first virtual space is a management node in the distributed storage system a space allocated for the target file in the global virtual address space of the distributed storage system, where a local virtual address space of each storage node in the distributed storage system corresponds to a part of the global virtual address space, and the destination address of the access request a global virtual address for the first virtual space;
处理模块,用于根据该目的地址与该存储节点中的本地虚拟地址的对应关系,确定该访问请求的目的地址对应的该本地虚拟地址,根据该本地虚拟地址访问该目标文件。The processing module is configured to determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the storage node, and access the target file according to the local virtual address.
结合第三方面,在第一种可能的实现方式中,该目的地址的位数为2N 位,N为该本地虚拟地址的位数,该目的地址的高N位包含该存储节点的设备信息,该目的地址的低N位为该本地虚拟地址,该访问请求由该网络设备根据该存储节点的设备信息转发给该存储节点。In combination with the third aspect, in the first possible implementation, the number of bits of the destination address is 2N. Bit, N is the number of bits of the local virtual address, the high N bits of the destination address contain device information of the storage node, and the lower N bits of the destination address are the local virtual address, and the access request is determined by the network device according to the storage The device information of the node is forwarded to the storage node.
结合第三方面或第三方面的第一种可能的实现方式,在第二种可能的实现方式中,在该访问请求为写请求时,该处理模块具体用于:With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, when the access request is a write request, the processing module is specifically configured to:
若确定存在与该本地虚拟地址对应的本地物理空间地址,则将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中;或者,If it is determined that the local physical space address corresponding to the local virtual address exists, the data in the write request is written to the local physical space corresponding to the local physical space address; or
若确定不存在与该本地虚拟地址对应的本地物理空间地址,则为所述目标文件分配本地物理空间,并将该写请求中的数据写到分配的本地物理空间中。If it is determined that there is no local physical space address corresponding to the local virtual address, the local physical space is allocated to the target file, and the data in the write request is written into the allocated local physical space.
结合第三方面或第三方面的第一种可能的实现方式,在第三种可能的实现方式中,在该访问请求为读请求时,该处理模块具体用于确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。With reference to the third aspect, or the first possible implementation manner of the third aspect, in a third possible implementation, when the access request is a read request, the processing module is specifically configured to determine, corresponding to the local virtual address. The local physical space address reads the data in the local physical space corresponding to the local physical space address.
结合第三方面或第三方面的第一至三种可能的实现方式中的任一种可能的实现方式,在第四种可能的实现方式中,该接收模块还用于接收该管理节点发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;With reference to the third aspect, or any one of the first to the third possible implementation manners of the third aspect, in a fourth possible implementation, the receiving module is further configured to receive the sending by the management node a space allocation request, the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries a global virtual address of the first virtual space;
该处理模块还用于根据该空间分配请求,为该目标文件分配该本地虚拟地址空间,建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。The processing module is further configured to allocate the local virtual address space to the target file according to the space allocation request, and establish a correspondence between the destination address and a local virtual address of the local virtual address space.
结合第三方面的第四种可能的实现方式,在第五种可能的实现方式中,该接收模块还用于接收该管理节点发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;In conjunction with the fourth possible implementation of the third aspect, in a fifth possible implementation, the receiving module is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local virtual address. a space, the space reclaim message carrying a global virtual address of the first virtual space;
该处理模块还用于根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间,回收该本地虚拟地址空间对应的本地物理空间。The processing module is further configured to delete the correspondence between the destination address and the local virtual address according to the space collection message, recover the local virtual address space, and recover the local physical space corresponding to the local virtual address space.
第四方面,提供了一种计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令用于执行前述第一方面中所述的方法。 In a fourth aspect, a computer program product is provided, comprising a computer readable storage medium storing program code, the program code comprising instructions for performing the method of the first aspect described above.
基于上述技术方案,本发明实施例的访问文件的方法、分布式存储系统和存储节点,通过接收目的地址为全局虚拟地址的访问请求,根据与该目的地址对应的本地虚拟地址访问分布式存储系统中的文件,可以使主机能够直接访问分布式存储系统中的文件,从而能够提高文件访问的效率。Based on the foregoing technical solution, the method for accessing a file, the distributed storage system, and the storage node in the embodiment of the present invention access the distributed storage system according to the local virtual address corresponding to the destination address by receiving an access request whose destination address is a global virtual address. The files in the file enable the host to directly access files in the distributed storage system, thereby improving the efficiency of file access.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings in the following description are only attached to some embodiments of the present invention. Figure.
图1是本发明实施例的一个应用场景的示意图。FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention.
图2是本发明实施例的访问文件的方法的示意性流程图。FIG. 2 is a schematic flowchart of a method for accessing a file according to an embodiment of the present invention.
图3是本发明实施例的分布式存储系统的示意性框图。3 is a schematic block diagram of a distributed storage system in accordance with an embodiment of the present invention.
图4是本发明实施例的存储节点的示意性框图。4 is a schematic block diagram of a storage node in accordance with an embodiment of the present invention.
图5是本发明实施例的存储节点的结构示意图。FIG. 5 is a schematic structural diagram of a storage node according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments.
应理解,本发明实施例的技术方案可以应用于各种存储系统,尤其是基于非易失存储介质的分布式存储系统。It should be understood that the technical solutions of the embodiments of the present invention can be applied to various storage systems, especially distributed storage systems based on non-volatile storage media.
还应理解,在本发明实施例中,术语“虚拟地址空间”也可以表述为“虚拟空间”,也就是说,“虚拟地址空间”和“虚拟空间”通用;类似地,“本地物理存储空间”和“本地物理空间”通用。It should also be understood that in the embodiment of the present invention, the term "virtual address space" may also be expressed as "virtual space", that is, "virtual address space" and "virtual space" are common; similarly, "local physical storage space" "Common with "local physical space."
图1是本发明实施例的一个应用场景的示意图。在图1中,主机130、存储节点120和管理节点110通过网络140互联互通。存储节点120、管理节点110以及网络140组成分布式存储系统。FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention. In FIG. 1, host 130, storage node 120, and management node 110 are interconnected by network 140. Storage node 120, management node 110, and network 140 form a distributed storage system.
主机130可以是计算机,也可以是其他用户设备,主机130可以通过网络与分布式存储系统通信。主机130可以包括当前技术已知的任何计算设备,如服务器、台式计算机等等,在主机130中安装有操作系统以及其他应用程序,主机130可以有多个。主机130可以访问分布式存储系统的文件。例如, 主机130可以通过文件接口模块提供文件访问接口给主机上的应用程序。The host 130 can be a computer or other user device, and the host 130 can communicate with the distributed storage system through a network. Host 130 may include any computing device known in the art, such as a server, desktop computer, etc., with an operating system and other applications installed in host 130, and there may be multiple hosts 130. Host 130 can access files of the distributed storage system. E.g, The host 130 can provide a file access interface to an application on the host through the file interface module.
存储节点120用于存储文件数据,并处理对文件的访问请求。存储节点120可以包括至少一种存储器,例如,可以包括PCM、ReRAM、MRAM等具有按字节寻址及访问的能力的新型NVM。在本发明实施例中,文件存储于NVM存储器中,且存储节点120可以通过内存总线实现对新型NVM的访问。The storage node 120 is configured to store file data and process access requests to the file. Storage node 120 may include at least one type of memory, for example, a new type of NVM having the ability to address and access in bytes, such as PCM, ReRAM, MRAM, and the like. In the embodiment of the present invention, the file is stored in the NVM memory, and the storage node 120 can implement access to the new NVM through the memory bus.
管理节点110用于管理文件的元数据,处理主机对文件的元数据查询、更新请求等。文件的元数据可以包括文件的起始地址,分配的空间大小,文件实际大小等信息。管理节点110还可以用于管理分布式存储系统的全局虚拟地址空间。The management node 110 is configured to manage metadata of the file, process metadata query, update request, and the like of the host to the file. The metadata of the file may include information such as the starting address of the file, the size of the allocated space, and the actual size of the file. The management node 110 can also be used to manage the global virtual address space of the distributed storage system.
管理节点110和存储节点120也可以合在一起,也就是说,一个节点可以同时具有管理节点和存储节点的功能。The management node 110 and the storage node 120 may also be combined, that is, one node may have the functions of both the management node and the storage node.
在本发明实施例中,管理节点可以独立设置(例如图1中的元数据管理节点110),也可以为同时具有元数据管理节点和存储节点的功能的节点。为了描述方便,以下以管理节点110为例进行说明。In the embodiment of the present invention, the management node may be independently set (for example, the metadata management node 110 in FIG. 1), or may be a node having the functions of the metadata management node and the storage node at the same time. For convenience of description, the management node 110 will be described below as an example.
网络140的物理层、链路层可以基于以太网,PCIE交换网络,InfiniBand网络以及光网络等。网络140用于对访问请求、访问响应进行路由,具体地,路由可以由网络设备(如路由器或交换机)执行。为了描述方便,以下以网络设备为例进行说明。The physical layer and link layer of the network 140 may be based on Ethernet, a PCIE switching network, an InfiniBand network, and an optical network. The network 140 is used to route access requests and access responses. Specifically, the routes may be performed by a network device such as a router or a switch. For convenience of description, the following describes a network device as an example.
图2示出了根据本发明实施例的访问文件的方法200的示意性流程图。FIG. 2 shows a schematic flow diagram of a method 200 of accessing a file in accordance with an embodiment of the present invention.
该方法200应用于分布式存储系统中,该分布式存储系统包括管理节点、多个存储节点和网络设备。该分布式存储系统中每一个存储节点的本地虚拟地址空间对应该分布式存储系统的全局虚拟地址空间的一部分。The method 200 is applied to a distributed storage system including a management node, a plurality of storage nodes, and a network device. The local virtual address space of each storage node in the distributed storage system corresponds to a portion of the global virtual address space of the distributed storage system.
S210,第一存储节点接收该网络设备转发的主机的访问请求,该访问请求用于访问目标文件的第一虚拟空间,该第一虚拟空间为该管理节点在该全局虚拟地址空间中为该目标文件分配的空间,该访问请求的目的地址为该第一虚拟空间的全局虚拟地址,该第一存储节点为该多个存储节点中用于存储该目标文件的存储节点。S210, the first storage node receives an access request of the host forwarded by the network device, where the access request is used to access a first virtual space of the target file, where the first virtual space is the management node in the global virtual address space. a space allocated by the file, the destination address of the access request is a global virtual address of the first virtual space, and the first storage node is a storage node of the plurality of storage nodes for storing the target file.
分布式存储系统的全局虚拟地址空间是为在该分布式存储系统中管理文件而虚拟出来的空间。该分布式存储系统中不同存储节点的本地虚拟地址空间对应该分布式存储系统的全局虚拟地址空间的不同部分。例如,全局虚 拟地址空间的第一部分空间映射到所述分布式存储系统中的第一存储节点的本地虚拟地址空间,全局虚拟地址空间的第二部分空间映射到所述分布式存储系统中的第二存储节点的本地虚拟地址空间,其中第一部分空间与第二部分空间不同。在本发明实施例中,管理节点可以从分布式存储系统的全局虚拟地址空间中分配一段连续的空间(表示为第一虚拟空间)给目标文件。由于分布式存储系统中每一个存储节点的本地虚拟地址空间对应分布式存储系统的全局虚拟地址空间的一部分,因此该第一虚拟空间可以映射到存储节点的本地虚拟地址空间。The global virtual address space of a distributed storage system is the space that is virtualized for managing files in the distributed storage system. The local virtual address space of the different storage nodes in the distributed storage system corresponds to different portions of the global virtual address space of the distributed storage system. For example, global virtual Mapping a first portion of the virtual address space to a local virtual address space of the first storage node in the distributed storage system, and mapping a second portion of the global virtual address space to a second storage node in the distributed storage system The local virtual address space, wherein the first part of the space is different from the second part of the space. In the embodiment of the present invention, the management node may allocate a continuous space (represented as the first virtual space) from the global virtual address space of the distributed storage system to the target file. Since the local virtual address space of each storage node in the distributed storage system corresponds to a portion of the global virtual address space of the distributed storage system, the first virtual space can be mapped to the local virtual address space of the storage node.
本地虚拟地址空间可以采用操作系统(Operating System,OS)OS的虚拟地址空间的一段未使用的区间。例如,64位的OS的虚拟地址空间大小是2的64次方,除了用户态虚拟地址空间和内核虚拟地址空间外,还有保留的虚拟地址空间,本地虚拟地址空间可以采用OS保留的虚拟地址空间。也可以根据需要,重新划分操作系统的虚拟地址空间,划分出一段虚拟地址空间用作本地虚拟地址空间。The local virtual address space may use an unused interval of the virtual address space of an operating system (OS) OS. For example, the 64-bit OS has a virtual address space size of 2 to the 64th power. In addition to the user-state virtual address space and the kernel virtual address space, there is also a reserved virtual address space. The local virtual address space can use the virtual address reserved by the OS. space. You can also re-divide the virtual address space of the operating system as needed, and divide a virtual address space into a local virtual address space.
本地虚拟地址空间的地址(即本地虚拟地址)的位数为OS的位数。例如,对于64位的OS,本地虚拟地址的位数为64位。The number of bits in the address of the local virtual address space (ie, the local virtual address) is the number of bits in the OS. For example, for a 64-bit OS, the number of bits in the local virtual address is 64 bits.
全局虚拟地址空间的地址为全局虚拟地址。全局虚拟地址的位数可以大于本地虚拟地址的位数。可选地,全局虚拟地址的位数可以为本地虚拟地址的位数的两倍,也就是说,若本地虚拟地址的位数为N,则全局虚拟地址的位数为2N。例如,对于64位的OS,全局虚拟地址的位数可以为128位。The address of the global virtual address space is the global virtual address. The number of bits in the global virtual address can be greater than the number of bits in the local virtual address. Optionally, the number of bits of the global virtual address may be twice the number of bits of the local virtual address, that is, if the number of bits of the local virtual address is N, the number of bits of the global virtual address is 2N. For example, for a 64-bit OS, the global virtual address can have 128 bits.
通过全局虚拟地址与本地虚拟地址的对应关系可以将分布式存储系统的全局虚拟地址空间与存储节点的本地虚拟地址空间对应。例如,在本地虚拟地址的位数为N,全局虚拟地址的位数为2N的情况下,全局虚拟地址的高N位可以对应节点的设备信息(例如:ID,或者ID和节点类型),全局虚拟地址的低N位可对应节点内的本地虚拟地址,这样可将全局虚拟地址空间与各存储节点的本地虚拟地址空间对应。应理解,可以只用高N位中的一部分位携带存储节点的设备信息(如最高的8位为第一存储节点的ID),剩下的位可以保留或留作他用。The global virtual address space of the distributed storage system can be mapped to the local virtual address space of the storage node by the correspondence between the global virtual address and the local virtual address. For example, in the case where the number of bits of the local virtual address is N and the number of bits of the global virtual address is 2N, the high N bits of the global virtual address may correspond to the device information of the node (eg, ID, or ID and node type), globally. The lower N bits of the virtual address may correspond to a local virtual address within the node, such that the global virtual address space may correspond to the local virtual address space of each storage node. It should be understood that only a portion of the high N bits may carry the device information of the storage node (eg, the highest 8 bits are the ID of the first storage node), and the remaining bits may be reserved or reserved for other purposes.
全局虚拟地址与本地虚拟地址的对应关系可以预先统一建立,也可以在为目标文件分配空间时建立。The correspondence between the global virtual address and the local virtual address may be established in advance, or may be established when space is allocated for the target file.
若采用预先统一建立的方式,则可以在管理节点配置所有存储节点的本 地虚拟地址与全局虚拟地址的对应关系(可以称为总映射表),在每个存储节点配置本存储节点的本地虚拟地址与全局虚拟地址的对应关系(可以称为分映射表),当然,也可以在每个存储节点配置总映射表。在这种方式中,各存储节点的所有可以使用的本地虚拟地址空间的本地虚拟地址都已在全局虚拟地址与本地虚拟地址对应关系中。管理节点为目标文件分配第一虚拟空间时,分配该对应关系中的全局虚拟地址,基于该对应关系,第一虚拟空间自动映射到存储节点的本地虚拟地址空间,并进一步通过本地虚拟地址空间映射到本地物理存储空间。If a pre-uniform way is established, you can configure the locals of all storage nodes on the management node. Corresponding relationship between the local virtual address and the global virtual address (which may be referred to as a total mapping table), and the mapping between the local virtual address of the storage node and the global virtual address (which may be referred to as a sub-mapping table) is configured on each storage node. The total mapping table can also be configured on each storage node. In this manner, the local virtual address of all available local virtual address spaces of each storage node is already in the global virtual address and local virtual address correspondence. When the management node allocates the first virtual space to the target file, the global virtual address in the corresponding relationship is allocated. Based on the correspondence, the first virtual space is automatically mapped to the local virtual address space of the storage node, and further mapped through the local virtual address space. Go to the local physical storage space.
若采用在为目标文件分配空间时建立的方式,管理节点为目标文件分配第一虚拟空间时,分配全局虚拟地址空间中的全局虚拟地址,并向存储节点发送空间分配请求,携带分配的全局虚拟地址;存储节点为目标文件分配本地虚拟地址空间,并将分配的本地虚拟地址空间的本地虚拟地址与空间分配请求中的全局虚拟地址对应,即建立第一虚拟空间的全局虚拟地址与分配的本地虚拟地址空间的本地虚拟地址的对应关系。存储节点还可以将为目标文件分配的本地虚拟地址空间的本地虚拟地址返回给管理节点,管理节点在管理节点上建立第一虚拟空间的全局虚拟地址与本地虚拟地址的对应关系。If the management node allocates the first virtual space to the target file, the global virtual address in the global virtual address space is allocated, and a space allocation request is sent to the storage node, and the allocated global virtual is carried. The storage node allocates a local virtual address space for the target file, and associates the local virtual address of the allocated local virtual address space with the global virtual address in the space allocation request, that is, establishes the global virtual address of the first virtual space and the allocated local address. The correspondence between the local virtual addresses of the virtual address space. The storage node may also return the local virtual address of the local virtual address space allocated for the target file to the management node, and the management node establishes a correspondence between the global virtual address of the first virtual space and the local virtual address on the management node.
主机在访问分布式存储系统中的目标文件时,向网络设备发送访问目标文件的第一虚拟空间的访问请求。该访问请求的目的地址为该第一虚拟空间的全局虚拟地址。网络设备将该访问请求转发给第一存储节点。When the host accesses the target file in the distributed storage system, the host sends an access request to the network device to access the first virtual space of the target file. The destination address of the access request is the global virtual address of the first virtual space. The network device forwards the access request to the first storage node.
可选地,本发明一个实施例中,该目的地址的位数为2N,N为该目的地址对应的该第一存储节点中的本地虚拟地址的位数,该目的地址的高N位包含该第一存储节点的设备信息,该目的地址的低N位为该本地虚拟地址,该访问请求由该网络设备根据该第一存储节点的设备信息转发给该第一存储节点。Optionally, in an embodiment of the present invention, the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address in the first storage node corresponding to the destination address, and the high N bit of the destination address includes the The device information of the first storage node, the lower N bits of the destination address is the local virtual address, and the access request is forwarded by the network device to the first storage node according to the device information of the first storage node.
也就是说,在本实施例中,访问请求的目的地址的位数为2N,访问请求的目的地址的高N位包含第一存储节点的设备信息(例如:ID,或者ID和节点类型),访问请求的目的地址的低N位为第一存储节点中用于存储该目标文件的本地虚拟地址空间的本地虚拟地址。网络设备可根据第一存储节点的设备信息将主机的访问请求转发给第一存储节点。That is, in this embodiment, the number of bits of the destination address of the access request is 2N, and the high N bits of the destination address of the access request include device information (eg, ID, or ID and node type) of the first storage node, The lower N bits of the destination address of the access request are the local virtual addresses in the first storage node for storing the local virtual address space of the target file. The network device may forward the access request of the host to the first storage node according to the device information of the first storage node.
S220,该第一存储节点根据该目的地址与该第一存储节点中的本地虚拟地址的对应关系,确定该访问请求的目的地址对应的本地虚拟地址。 S220. The first storage node determines a local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node.
第一存储节点接收到网络设备发送过来的访问请求后,将访问请求的目的地址转换为第一存储节点中的本地虚拟地址。After receiving the access request sent by the network device, the first storage node converts the destination address of the access request into a local virtual address in the first storage node.
在本发明实施例中,该目的地址与该本地虚拟地址的对应关系可以是对应关系表的形式,即采用对应关系表记录该目的地址对应该本地虚拟地址,在这种情况下,第一存储节点根据该对应关系表确定该目的地址对应的本地虚拟地址;该目的地址与该本地虚拟地址的对应关系也可以是无形的,即预定义该目的地址中的一部分位(例如2N位中的低N位)为该目的地址对应的本地虚拟地址,在这种情况下,第一存储节点直接将该目的地址中的相应的位确定为该目的地址对应的本地虚拟地址。In this embodiment, the correspondence between the destination address and the local virtual address may be in the form of a correspondence table, that is, the correspondence relationship table is used to record the destination address corresponding to the local virtual address, in this case, the first storage. The node determines a local virtual address corresponding to the destination address according to the correspondence relationship table; the correspondence between the destination address and the local virtual address may also be intangible, that is, pre-defining a part of the destination address (for example, a low of 2N bits) The N-bit is the local virtual address corresponding to the destination address. In this case, the first storage node directly determines the corresponding bit in the destination address as the local virtual address corresponding to the destination address.
S230,该第一存储节点根据该本地虚拟地址访问该目标文件。S230. The first storage node accesses the target file according to the local virtual address.
第一存储节点根据S220中得到的本地虚拟地址访问该目标文件。The first storage node accesses the target file according to the local virtual address obtained in S220.
可选地,在本发明一个实施例中,在该访问请求为读请求时,该第一存储节点确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。Optionally, in an embodiment of the present invention, when the access request is a read request, the first storage node determines a local physical space address corresponding to the local virtual address, and reads a local physical medium corresponding to the local physical space address. Data in space.
具体而言,在访问请求为读请求时,第一存储节点查询该本地虚拟地址对应的本地物理空间地址,若不存在对应的本地物理空间地址,则表明访问错误,因此向网络设备发送访问错误的访问响应。若存在对应的本地物理空间地址,则读取该本地物理空间地址对应的本地物理空间中的数据,并将数据携带在访问响应中发送给网络设备。Specifically, when the access request is a read request, the first storage node queries the local physical space address corresponding to the local virtual address, and if there is no corresponding local physical space address, the access error is generated, so an access error is sent to the network device. Access response. If there is a corresponding local physical space address, the data in the local physical space corresponding to the local physical space address is read, and the data is carried in the access response and sent to the network device.
可选地,在本发明另一个实施例中,在该访问请求为写请求时,在一种情形下,若该第一存储节点确定存在与该本地虚拟地址对应的本地物理空间地址,则将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中。在另一种情形下,若该第一存储节点确定不存在与该本地虚拟地址对应的本地物理空间地址,则所述第一存储节点为所述目标文件分配该本地物理空间,并将该写请求中的数据写到分配的本地物理空间中。Optionally, in another embodiment of the present invention, when the access request is a write request, in a scenario, if the first storage node determines that there is a local physical space address corresponding to the local virtual address, The data in the write request is written to the local physical space corresponding to the local physical space address. In another case, if the first storage node determines that there is no local physical space address corresponding to the local virtual address, the first storage node allocates the local physical space for the target file, and writes the local physical space. The data in the request is written to the allocated local physical space.
具体而言,在访问请求为写请求时,第一存储节点查询该本地虚拟地址对应的本地物理空间地址,若不存在对应的本地物理空间地址,即并未给该目标文件分配本地物理空间,则为该目标文件分配本地物理空间,然后将写请求中的数据写到分配的本地物理空间中,并向网络设备发送访问成功的访问响应;若存在对应的本地物理空间地址,则将写请求中的数据写到该本地物理空间地址对应的本地物理空间中,并向网络设备发送访问成功的访问响 应。Specifically, when the access request is a write request, the first storage node queries the local physical space address corresponding to the local virtual address, and if the corresponding local physical space address does not exist, the local physical space is not allocated to the target file. Allocating a local physical space for the target file, then writing the data in the write request to the allocated local physical space, and sending a successful access response to the network device; if there is a corresponding local physical space address, the request is written The data in the local data space is written in the local physical space corresponding to the local physical space address, and the access to the network device is successfully sent. should.
本发明实施例的访问文件的方法,通过接收目的地址为全局虚拟地址的访问请求,根据与该目的地址对应的本地虚拟地址访问分布式存储系统中的文件,可以使主机能够直接访问分布式存储系统中的文件,从而能够提高文件访问的效率。The method for accessing a file in the embodiment of the present invention, by receiving an access request whose destination address is a global virtual address, accessing a file in the distributed storage system according to a local virtual address corresponding to the destination address, enables the host to directly access the distributed storage. Files in the system, which can improve the efficiency of file access.
在本发明实施例中,可选地,在该第一存储节点接收该网络设备转发的主机的访问请求之前,该方法200还包括:In the embodiment of the present invention, optionally, before the first storage node receives the access request of the host forwarded by the network device, the method 200 further includes:
该第一存储节点接收该管理节点发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space allocation request sent by the management node, where the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries a global virtual address of the first virtual space;
该第一存储节点根据该空间分配请求,为该目标文件分配该本地虚拟地址空间;The first storage node allocates the local virtual address space to the target file according to the space allocation request;
该第一存储节点建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。The first storage node establishes a correspondence between the destination address and a local virtual address of the local virtual address space.
可选地,空间分配请求可以携带目标文件的第一虚拟空间的起始全局虚拟地址和大小。第一存储节点在接收到该空间分配请求时,可先判断本地虚拟地址空间是否满足大小要求,若不满足,则返回错误响应;若满足,则为目标文件分配本地虚拟地址空间,并建立相应的对应关系,返回成功响应。Optionally, the space allocation request may carry a starting global virtual address and size of the first virtual space of the target file. When receiving the space allocation request, the first storage node may first determine whether the local virtual address space satisfies the size requirement, and if not, return an error response; if yes, allocate a local virtual address space for the target file, and establish a corresponding The corresponding relationship returns a successful response.
在本发明实施例中,可选地,该方法200还包括:In the embodiment of the present invention, optionally, the method 200 further includes:
该第一存储节点接收该管理节点发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space reclaiming message sent by the management node, where the space reclaiming message is used to reclaim the local virtual address space, where the space reclaiming message carries a global virtual address of the first virtual space;
该第一存储节点根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间;The first storage node deletes the correspondence between the destination address and the local virtual address according to the space collection message, and recovers the local virtual address space;
该第一存储节点回收该本地虚拟地址空间对应的本地物理空间。The first storage node reclaims the local physical space corresponding to the local virtual address space.
在回收目标文件空间时,管理节点向第一存储节点发送空间回收消息。空间回收消息可携带第一虚拟空间的全局虚拟地址。第一存储节点可先判断是否存在该全局虚拟地址对应的本地虚拟地址,若不存在,则返回错误响应;若存在,则删除该全局虚拟地址与该本地虚拟地址的对应关系,回收该第一虚拟空间对应的本地虚拟地址空间,并回收该本地虚拟地址空间对应的本地物理空间,并返回成功响应。 When the target file space is reclaimed, the management node sends a space reclamation message to the first storage node. The space reclamation message may carry the global virtual address of the first virtual space. The first storage node may first determine whether there is a local virtual address corresponding to the global virtual address, and if not, return an error response; if yes, delete the correspondence between the global virtual address and the local virtual address, and recycle the first The local virtual address space corresponding to the virtual space, and the local physical space corresponding to the local virtual address space is recovered, and a successful response is returned.
应理解,本发明实施例中的具体的例子只是为了帮助本领域技术人员更好地理解本发明实施例,而非限制本发明实施例的范围。It is to be understood that the specific embodiments of the present invention are not intended to limit the scope of the embodiments of the invention.
还应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should also be understood that in various embodiments of the present invention, the size of the sequence numbers of the above processes does not imply a sequence of executions, and the order of execution of the processes should be determined by its function and internal logic, and should not be implemented by the present invention. The implementation of the examples constitutes any limitation.
上文中详细描述了根据本发明实施例的访问文件的方法,下面将描述根据本发明实施例的分布式存储系统和存储节点。A method of accessing a file according to an embodiment of the present invention is described in detail above, and a distributed storage system and a storage node according to an embodiment of the present invention will be described below.
图3示出了根据本发明实施例的分布式存储系统300的示意性框图。如图3所示,分布式存储系统300包括:管理节点310、多个存储节点320和网络设备330。FIG. 3 shows a schematic block diagram of a distributed storage system 300 in accordance with an embodiment of the present invention. As shown in FIG. 3, the distributed storage system 300 includes a management node 310, a plurality of storage nodes 320, and a network device 330.
该多个存储节点320中的每一个存储节点320的本地虚拟地址空间对应该分布式存储系统300的全局虚拟地址空间的一部分。The local virtual address space of each of the plurality of storage nodes 320 corresponds to a portion of the global virtual address space of the distributed storage system 300.
该管理节点310用于在该全局虚拟地址空间中为目标文件分配第一虚拟空间。The management node 310 is configured to allocate a first virtual space for the target file in the global virtual address space.
该网络设备330用于向第一存储节点转发主机的访问请求,该访问请求用于访问该第一虚拟空间,该访问请求的目的地址为该第一虚拟空间的全局虚拟地址,该第一存储节点为该多个存储节点320中用于存储该目标文件的存储节点;The network device 330 is configured to forward an access request of the host to the first storage node, where the access request is used to access the first virtual space, and the destination address of the access request is a global virtual address of the first virtual space, the first storage The node is a storage node of the plurality of storage nodes 320 for storing the target file;
该第一存储节点用于接收该网络设备330转发该访问请求,根据该目的地址与该第一存储节点中的本地虚拟地址的对应关系,确定该访问请求的目的地址对应的该本地虚拟地址,根据该本地虚拟地址访问该目标文件。The first storage node is configured to receive the access request by the network device 330, and determine the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node. The target file is accessed according to the local virtual address.
本发明实施例的分布式存储系统,通过接收目的地址为全局虚拟地址的访问请求,根据与该目的地址对应的本地虚拟地址访问分布式存储系统中的文件,可以使主机能够直接访问分布式存储系统中的文件,从而能够提高文件访问的效率。The distributed storage system of the embodiment of the present invention can directly access the distributed storage by accessing the file in the distributed storage system according to the local virtual address corresponding to the destination address by receiving the access request with the destination address being the global virtual address. Files in the system, which can improve the efficiency of file access.
在本发明实施例中,可选地,该目的地址的位数为2N,N为该本地虚拟地址的位数,该目的地址的高N位包含该第一存储节点的设备信息,该目的地址的低N位为该本地虚拟地址;In the embodiment of the present invention, optionally, the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address, and the high N bits of the destination address include device information of the first storage node, and the destination address The lower N bits are the local virtual address;
该网络设备330具体用于根据该第一存储节点的设备信息向该第一存储节点转发该访问请求。The network device 330 is specifically configured to forward the access request to the first storage node according to the device information of the first storage node.
在本发明实施例中,可选地,在该访问请求为写请求时,一种情形下, 若该第一存储节点确定存在与该本地虚拟地址对应的本地物理空间地址,则将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中。在另一种情形下,若该第一存储节点确定不存在与该本地虚拟地址对应的本地物理空间地址,则为所述目标文件分配该本地物理空间,将该写请求中的数据写到分配的本地物理空间中。In the embodiment of the present invention, optionally, when the access request is a write request, in one case, If the first storage node determines that there is a local physical space address corresponding to the local virtual address, the data in the write request is written into the local physical space corresponding to the local physical space address. In another case, if the first storage node determines that there is no local physical space address corresponding to the local virtual address, the local physical space is allocated to the target file, and the data in the write request is written to the allocation. In the local physical space.
在本发明实施例中,可选地,在该访问请求为读请求时,该第一存储节点具体用于确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。In the embodiment of the present invention, optionally, when the access request is a read request, the first storage node is specifically configured to determine a local physical space address corresponding to the local virtual address, and read the local physical space address. Data in the local physical space.
在本发明实施例中,可选地,该第一存储节点还用于接收该管理节点310发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;In the embodiment of the present invention, the first storage node is further configured to receive a space allocation request sent by the management node 310, where the space allocation request is used to allocate a local virtual address space to the target file, where the space allocation request is Carrying a global virtual address of the first virtual space;
根据该空间分配请求,为该目标文件分配该本地虚拟地址空间;Allocating the local virtual address space to the target file according to the space allocation request;
建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。Establish a correspondence between the destination address and a local virtual address of the local virtual address space.
在本发明实施例中,可选地,该第一存储节点还用于接收该管理节点310发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;In the embodiment of the present invention, the first storage node is further configured to receive a space collection message sent by the management node 310, where the space collection message is used to recover the local virtual address space, where the space recovery message carries the first a global virtual address of a virtual space;
根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间;Deleting the correspondence between the destination address and the local virtual address according to the space collection message, and recovering the local virtual address space;
回收该本地虚拟地址空间对应的本地物理空间。Reclaims the local physical space corresponding to the local virtual address space.
根据本发明实施例的分布式存储系统300可对应于前述方法实施例中的分布式存储系统,并且第一存储节点可执行前述各个方法的相应流程,为了简洁,在此不再赘述。The distributed storage system 300 according to the embodiment of the present invention may correspond to the distributed storage system in the foregoing method embodiments, and the first storage node may perform the corresponding processes of the foregoing various methods. For brevity, no further details are provided herein.
图4示出了根据本发明实施例的存储节点400的示意性框图。如图4所示,该存储节点400包括:FIG. 4 shows a schematic block diagram of a storage node 400 in accordance with an embodiment of the present invention. As shown in FIG. 4, the storage node 400 includes:
接收模块410,用于接收分布式存储系统中的网络设备转发的主机的访问请求,该访问请求用于访问目标文件的第一虚拟空间,该第一虚拟空间为该分布式存储系统中的管理节点在该分布式存储系统的全局虚拟地址空间中为该目标文件分配的空间,该分布式存储系统中每一个存储节点的本地虚拟地址空间对应该全局虚拟地址空间的一部分,该访问请求的目的地址为该第一虚拟空间的全局虚拟地址;The receiving module 410 is configured to receive an access request of a host forwarded by a network device in the distributed storage system, where the access request is used to access a first virtual space of the target file, where the first virtual space is a management in the distributed storage system. The space allocated by the node in the global virtual address space of the distributed storage system for the target file, where the local virtual address space of each storage node in the distributed storage system corresponds to a part of the global virtual address space, and the purpose of the access request The address is a global virtual address of the first virtual space;
处理模块420,用于根据该目的地址与该存储节点中的本地虚拟地址的 对应关系,确定该访问请求的目的地址对应的该本地虚拟地址,根据该本地虚拟地址访问该目标文件。The processing module 420 is configured to: according to the destination address and a local virtual address in the storage node Corresponding relationship, determining the local virtual address corresponding to the destination address of the access request, and accessing the target file according to the local virtual address.
本发明实施例的存储节点,通过接收目的地址为全局虚拟地址的访问请求,根据与该目的地址对应的本地虚拟地址访问分布式存储系统中的文件,可以使主机能够直接访问分布式存储系统中的文件,从而能够提高文件访问的效率。The storage node of the embodiment of the present invention can access the distributed storage system by directly accessing the file in the distributed storage system according to the local virtual address corresponding to the destination address by receiving the access request with the destination address being the global virtual address. Files, which can improve the efficiency of file access.
在本发明实施例中,可选地,该目的地址的位数为2N,N为该本地虚拟地址的位数,该目的地址的高N位包含该存储节点的设备信息,该目的地址的低N位为该本地虚拟地址,该访问请求由该网络设备根据该存储节点的设备信息转发给该存储节点。In the embodiment of the present invention, optionally, the number of bits of the destination address is 2N, where N is the number of bits of the local virtual address, and the high N bits of the destination address include device information of the storage node, and the destination address is low. The N bit is the local virtual address, and the access request is forwarded by the network device to the storage node according to the device information of the storage node.
在本发明实施例中,可选地,在该访问请求为写请求时,该处理模块420具体用于确定存在与该本地虚拟地址对应的本地物理空间地址,将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中;或者,In the embodiment of the present invention, optionally, when the access request is a write request, the processing module 420 is specifically configured to determine that a local physical space address corresponding to the local virtual address exists, and write the data in the write request to The local physical space address corresponds to the local physical space; or,
确定不存在与该本地虚拟地址对应的本地物理空间地址,分配该本地物理空间地址,将该写请求中的数据写到该本地物理空间地址对应的本地物理空间中。Determining that there is no local physical space address corresponding to the local virtual address, allocating the local physical space address, and writing the data in the write request to the local physical space corresponding to the local physical space address.
在本发明实施例中,可选地,在该访问请求为读请求时,该处理模块420具体用于确定与该本地虚拟地址对应的本地物理空间地址,读取该本地物理空间地址对应的本地物理空间中的数据。In the embodiment of the present invention, when the access request is a read request, the processing module 420 is specifically configured to determine a local physical space address corresponding to the local virtual address, and read the local corresponding to the local physical space address. Data in physical space.
在本发明实施例中,可选地,该接收模块410还用于接收该管理节点发送的空间分配请求,该空间分配请求用于为该目标文件分配本地虚拟地址空间,该空间分配请求携带该第一虚拟空间的全局虚拟地址;In the embodiment of the present invention, the receiving module 410 is further configured to receive a space allocation request sent by the management node, where the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries the The global virtual address of the first virtual space;
该处理模块420还用于根据该空间分配请求,为该目标文件分配该本地虚拟地址空间,建立该目的地址与该本地虚拟地址空间的本地虚拟地址的对应关系。The processing module 420 is further configured to allocate the local virtual address space to the target file according to the space allocation request, and establish a correspondence between the destination address and a local virtual address of the local virtual address space.
在本发明实施例中,可选地,该接收模块410还用于接收该管理节点发送的空间回收消息,该空间回收消息用于回收该本地虚拟地址空间,该空间回收消息携带该第一虚拟空间的全局虚拟地址;In the embodiment of the present invention, the receiving module 410 is further configured to receive a space collection message sent by the management node, where the space recovery message is used to recover the local virtual address space, where the space recovery message carries the first virtual The global virtual address of the space;
该处理模块420还用于根据该空间回收消息,删除该目的地址与该本地虚拟地址的对应关系,回收该本地虚拟地址空间,回收该本地虚拟地址空间对应的本地物理空间。 The processing module 420 is further configured to delete the correspondence between the destination address and the local virtual address according to the space collection message, recover the local virtual address space, and recover the local physical space corresponding to the local virtual address space.
根据本发明实施例的存储节点400可对应根据本发明实施例的访问文件的方法200中的第一存储节点,并且存储节点400中的各个模块的上述和其它操作和/或功能分别为了实现前述各个方法的相应流程,为了简洁,在此不再赘述。The storage node 400 according to an embodiment of the present invention may correspond to a first storage node in the method 200 of accessing a file according to an embodiment of the present invention, and the above and other operations and/or functions of the respective modules in the storage node 400 are respectively The corresponding processes of the various methods are not described here for brevity.
图5示出了本发明的又一实施例提供的存储节点的结构,包括至少一个处理器502(例如CPU),至少一个网络接口505或者其他通信接口,存储器506,和至少一个通信总线503。其中:FIG. 5 illustrates a structure of a storage node provided by still another embodiment of the present invention, including at least one processor 502 (eg, a CPU), at least one network interface 505 or other communication interface, memory 506, and at least one communication bus 503. among them:
通信总线503用于实现这些装置之间的连接通信。 Communication bus 503 is used to implement connection communication between these devices.
处理器502用于执行存储器506中存储的可执行模块,例如计算机程序。The processor 502 is configured to execute executable modules, such as computer programs, stored in the memory 506.
存储器506可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括NVM,例如至少一个磁盘存储器。The memory 506 may include a high speed random access memory (RAM: Random Access Memory) and may also include an NVM, such as at least one disk storage.
存储节点通过至少一个网络接口505(可以是有线或者无线)实现与网络的通信连接。The storage node implements a communication connection with the network through at least one network interface 505, which may be wired or wireless.
在一些实施方式中,存储器506存储了程序5061,处理器502用于执行程序5061以实现前述方法实施例中的各个方法。In some embodiments, the memory 506 stores a program 5061 that is used to execute the program 5061 to implement the various methods in the foregoing method embodiments.
应理解,在本发明实施例中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that in the embodiment of the present invention, the term "and/or" is merely an association relationship describing an associated object, indicating that there may be three relationships. For example, A and/or B may indicate that A exists separately, and A and B exist simultaneously, and B cases exist alone. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, for clarity of hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示 意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative For example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be Ignore, or not execute. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, or an electrical, mechanical or other form of connection.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此。 The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. . The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto.

Claims (18)

  1. 一种访问文件的方法,其特征在于,所述方法应用于分布式存储系统中,所述分布式存储系统包括管理节点、多个存储节点和网络设备,所述分布式存储系统中每一个存储节点的本地虚拟地址空间对应所述分布式存储系统的全局虚拟地址空间的一部分,所述方法包括:A method for accessing a file, the method being applied to a distributed storage system, the distributed storage system comprising a management node, a plurality of storage nodes, and a network device, each of the storage devices in the distributed storage system The local virtual address space of the node corresponds to a part of the global virtual address space of the distributed storage system, and the method includes:
    第一存储节点接收所述网络设备转发的主机的访问请求,所述访问请求用于访问目标文件的第一虚拟空间,所述第一虚拟空间为所述管理节点在所述全局虚拟地址空间中为所述目标文件分配的空间,所述访问请求的目的地址为所述第一虚拟空间的全局虚拟地址,所述第一存储节点为所述多个存储节点中用于存储所述目标文件的存储节点;Receiving, by the first storage node, an access request of the host forwarded by the network device, where the access request is used to access a first virtual space of the target file, where the first virtual space is the management node in the global virtual address space a space allocated for the target file, a destination address of the access request is a global virtual address of the first virtual space, and the first storage node is used to store the target file in the plurality of storage nodes Storage node
    所述第一存储节点根据所述目的地址与所述第一存储节点中的本地虚拟地址的对应关系,确定所述访问请求的目的地址对应的所述本地虚拟地址;Determining, by the first storage node, the local virtual address corresponding to the destination address of the access request according to the correspondence between the destination address and the local virtual address in the first storage node;
    所述第一存储节点根据所述本地虚拟地址访问所述目标文件。The first storage node accesses the target file according to the local virtual address.
  2. 根据权利要求1所述的方法,其特征在于,所述目的地址的位数为2N位,其中,N为所述本地虚拟地址的位数,所述目的地址的高N位包含所述第一存储节点的设备信息,所述目的地址的低N位为所述本地虚拟地址,所述访问请求由所述网络设备根据所述第一存储节点的设备信息转发给所述第一存储节点。The method according to claim 1, wherein the number of bits of the destination address is 2N bits, wherein N is a number of bits of the local virtual address, and a high N bit of the destination address includes the first The device information of the storage node, where the lower N bits of the destination address are the local virtual address, and the access request is forwarded by the network device to the first storage node according to the device information of the first storage node.
  3. 根据权利要求1或2所述的方法,其特征在于,在所述访问请求为写请求时,所述第一存储节点根据所述本地虚拟地址访问所述目标文件,包括:The method according to claim 1 or 2, wherein, when the access request is a write request, the first storage node accesses the target file according to the local virtual address, including:
    若所述第一存储节点确定存在与所述本地虚拟地址对应的本地物理空间地址,则所述第一存储节点将所述写请求中的数据写到所述本地物理空间地址对应的本地物理空间中;或者,If the first storage node determines that there is a local physical space address corresponding to the local virtual address, the first storage node writes data in the write request to a local physical space corresponding to the local physical space address Medium; or,
    若所述第一存储节点确定不存在与所述本地虚拟地址对应的本地物理空间地址,则所述第一存储节点为所述目标文件分配本地物理空间,将所述写请求中的数据写到分配的本地物理空间中。If the first storage node determines that there is no local physical space address corresponding to the local virtual address, the first storage node allocates a local physical space for the target file, and writes data in the write request to Allocated in the local physical space.
  4. 根据权利要求1或2所述的方法,其特征在于,在所述访问请求为读请求时,所述第一存储节点根据所述本地虚拟地址访问所述目标文件,包括: The method according to claim 1 or 2, wherein, when the access request is a read request, the first storage node accesses the target file according to the local virtual address, including:
    所述第一存储节点确定与所述本地虚拟地址对应的本地物理空间地址,读取所述本地物理空间地址对应的本地物理空间中的数据。The first storage node determines a local physical space address corresponding to the local virtual address, and reads data in a local physical space corresponding to the local physical space address.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,在所述第一存储节点接收所述网络设备转发的主机的访问请求之前,所述方法还包括:The method according to any one of claims 1 to 4, wherein before the first storage node receives an access request of the host forwarded by the network device, the method further includes:
    所述第一存储节点接收所述管理节点发送的空间分配请求,所述空间分配请求用于为所述目标文件分配本地虚拟地址空间,所述空间分配请求携带所述第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space allocation request sent by the management node, where the space allocation request is used to allocate a local virtual address space for the target file, where the space allocation request carries a global virtual space of the first virtual space address;
    所述第一存储节点根据所述空间分配请求,为所述目标文件分配所述本地虚拟地址空间;The first storage node allocates the local virtual address space to the target file according to the space allocation request;
    所述第一存储节点建立所述目的地址与所述本地虚拟地址空间的本地虚拟地址的对应关系。The first storage node establishes a correspondence between the destination address and a local virtual address of the local virtual address space.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, wherein the method further comprises:
    所述第一存储节点接收所述管理节点发送的空间回收消息,所述空间回收消息用于回收所述本地虚拟地址空间,所述空间回收消息携带所述第一虚拟空间的全局虚拟地址;Receiving, by the first storage node, a space reclaiming message sent by the management node, where the space reclaiming message is used to reclaim the local virtual address space, where the space reclaiming message carries a global virtual address of the first virtual space;
    所述第一存储节点根据所述空间回收消息,删除所述目的地址与所述本地虚拟地址的对应关系,回收所述本地虚拟地址空间;The first storage node deletes the correspondence between the destination address and the local virtual address according to the space collection message, and recovers the local virtual address space;
    所述第一存储节点回收所述本地虚拟地址空间对应的本地物理空间。The first storage node reclaims a local physical space corresponding to the local virtual address space.
  7. 一种分布式存储系统,其特征在于,包括:管理节点、多个存储节点和网络设备;A distributed storage system, comprising: a management node, a plurality of storage nodes, and a network device;
    所述多个存储节点中的每一个存储节点的本地虚拟地址空间对应所述分布式存储系统的全局虚拟地址空间的一部分;A local virtual address space of each of the plurality of storage nodes corresponds to a portion of a global virtual address space of the distributed storage system;
    所述管理节点用于在所述全局虚拟地址空间中为目标文件分配第一虚拟空间;The management node is configured to allocate a first virtual space to the target file in the global virtual address space;
    所述网络设备用于向第一存储节点转发主机的访问请求,所述访问请求用于访问所述第一虚拟空间,所述访问请求的目的地址为所述第一虚拟空间的全局虚拟地址,所述第一存储节点为所述多个存储节点中用于存储所述目标文件的存储节点;The network device is configured to forward an access request of the host to the first storage node, where the access request is used to access the first virtual space, and the destination address of the access request is a global virtual address of the first virtual space. The first storage node is a storage node of the plurality of storage nodes for storing the target file;
    所述第一存储节点用于接收所述网络设备转发所述访问请求,根据所述目的地址与所述第一存储节点中的本地虚拟地址的对应关系,确定所述访问 请求的目的地址对应的所述本地虚拟地址,根据所述本地虚拟地址访问所述目标文件。The first storage node is configured to receive, by the network device, the access request, and determine the access according to a correspondence between the destination address and a local virtual address in the first storage node. The local virtual address corresponding to the requested destination address, and accessing the target file according to the local virtual address.
  8. 根据权利要求7所述的分布式存储系统,其特征在于,所述目的地址的位数为2N位,N为所述本地虚拟地址的位数,所述目的地址的高N位包含所述第一存储节点的设备信息,所述目的地址的低N位为所述本地虚拟地址;The distributed storage system according to claim 7, wherein the number of bits of the destination address is 2N bits, N is a number of bits of the local virtual address, and a high N bit of the destination address includes the number Device information of a storage node, where a lower N bits of the destination address is the local virtual address;
    所述网络设备具体用于根据所述第一存储节点的设备信息向所述第一存储节点转发所述访问请求。The network device is specifically configured to forward the access request to the first storage node according to the device information of the first storage node.
  9. 根据权利要求7或8所述的分布式存储系统,其特征在于:在所述访问请求为写请求时,所述第一存储节点具体用于:The distributed storage system according to claim 7 or 8, wherein when the access request is a write request, the first storage node is specifically configured to:
    若确定存在与所述本地虚拟地址对应的本地物理空间地址,则将所述写请求中的数据写到所述本地物理空间地址对应的本地物理空间中;或者,If it is determined that the local physical space address corresponding to the local virtual address exists, the data in the write request is written to the local physical space corresponding to the local physical space address; or
    若确定不存在与所述本地虚拟地址对应的本地物理空间地址,则为所述目标文件分配本地物理空间,将所述写请求中的数据写到分配的本地物理空间中。If it is determined that there is no local physical space address corresponding to the local virtual address, the local physical space is allocated to the target file, and the data in the write request is written into the allocated local physical space.
  10. 根据权利要求7或8所述的分布式存储系统,其特征在于,在所述访问请求为读请求时,所述第一存储节点具体用于确定与所述本地虚拟地址对应的本地物理空间地址,读取所述本地物理空间地址对应的本地物理空间中的数据。The distributed storage system according to claim 7 or 8, wherein the first storage node is specifically configured to determine a local physical space address corresponding to the local virtual address when the access request is a read request. Reading data in the local physical space corresponding to the local physical space address.
  11. 根据权利要求7至10中任一项所述的分布式存储系统,其特征在于,所述第一存储节点还用于接收所述管理节点发送的空间分配请求,所述空间分配请求用于为所述目标文件分配本地虚拟地址空间,所述空间分配请求携带所述第一虚拟空间的全局虚拟地址;The distributed storage system according to any one of claims 7 to 10, wherein the first storage node is further configured to receive a space allocation request sent by the management node, where the space allocation request is used for The target file allocates a local virtual address space, and the space allocation request carries a global virtual address of the first virtual space;
    根据所述空间分配请求,为所述目标文件分配所述本地虚拟地址空间;Allocating the local virtual address space to the target file according to the space allocation request;
    建立所述目的地址与所述本地虚拟地址空间的本地虚拟地址的对应关系。Establishing a correspondence between the destination address and a local virtual address of the local virtual address space.
  12. 根据权利要求11所述的分布式存储系统,其特征在于,所述第一存储节点还用于接收所述管理节点发送的空间回收消息,所述空间回收消息用于回收所述本地虚拟地址空间,所述空间回收消息携带所述第一虚拟空间的全局虚拟地址;The distributed storage system according to claim 11, wherein the first storage node is further configured to receive a space reclamation message sent by the management node, where the space reclamation message is used to recover the local virtual address space. The space reclamation message carries a global virtual address of the first virtual space;
    根据所述空间回收消息,删除所述目的地址与所述本地虚拟地址的对应 关系,回收所述本地虚拟地址空间;Deleting the correspondence between the destination address and the local virtual address according to the space collection message Relationship, recycling the local virtual address space;
    回收所述本地虚拟地址空间对应的本地物理空间。Reclaiming the local physical space corresponding to the local virtual address space.
  13. 一种存储节点,其特征在于,包括:A storage node, comprising:
    接收模块,用于接收分布式存储系统中的网络设备转发的主机的访问请求,所述访问请求用于访问目标文件的第一虚拟空间,所述第一虚拟空间为所述分布式存储系统中的管理节点在所述分布式存储系统的全局虚拟地址空间中为所述目标文件分配的空间,所述分布式存储系统中每一个存储节点的本地虚拟地址空间对应所述全局虚拟地址空间的一部分,所述访问请求的目的地址为所述第一虚拟空间的全局虚拟地址;a receiving module, configured to receive an access request of a host forwarded by a network device in the distributed storage system, where the access request is used to access a first virtual space of the target file, where the first virtual space is in the distributed storage system The management node allocates space for the target file in the global virtual address space of the distributed storage system, and the local virtual address space of each storage node in the distributed storage system corresponds to a part of the global virtual address space The destination address of the access request is a global virtual address of the first virtual space;
    处理模块,用于根据所述目的地址与所述存储节点中的本地虚拟地址的对应关系,确定所述访问请求的目的地址对应的所述本地虚拟地址,根据所述本地虚拟地址访问所述目标文件。a processing module, configured to determine, according to the correspondence between the destination address and a local virtual address in the storage node, the local virtual address corresponding to the destination address of the access request, and access the target according to the local virtual address file.
  14. 根据权利要求13所述的存储节点,其特征在于,所述目的地址的位数为2N位,N为所述本地虚拟地址的位数,所述目的地址的高N位包含所述存储节点的设备信息,所述目的地址的低N位为所述本地虚拟地址,所述访问请求由所述网络设备根据所述存储节点的设备信息转发给所述存储节点。The storage node according to claim 13, wherein the number of bits of the destination address is 2N bits, N is the number of bits of the local virtual address, and the upper N bits of the destination address comprise the storage node. Device information, where the lower N bits of the destination address are the local virtual address, and the access request is forwarded by the network device to the storage node according to the device information of the storage node.
  15. 根据权利要求13或14所述的存储节点,其特征在于,在所述访问请求为写请求时,所述处理模块具体用于:The storage node according to claim 13 or 14, wherein when the access request is a write request, the processing module is specifically configured to:
    若确定存在与所述本地虚拟地址对应的本地物理空间地址,则将所述写请求中的数据写到所述本地物理空间地址对应的本地物理空间中;或者,If it is determined that the local physical space address corresponding to the local virtual address exists, the data in the write request is written to the local physical space corresponding to the local physical space address; or
    若确定不存在与所述本地虚拟地址对应的本地物理空间地址,则为所述目标文件分配本地物理空间,并将所述写请求中的数据写到分配的本地物理空间中。If it is determined that there is no local physical space address corresponding to the local virtual address, the local physical space is allocated to the target file, and the data in the write request is written into the allocated local physical space.
  16. 根据权利要求13或14所述的存储节点,其特征在于,在所述访问请求为读请求时,所述处理模块具体用于确定与所述本地虚拟地址对应的本地物理空间地址,读取所述本地物理空间地址对应的本地物理空间中的数据。The storage node according to claim 13 or 14, wherein when the access request is a read request, the processing module is specifically configured to determine a local physical space address corresponding to the local virtual address, and read the location The data in the local physical space corresponding to the local physical space address.
  17. 根据权利要求13至16中任一项所述的存储节点,其特征在于,所述接收模块还用于接收所述管理节点发送的空间分配请求,所述空间分配请求用于为所述目标文件分配本地虚拟地址空间,所述空间分配请求携带所述 第一虚拟空间的全局虚拟地址;The storage node according to any one of claims 13 to 16, wherein the receiving module is further configured to receive a space allocation request sent by the management node, where the space allocation request is used for the target file Allocating a local virtual address space, the space allocation request carrying the The global virtual address of the first virtual space;
    所述处理模块还用于根据所述空间分配请求,为所述目标文件分配所述本地虚拟地址空间,建立所述目的地址与所述本地虚拟地址空间的本地虚拟地址的对应关系。The processing module is further configured to allocate the local virtual address space to the target file according to the space allocation request, and establish a correspondence between the destination address and a local virtual address of the local virtual address space.
  18. 根据权利要求17所述的存储节点,其特征在于,所述接收模块还用于接收所述管理节点发送的空间回收消息,所述空间回收消息用于回收所述本地虚拟地址空间,所述空间回收消息携带所述第一虚拟空间的全局虚拟地址;The storage node according to claim 17, wherein the receiving module is further configured to receive a space reclamation message sent by the management node, where the space reclamation message is used to recover the local virtual address space, the space Retrieving a message carrying a global virtual address of the first virtual space;
    所述处理模块还用于根据所述空间回收消息,删除所述目的地址与所述本地虚拟地址的对应关系,回收所述本地虚拟地址空间,回收所述本地虚拟地址空间对应的本地物理空间。 The processing module is further configured to: delete the corresponding relationship between the destination address and the local virtual address according to the space collection message, reclaim the local virtual address space, and recover the local physical space corresponding to the local virtual address space.
PCT/CN2014/090017 2014-10-31 2014-10-31 Method for accessing files, distributed storage system and storage node WO2016065610A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201480037251.5A CN105765542B (en) 2014-10-31 2014-10-31 Access method, distributed memory system and the memory node of file
PCT/CN2014/090017 WO2016065610A1 (en) 2014-10-31 2014-10-31 Method for accessing files, distributed storage system and storage node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/090017 WO2016065610A1 (en) 2014-10-31 2014-10-31 Method for accessing files, distributed storage system and storage node

Publications (1)

Publication Number Publication Date
WO2016065610A1 true WO2016065610A1 (en) 2016-05-06

Family

ID=55856428

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/090017 WO2016065610A1 (en) 2014-10-31 2014-10-31 Method for accessing files, distributed storage system and storage node

Country Status (2)

Country Link
CN (1) CN105765542B (en)
WO (1) WO2016065610A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776361A (en) * 2017-03-10 2017-05-31 安徽大学 A kind of caching method and system towards extensive non-volatile memory medium
CN110825309A (en) * 2018-08-08 2020-02-21 华为技术有限公司 Data reading method, device and system and distributed system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063061B (en) * 2018-07-20 2022-09-30 北京百度网讯科技有限公司 Cross-distributed system data processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101187930A (en) * 2007-12-04 2008-05-28 浙江大学 Distribution type file system dummy directory and name space implementing method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN102023932A (en) * 2009-09-18 2011-04-20 英特尔公司 Providing hardware support for shared virtual memory between local and remote physical memory
CN102405460A (en) * 2009-02-11 2012-04-04 艾梵尼达有限公司 Virtualized storage system and method of operating it
CN103475732A (en) * 2013-09-25 2013-12-25 浪潮电子信息产业股份有限公司 Distributed file system data volume deployment method based on virtual address pool

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8301717B2 (en) * 2009-06-09 2012-10-30 Deshpande Enterprises, Inc. Extended virtual memory system and method in a computer cluster
US9170950B2 (en) * 2013-01-16 2015-10-27 International Business Machines Corporation Method, apparatus and computer programs providing cluster-wide page management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101187930A (en) * 2007-12-04 2008-05-28 浙江大学 Distribution type file system dummy directory and name space implementing method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN102405460A (en) * 2009-02-11 2012-04-04 艾梵尼达有限公司 Virtualized storage system and method of operating it
CN102023932A (en) * 2009-09-18 2011-04-20 英特尔公司 Providing hardware support for shared virtual memory between local and remote physical memory
CN103475732A (en) * 2013-09-25 2013-12-25 浪潮电子信息产业股份有限公司 Distributed file system data volume deployment method based on virtual address pool

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776361A (en) * 2017-03-10 2017-05-31 安徽大学 A kind of caching method and system towards extensive non-volatile memory medium
CN106776361B (en) * 2017-03-10 2020-07-10 安徽大学 Caching method and system for large-scale nonvolatile storage medium
CN110825309A (en) * 2018-08-08 2020-02-21 华为技术有限公司 Data reading method, device and system and distributed system
CN110825309B (en) * 2018-08-08 2021-06-29 华为技术有限公司 Data reading method, device and system and distributed system
US11455117B2 (en) 2018-08-08 2022-09-27 Huawei Technologies Co., Ltd. Data reading method, apparatus, and system, avoiding version rollback issues in distributed system

Also Published As

Publication number Publication date
CN105765542B (en) 2019-11-15
CN105765542A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
US11656763B2 (en) File management method, distributed storage system, and management node
US9436720B2 (en) Safety for volume operations
CN110235098B (en) Storage system access method and device
US10372336B2 (en) File access method, system, and host
JP2019139759A (en) Solid state drive (ssd), distributed data storage system, and method of the same
CN110199512B (en) Management method and device for storage equipment in storage system
WO2017201984A1 (en) Data processing method, associated apparatus, and data storage system
CN109302448A (en) A kind of data processing method and device
US20190114076A1 (en) Method and Apparatus for Storing Data in Distributed Block Storage System, and Computer Readable Storage Medium
WO2016065610A1 (en) Method for accessing files, distributed storage system and storage node
CN110199270B (en) Management method and device for storage equipment in storage system
US7146484B2 (en) Method and apparatus for caching storage system
CN108804355B (en) Method and system for fast ordering writes using target collaboration
US11947419B2 (en) Storage device with data deduplication, operation method of storage device, and operation method of storage server
WO2017177400A1 (en) Data processing method and system
WO2016065613A1 (en) File access method, distributed storage system and network device
WO2016065612A1 (en) Method, system, and host for accessing files

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14904918

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14904918

Country of ref document: EP

Kind code of ref document: A1