WO2024002349A1 - File management method, server, storage node, file storage system, and client - Google Patents

File management method, server, storage node, file storage system, and client Download PDF

Info

Publication number
WO2024002349A1
WO2024002349A1 PCT/CN2023/104790 CN2023104790W WO2024002349A1 WO 2024002349 A1 WO2024002349 A1 WO 2024002349A1 CN 2023104790 W CN2023104790 W CN 2023104790W WO 2024002349 A1 WO2024002349 A1 WO 2024002349A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage node
file
target
hash
node
Prior art date
Application number
PCT/CN2023/104790
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 中兴通讯股份有限公司
Publication of WO2024002349A1 publication Critical patent/WO2024002349A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of distributed storage technology, and in particular to a file management method, a management server, a storage node, a file storage system, and a client.
  • an embodiment of the present disclosure provides a file management method for a management server of a file storage system.
  • the file storage system includes a management server and a plurality of storage nodes.
  • the method includes: determining a file including a plurality of hashes. The hash band of the value; determine the hash node correspondence according to the hash band and the total capacity of each storage node in the file storage system; the hash node correspondence includes each storage node in the hash Corresponding hash values in the hash band, the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node, and each hash value in the hash band is allocated to each storage node; and Will The hash node correspondence is sent to each storage node.
  • embodiments of the present disclosure provide a file management method for a first storage node of a file storage system.
  • the file storage system includes a management server and a plurality of storage nodes.
  • the method includes: receiving a response to the first storage node.
  • a creation request for a target file determining the first target hash value corresponding to the first target file according to the information of the first target file, and determining the corresponding first target hash value according to the preset hash node correspondence relationship.
  • the first target storage node; the hash node correspondence includes the hash value corresponding to each storage node in the hash band, the hash band includes multiple hash values, and the hash value corresponding to each storage node
  • the number of values is proportional to the total capacity of each storage node, and each hash value in the hash band is assigned to each storage node; the first storage node itself is the first target storage node, Then the first storage node locally stores the first target file; the first storage node itself is different from the first target storage node, then the first storage node locally stores the first target file, and Create a link to the first target file in the first target storage node.
  • embodiments of the present disclosure provide a file management method for a client.
  • the method includes: determining a first target hash value corresponding to the first target file according to the information of the first target file.
  • the preset hash node correspondence determines the first target storage node corresponding to the first target hash value;
  • the first target storage node is a storage node of a file storage system, and the file storage system includes a management server and multiple storage nodes
  • the hash node correspondence includes the hash value corresponding to each storage node in the hash band
  • the hash band includes multiple hash values, and the number of hash values corresponding to each storage node Proportional to the total capacity of each storage node, each hash value in the hash band is assigned to each storage node;
  • the final target storage node is determined according to the first target storage node;
  • the first target storage node The proportion of used capacity in the storage node is negatively correlated with the probability that the first target storage node is determined to be the final target storage no
  • embodiments of the present disclosure provide a management server, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is The processor executes, causing the processor to execute any file management method in the embodiment of the present disclosure.
  • embodiments of the present disclosure provide a storage node, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is The processor executes, causing the processor to execute any file management method in the embodiment of the present disclosure.
  • an embodiment of the present disclosure provides a file storage system, which includes a management server and a plurality of storage nodes; the management server is the management server of the embodiment of the present disclosure; the storage node is the storage node of the embodiment of the present disclosure. .
  • embodiments of the present disclosure provide a client, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
  • Figure 1 is a flow chart of a method for file management of a management server provided by an embodiment of the present disclosure
  • Figure 2 is a flow chart of a method for file management of a storage node provided by an embodiment of the present disclosure
  • Figure 3 is a flow chart of a method for client file management provided by an embodiment of the present disclosure
  • FIG. 4 is a block diagram of a management server provided by an embodiment of the present disclosure.
  • Figure 5 is a block diagram of a storage node provided by an embodiment of the present disclosure.
  • Figure 6 is a block diagram of a file storage system provided by an embodiment of the present disclosure.
  • Figure 7 is a block diagram of a client provided by an embodiment of the present disclosure.
  • Figure 8 is a schematic diagram of hash band allocation in a file management method provided by an embodiment of the present disclosure.
  • Figure 9 is a schematic diagram of the logical process of a storage node accessing a file storage system in a file management method provided by an embodiment of the present disclosure
  • Figure 10 is a schematic structural diagram of a file link in a file management method provided by an embodiment of the present disclosure.
  • Figure 11 shows the creation of files in a file management method provided by an embodiment of the present disclosure. Schematic diagram of the client's logical process
  • Figure 12 is a schematic diagram of the logical process of a storage node when creating a file in a file management method provided by an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of the logical process of reading and writing files in a file management method provided by an embodiment of the present disclosure.
  • plan and/or cross-sectional illustrations are schematic illustrations of the disclosure. Accordingly, example illustrations may be modified based on manufacturing techniques and/or tolerances.
  • the present disclosure is not limited to the embodiments shown in the drawings but includes modifications of configurations formed based on manufacturing processes. Accordingly, the regions illustrated in the figures are of a schematic nature and the shapes of the regions shown in the figures are illustrative of the specific shapes of regions of the element and are not intended to be limiting.
  • Distributed file storage systems of some related technologies include a file distribution server and multiple storage nodes, and file management is performed by the file distribution server. That is, the file distribution server randomly distributes the files that need to be created (written) to each storage node. And the randomness is used to ensure the balance of the capacity of each storage node.
  • inventions of the present disclosure provide a file management method for use in a management server of a file storage system.
  • the file storage system includes a management server and multiple storage nodes.
  • the method of the embodiment of the present disclosure is executed by the management server in the file storage system.
  • the file storage system in the embodiment of the present disclosure includes multiple storage nodes for actually storing files, so it belongs to a "distributed file storage system"; the file storage system also includes a management server with a management function. However, the file storage system Management of files is not entirely performed by the management server.
  • the client (such as a user terminal, or an interface device of the file storage system) can interact with the file storage system, thereby performing file management through the file storage system.
  • FIG. 1 is a flow chart of a method for file management of a management server provided by an embodiment of the disclosure. Referring to FIG. 1 , the method of the embodiment of the disclosure includes the following steps S101 to S303.
  • step S101 a hash strip including a plurality of hash values is determined.
  • the management server calculates a hash band to be used, and the hash band includes a plurality of hash values.
  • step S102 according to the hash band and the data of each storage node in the file storage system, The total capacity determines the hash node correspondence.
  • the hash node correspondence includes the hash value corresponding to each storage node in the hash band.
  • the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node.
  • Each hash value in the hash band A hash value is assigned to each storage node.
  • All hash values of the above hash bands are assigned to each storage node currently in the file storage system.
  • Each hash value is assigned to each storage node, and each storage node corresponds to one or more hashes. value, and the number of hash values corresponding to each storage node is proportional to its total capacity (including used capacity and unused capacity).
  • the hash value is allocated according to the proportion of the total capacity of each storage node to the total capacity of all storage nodes: the proportion (ratio) of the total capacity of each storage node to the total capacity of all storage nodes is equal to each The ratio of the number of hash values corresponding to each storage node to the number of all hash values in the hash band.
  • step S103 the hash node correspondence is sent to each storage node.
  • the total number of hash values in the hash strip is determined based on the maximum number of storage nodes that the file storage system can support.
  • the total number of hash values in the hash strip may be determined based on the maximum number of storage nodes N that the file storage system can support, for example, the length of the hash strip (the number of hash values ) can be 2 N , that is, the hash value is in [0,2 N -1].
  • the total hash band remains unchanged, but the storage node corresponding to the specific hash value may change.
  • the method of the embodiment of the present disclosure also includes: when the storage node changes in the file storage system, determine the updated hash node based on the hash band and the total capacity of each storage node in the file storage system after the change. Correspondence.
  • storage node changes include accessing new storage nodes and/or deleting existing storage nodes.
  • the management server needs to redistribute hash values at this time (but does not need to recalculate the hash band). And send the obtained "new" hash node correspondence to the storage node.
  • inventions of the present disclosure provide a file management method for the first storage node of a file storage system.
  • the file storage system includes a management server and multiple storage nodes.
  • the method of the embodiment of the present disclosure is executed by a storage node in the file storage system.
  • the first storage node is only an example of a storage node that performs the file management method, and does not refer to any sequence. Any storage node in the file storage system can perform the method of the disclosed embodiment, that is, this The methods of the disclosed embodiments are general methods executable by all storage nodes.
  • FIG. 2 is a flow chart of a method for file management of a storage node provided by an embodiment of the present disclosure. Referring to FIG. 2 , the method of the embodiment of the present disclosure includes the following steps S201 to S204.
  • step S201 a creation request for a first target file is received.
  • a certain storage node is selected as the final target storage node (for example, the storage node that actually stores the content of the first target file), and thus a request is received to create (for example, write) a file (for example, the first target file) in the storage node. a target file).
  • first target file, the second target file, and the third target file in the embodiments of the present disclosure do not refer to specific files, but are determined according to the application scenario, that is, the same file may be of different types in different application scenarios. target file.
  • the file when a file is written to the file storage system, the file is the first target file; and after writing, when the file is opened, deleted, etc., the file is the second target file.
  • step S202 the corresponding first target is determined based on the information of the first target file.
  • the hash value determines the first target storage node corresponding to the first target hash value according to the preset hash node correspondence relationship.
  • the storage node can calculate the corresponding first hash value based on part of the information (such as the file name) of the first target file.
  • the first hash value must be located in the above hash band, so the storage node can pre-store the file based on the first hash value in the storage node.
  • the hash node correspondence relationship (for example, sent by the management server) determines the first target storage node corresponding to the first hash value, that is, the storage node where the first target file should theoretically be located.
  • the first target storage node may be the first storage node, that is, the storage node itself that executes the method, or it may be another storage node. Different subsequent operations may be performed depending on the situation.
  • step S203 if the first storage node, that is, the storage node itself that executes the method, is the first target storage node, the first storage node locally stores the first target file.
  • the storage node that executes this method is itself the first target storage node, it means that the first target storage node is also the final target storage node (the storage node that actually stores the content of the first target file), so the first target file can be directly stored locally.
  • step S204 if the first storage node, that is, the storage node itself that executes the method, is different from the first target storage node, the first storage node locally stores the first target file and creates the first target file in the first target storage node. A link to an object file.
  • the storage node that executes this method is not the first target storage node, it means that the first target storage node is different from the final target storage node; therefore, the storage node can store the content of the first target file locally, but it must also store the content of the first target file locally.
  • a link to the first target file is created in the first target storage node, so that the client can find the link to the first target file in the first target storage node and operate the first target file through the first target storage node.
  • the method of the embodiment of the present disclosure further includes: receiving an operation request for the second target file.
  • the operation includes opening the second target file, and/or deleting the second target file.
  • the second target file is stored locally, the second target file is operated according to the operation request.
  • the operation request is responded to based on the link of the second target file.
  • a storage node eg, the first target storage node
  • it may also receive a request to delete, open (read), and other operations on the file (eg, the second target file) stored therein.
  • the file can be directly operated; and if there is no second target file locally on the storage node (that is, the storage node node is not the final target storage node), obtain the link to the second target file, and respond to the above operations based on the link (for example, open the file corresponding to the link, or delete the file corresponding to the link and the link itself).
  • the method of the embodiment of the present disclosure further includes: receiving updated hash node correspondence.
  • the corresponding third target hash value is determined according to the locally stored third target file information, and the third target storage node corresponding to the third target hash value is determined according to the updated hash node correspondence.
  • the third target file is migrated to the third target storage node.
  • each storage node When a storage node changes in the file storage system (for example, a new storage node is connected or a storage node is deleted), each storage node will receive the "new" hash node correspondence assigned by the management server, and the "new" hash node In the node correspondence relationship, the storage nodes corresponding to some hash values may be different from before, so the storage nodes where the files with corresponding hash values should be located may also be different from before.
  • each storage node needs to check the file it stores (for example, the third target file), and according to the storage node (for example, the third target storage node) where the "new" hash node correspondence should be: if the third target storage node If the third target storage node is the storage node itself, no operation is required; if the third target storage node is not the storage node itself, it indicates that the third target storage node is not the storage node itself. The storage location of the file should be changed, so the third target file should be migrated to the new third target storage node.
  • embodiments of the present disclosure provide a file management method for a client.
  • the method of the embodiment of the present disclosure is executed by the client, and the client can interact with the file storage system of the embodiment of the present disclosure, thereby using the file storage system for file management.
  • step S301 the first target hash value corresponding to the first target file is determined according to the information of the first target file, and the first target storage corresponding to the first target hash value is determined according to the preset hash node correspondence relationship. node.
  • the client When the client needs to write a file (first target file) to the file storage system, it calculates the first hash value belonging to the hash band based on the information of the first target file (such as the file name), and obtains the first hash value from the management server.
  • the hash node correspondence relationship determines the first target storage node corresponding to the first hash value, that is, the storage node where the first target file should theoretically be located.
  • step S302 the final target storage node is determined according to the first target storage node.
  • the proportion of used capacity in the first target storage node is negatively correlated with the probability that the first target storage node is determined to be the final target storage node.
  • the final target storage node may be the first target storage node, or it may be another storage node.
  • the probability that the first target storage node is the final target storage node is negatively correlated with the proportion of the used capacity in the first target storage node (that is, the proportion of the used capacity in the first target storage node to its own total capacity).
  • the number of hash values corresponding to a storage node is proportional to its total capacity. Therefore, a storage node with a larger total capacity is more likely to be selected as the first target storage node and write the first target file to achieve balanced capacity allocation.
  • the greater the proportion of used capacity ie, the greater the load
  • step S303 a creation request for the first target file is sent to the final target storage node.
  • determining the final target storage node based on the first target storage node includes generating a random value between 0 and 1.
  • the first target storage node is determined to be the final target storage node.
  • a random value r between 0 and 1 can be calculated first, and then r is compared with the proportion w of the used capacity in the first target storage node. If r is greater than w, then The first target storage node is determined to be the final target storage node, and if r is not greater than w, other storage nodes are selected as the final target storage node.
  • determining storage nodes other than the first target storage node as the final target storage node includes: determining the storage node with the smallest proportion of used capacity other than the first target storage node as the final target storage node.
  • the method of the embodiment of the present disclosure further includes: determining the corresponding second target hash value according to the information of the second target file, and determining the corresponding hash node according to the preset relationship.
  • the second target storage node corresponding to the second target hash value is determined.
  • the operations include opening the second target file, and/or deleting the second target file.
  • the client When the client wants to operate a certain file (such as a second target file) in the file storage system, it can calculate its second target hash value and find the second target storage corresponding to the second target hash value.
  • the node sends a corresponding operation request to the second target storage node, so that the second target storage node performs the above file management method.
  • an embodiment of the present disclosure provides a management server, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
  • an embodiment of the present disclosure provides a storage node, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
  • an embodiment of the present disclosure provides a file storage system, which includes a management server and multiple storage nodes; the management server is the management server of the embodiment of the present disclosure; the storage node is the storage node of the embodiment of the present disclosure. .
  • an embodiment of the present disclosure provides a client, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
  • the processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.
  • the memory is a device with data storage capabilities, It includes but is not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); I/O interface ( The read-write interface) is connected between the processor and the memory, and can realize the information interaction between the memory and the processor, including but not limited to the data bus (Bus), etc.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • FLASH flash memory
  • I/O interface The read-write interface) is connected between the processor and the memory, and can realize the information interaction between the memory and the processor, including but not limited to the data bus (Bus), etc.
  • the file storage system of the embodiment of the present disclosure can be used in a variety of different application scenarios.
  • the detailed process of the file management method in each application scenario is introduced below.
  • the process of a storage node accessing a file storage system may include the following steps.
  • the management server (Management Center, MC) initializes the hash band according to the maximum number of storage nodes N supported by the system.
  • the length of the hash band is 2 N and the interval distribution of the hash band is [0, 2 N -1].
  • the hash band distribution is [0,65535].
  • a storage node When a storage node (Store Node, SN) accesses the file storage system, it first initiates an access request to the MC.
  • the request content includes the total capacity of the storage node totalCap and the used capacity usedCap.
  • MC allocates storage node identifiers SNid based on the number of storage nodes on the network; the SNid distribution is [0, N-1].
  • the SNid of the first storage node is 0, the SNid of the second storage node is 1, and the SNid of the third storage node is 2; after SNid1 is deleted, the newly connected storage node will be allocated the vacant SNid first, that is, in the fourth After a storage node is connected, the SNid is 2.
  • MC sends the allocated storage node ID SNid to the storage node, and the storage node saves its own SNid.
  • MC also analyzes the total capacity totalCap and used capacity usedCap in the storage node join request, and divides the hash band proportion of each storage node according to the total capacity of all existing storage nodes.
  • the total capacity of storage node 1 is 10000G
  • the total capacity of storage node 2 is 4000G
  • the total capacity of storage node 3 is 6000G
  • storage node 1 accounts for 50% of the total capacity
  • storage node 2 accounts for 20%.
  • storage node 3 accounts for 30%
  • press up Rounding calculation shows that the hash band length (number of hash values) of storage node 1 is 2 N *0.5, that of storage node 1 is 2 N *0.2, and that of storage node 3 is 2 N *0.3.
  • the MC also calculates the weight factor of each storage node
  • the weight factor w represents the proportion of used capacity in the total capacity.
  • MC After the new storage node is successfully connected or a storage node is deleted, MC immediately synchronizes the latest hash strip information HashStripe and storage node information SnInfoList to all storage nodes in the file storage system.
  • HashStripe contains the hash distribution of each storage node (hash node correspondence), and SnInfoList contains all storage node information in the file storage system, including obtaining the IP, port and storage node of the storage node by SNid index. weight w.
  • the client can synchronize HashStripe and SnInfoList information from MC regularly.
  • the process of creating (writing) a file may include the following steps.
  • the client parses the IP, port and storage node weight w of the storage node from the SnInfoList based on the SNid.
  • the client generates a random factor (random value) in the following way: That is, r belongs to the interval of (0, 1); and compare the weight w with r. If r ⁇ w, it means that the weight does not meet the requirements, and iteratively selects the next storage node as the final target storage node in ascending order of w; if r>w, it means that the weight meets the requirements, then the storage node is selected as the final target storage node.
  • r random value
  • files should be created first on storage nodes with small used capacity. Since w represents the proportion of used capacity, for storage nodes with the same total capacity, the smaller the used capacity, the smaller w, and the smaller the interval smaller than w in the (0,1) interval, on the contrary r> The greater the probability of w, the greater the probability that the storage node will be selected, thereby balancing the storage node capacity in the file storage system.
  • the client After the client selects the final target storage node, it constructs a file creation request and sends it to the final target storage node (which may be the first target storage node).
  • the request content includes the file name fileName and the file capacity fileCap.
  • the final target storage node after receiving the file creation request, the final target storage node first parses out fileName and SNid 1 .
  • the file does not exist locally, continue to check whether the file link exists locally (refer to Figure 10 for the link structure); if a file link exists, parse the file link information to obtain the IP and port of the target storage node (the storage node pointed by the link), and Initiate a query request to the target storage node to check whether the file is valid; if the file is not in the target storage node pointed by the link, it means that the link is invalid and the file can be created; if the file is still in the target storage node pointed by the link, it means that the file storage system has been The file exists and the direct response to the client fails.
  • SNid 1 and SNid 2 are not equal, it means that the file should have been created on storage node SNid 1. At this time, a file link should be created on SNid 1 , which points to SNid 2 , and the real file still exists on SNid 2 . . Therefore, SNid 2 initiates a file link creation request to SNid 1.
  • the request content includes the target storage node identifier SNid 2 and the file name.
  • SNid 1 After SNid 1 receives the request to create a file link, it checks whether the file or file link already exists on this storage node according to the previous method (and checks whether the file link is valid); if one of them exists, it responds to SNid 2 that the file already exists; If neither the file nor the file link exists, the file link is created, indexed by hashid, and the link is stored locally.
  • SNid 1 if SNid 1 returns that the file already exists, it directly responds to the client that the file creation failed; if SNid 1 returns that the file creation link is successful, SNid 2 creates the file fileName and responds to the client.
  • the used capacity of the storage node is updated to usedCap+fileCap and reported to MC.
  • the process of file reading and writing (opening) may include the following steps.
  • the storage node After receiving the request, the storage node first checks whether the local file exists based on the file name. If it exists, it directly opens the file and responds to the client with the file handle.
  • index the information of the target storage node (the final target storage node that actually stores the file content) according to the hashid, respond to the target storage node information to the client, and set the response type to file link.
  • the client After the client receives the response, if the response type is a file link, it parses out the target storage node pointed by the link and initiates a file open request to the storage node.
  • the client After the client obtains the handle, it sends a read and write request to the target storage node.
  • the request content includes the file handle, read and write length, and read and write offset.
  • the process of deleting files may include the following steps.
  • the client calculates the hashid based on the file name and selects the storage node SNid 1 based on the hash band, and initiates a file deletion request to the storage node.
  • the request content includes the file name fileName.
  • storage node SNid 1 After storage node SNid 1 receives the deletion request, it first checks whether the file exists, and if it exists, deletes the file directly.
  • the file does not exist, continue to detect whether the file link exists. If the file link exists, obtain the link information based on the hashid, and respond to the client with the SNid 2 information of the target storage node pointed to by the link. The response type is set to file link. If the link If it does not exist, an error will be reported.
  • the client parses the target storage node in the response. IP and port information of SNid 2 , and initiate a file deletion request to SNid 2 .
  • SNid 2 responds successfully to deleting the file, the client initiates a deletion file link request to SNid 1 .
  • the process of file link management may include the following steps.
  • the File Link Management module of each storage node is responsible for cleaning up invalid file links of this storage node.
  • the file link management module periodically traverses the FileLinkList to obtain the link information, and then initiates a query to the target storage node to see if the file is valid. If the file has been deleted, it means that the link is invalid, and the file link management module will directly remove the link.
  • the process of hash band management may include the following steps.
  • the hash stripe management module (Hash Stripe Management) of the storage node is responsible for file migration when the hash strip is updated.
  • SNid 2 first initiates a file link request to SNid 1 , and SNid 1 creates a file link to the file after receiving the request.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may consist of several physical components. Components execute cooperatively.
  • Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, Such as application specific integrated circuits.
  • a processor such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, Such as application specific integrated circuits.
  • Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage medium includes all media used to store information, such as volatile and non-volatile, removable and non-removable media implemented in any method or technology (computer readable instructions, data structures, program modules or other data).
  • Computer storage media includes but is not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk memory ; Compact Disk Read-Only (CD-ROM), Digital Versatile Disk (DVD) or other optical disk storage; Magnetic cassette, magnetic tape, disk storage or other magnetic storage; Any other storage device that can be used to store desired information and can be accessed by a computer medium. Additionally, it is known to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
  • Example embodiments have been disclosed, and although specific terms are employed, they are used and should be interpreted in a general illustrative sense only and not for purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless expressly stated otherwise, features, characteristics, and/or elements described in connection with a particular embodiment may be used alone, or may be combined with features, characteristics, and/or elements described in connection with other embodiments. and/or used in combination with components. Accordingly, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Landscapes

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

Abstract

Provided in the present disclosure is a file management method used for a management server. The method comprises: determining a hash ribbon, which comprises a plurality of hash values; determining a hash node correspondence according to the hash ribbon and the total capacity of each storage node in a file storage system, wherein the hash node correspondence comprises a corresponding hash value of each storage node in the hash ribbon, the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node, each hash value in the hash ribbon is allocated to each storage node, and each storage node corresponds to one or more hash values; and sending the hash node correspondence to each storage node. Further provided in the present disclosure are a file management method used for a storage node and a client, and a management server, the storage node, a file storage system, and the client.

Description

文件管理方法、服务器、存储节点、文件存储系统、客户端File management method, server, storage node, file storage system, client
相关申请的交叉引用Cross-references to related applications
本申请要求于2022年7月1日提交的中国专利申请NO.202210767064.9的优先权,该中国专利申请的内容通过引用的方式整体合并于此。This application claims priority from Chinese patent application No. 202210767064.9 submitted on July 1, 2022. The content of this Chinese patent application is incorporated herein by reference in its entirety.
技术领域Technical field
本公开涉及分布式存储技术领域,特别涉及文件管理的方法、管理服务器、存储节点、文件存储系统、客户端。The present disclosure relates to the field of distributed storage technology, and in particular to a file management method, a management server, a storage node, a file storage system, and a client.
背景技术Background technique
随着云计算、人工智能、智能安防、工业互联网等技术的发展,大数据技术已经深入地融合到农业、医疗、交通、金融、教育、能源等行业。由此,海量数据的存储对数据存储系统的安全性、稳定性、效率也提出了更高的要求。为满足海量数据存储的需求,分布式文件存储系统得到越来越广泛的应用。With the development of cloud computing, artificial intelligence, intelligent security, industrial Internet and other technologies, big data technology has been deeply integrated into agriculture, medical care, transportation, finance, education, energy and other industries. As a result, the storage of massive data also places higher requirements on the security, stability, and efficiency of data storage systems. In order to meet the needs of massive data storage, distributed file storage systems are increasingly widely used.
但是,分布式文件存储系统中,文件管理的时延长,系统效率低。However, in a distributed file storage system, file management takes longer and the system efficiency is low.
发明内容Contents of the invention
第一方面,本公开实施例提供一种文件管理的方法,用于文件存储系统的管理服务器,所述文件存储系统包括管理服务器和多个存储节点,所述方法包括:确定包括多个哈希值的哈希带;根据所述哈希带和所述文件存储系统中每个存储节点的总容量,确定哈希节点对应关系;所述哈希节点对应关系包括每个存储节点在所述哈希带中对应的哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值分配给每个存储节点;以及将 所述哈希节点对应关系发送至每个所述存储节点。In a first aspect, an embodiment of the present disclosure provides a file management method for a management server of a file storage system. The file storage system includes a management server and a plurality of storage nodes. The method includes: determining a file including a plurality of hashes. The hash band of the value; determine the hash node correspondence according to the hash band and the total capacity of each storage node in the file storage system; the hash node correspondence includes each storage node in the hash Corresponding hash values in the hash band, the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node, and each hash value in the hash band is allocated to each storage node; and Will The hash node correspondence is sent to each storage node.
第二方面,本公开实施例提供一种文件管理的方法,用于文件存储系统的第一存储节点,所述文件存储系统包括管理服务器和多个存储节点,所述方法包括:接收对第一目标文件的创建请求;根据所述第一目标文件的信息确定所述第一目标文件对应的第一目标哈希值,根据预设的哈希节点对应关系确定所述第一目标哈希值对应的第一目标存储节点;所述哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,所述哈希带包括多个哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值均分配给每个存储节点;所述第一存储节点自身即为所述第一目标存储节点,则所述第一存储节点本地存储所述第一目标文件;所述第一存储节点自身不同于所述第一目标存储节点,则所述第一存储节点本地存储所述第一目标文件,并在所述第一目标存储节点中创建所述第一目标文件的链接。In a second aspect, embodiments of the present disclosure provide a file management method for a first storage node of a file storage system. The file storage system includes a management server and a plurality of storage nodes. The method includes: receiving a response to the first storage node. A creation request for a target file; determining the first target hash value corresponding to the first target file according to the information of the first target file, and determining the corresponding first target hash value according to the preset hash node correspondence relationship. The first target storage node; the hash node correspondence includes the hash value corresponding to each storage node in the hash band, the hash band includes multiple hash values, and the hash value corresponding to each storage node The number of values is proportional to the total capacity of each storage node, and each hash value in the hash band is assigned to each storage node; the first storage node itself is the first target storage node, Then the first storage node locally stores the first target file; the first storage node itself is different from the first target storage node, then the first storage node locally stores the first target file, and Create a link to the first target file in the first target storage node.
第三方面,本公开实施例提供一种文件管理的方法,用于客户端,所述方法包括:根据第一目标文件的信息确定所述第一目标文件对应的第一目标哈希值,根据预设的哈希节点对应关系确定所述第一目标哈希值对应的第一目标存储节点;所述第一目标存储节点为文件存储系统的存储节点,所述文件存储系统包括管理服务器和多个存储节点,所述哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,所述哈希带包括多个哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值分配给每个存储节点;根据所述第一目标存储节点确定最终目标存储节点;所述第一目标存储节点中已用容量的占比与所述第一目标存储节点被确定为最终目标存储节点的概率负相关;以及向所述最终目标存储节点发送对所述第一目标文件的创建请求。In a third aspect, embodiments of the present disclosure provide a file management method for a client. The method includes: determining a first target hash value corresponding to the first target file according to the information of the first target file. The preset hash node correspondence determines the first target storage node corresponding to the first target hash value; the first target storage node is a storage node of a file storage system, and the file storage system includes a management server and multiple storage nodes, the hash node correspondence includes the hash value corresponding to each storage node in the hash band, the hash band includes multiple hash values, and the number of hash values corresponding to each storage node Proportional to the total capacity of each storage node, each hash value in the hash band is assigned to each storage node; the final target storage node is determined according to the first target storage node; the first target storage node The proportion of used capacity in the storage node is negatively correlated with the probability that the first target storage node is determined to be the final target storage node; and sending a creation request for the first target file to the final target storage node.
第四方面,本公开实施例提供一种管理服务器,所述其包括一个或多个存储器、一个或多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。 In a fourth aspect, embodiments of the present disclosure provide a management server, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is The processor executes, causing the processor to execute any file management method in the embodiment of the present disclosure.
第五方面,本公开实施例提供一种存储节点,所述其包括一个或多个存储器、一个或多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。In a fifth aspect, embodiments of the present disclosure provide a storage node, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is The processor executes, causing the processor to execute any file management method in the embodiment of the present disclosure.
第六方面,本公开实施例提供一种文件存储系统,其包括管理服务器和多个存储节点;所述管理服务器为本公开实施例的管理服务器;所述存储节点为本公开实施例的存储节点。In a sixth aspect, an embodiment of the present disclosure provides a file storage system, which includes a management server and a plurality of storage nodes; the management server is the management server of the embodiment of the present disclosure; the storage node is the storage node of the embodiment of the present disclosure. .
第七方面,本公开实施例提供一种客户端,其包括一个或多个存储器、一个或多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。In a seventh aspect, embodiments of the present disclosure provide a client, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
附图说明Description of drawings
图1为本公开实施例提供的一种用于管理服务器的文件管理的方法的流程图;Figure 1 is a flow chart of a method for file management of a management server provided by an embodiment of the present disclosure;
图2为本公开实施例提供的一种用于存储节点的文件管理的方法的流程图;Figure 2 is a flow chart of a method for file management of a storage node provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种用于客户端的文件管理的方法的流程图;Figure 3 is a flow chart of a method for client file management provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种管理服务器的组成框图;Figure 4 is a block diagram of a management server provided by an embodiment of the present disclosure;
图5为本公开实施例提供的一种存储节点的组成框图;Figure 5 is a block diagram of a storage node provided by an embodiment of the present disclosure;
图6为本公开实施例提供的一种文件存储系统的组成框图;Figure 6 is a block diagram of a file storage system provided by an embodiment of the present disclosure;
图7为本公开实施例提供的一种客户端的组成框图;Figure 7 is a block diagram of a client provided by an embodiment of the present disclosure;
图8为本公开实施例提供的一种文件管理的方法中的哈希带分配的示意图;Figure 8 is a schematic diagram of hash band allocation in a file management method provided by an embodiment of the present disclosure;
图9为本公开实施例提供的一种文件管理的方法中的存储节点接入文件存储系统的逻辑过程示意图;Figure 9 is a schematic diagram of the logical process of a storage node accessing a file storage system in a file management method provided by an embodiment of the present disclosure;
图10为本公开实施例提供的一种文件管理的方法中的文件链接的结构示意图;Figure 10 is a schematic structural diagram of a file link in a file management method provided by an embodiment of the present disclosure;
图11为本公开实施例提供的一种文件管理的方法中的创建文件 时客户端的逻辑过程示意图;Figure 11 shows the creation of files in a file management method provided by an embodiment of the present disclosure. Schematic diagram of the client's logical process;
图12为本公开实施例提供的一种文件管理的方法中的创建文件时存储节点的逻辑过程示意图;以及Figure 12 is a schematic diagram of the logical process of a storage node when creating a file in a file management method provided by an embodiment of the present disclosure; and
图13为本公开实施例提供的一种文件管理的方法中的读写文件时的逻辑过程示意图。FIG. 13 is a schematic diagram of the logical process of reading and writing files in a file management method provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本领域的技术人员更好地理解本公开的技术方案,下面结合附图对本公开实施例提供的文件管理的方法、管理服务器、存储节点、文件存储系统、客户端进行详细描述。In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the file management method, management server, storage node, file storage system, and client provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
在下文中将参考附图更充分地描述本公开,但是所示的实施例可以以不同形式来体现,且本公开不应当被解释为限于以下阐述的实施例。提供这些实施例的目的在于使本公开更加透彻和完整,并使本领域技术人员充分理解本公开的范围。The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms and the disclosure should not be construed as limited to the embodiments set forth below. These embodiments are provided so that this disclosure will be thorough and complete, and will fully understand the scope of the disclosure to those skilled in the art.
本公开实施例的附图用来提供对本公开实施例的进一步理解,并且构成说明书的一部分,与详细实施例一起用于解释本公开,并不构成对本公开的限制。通过参考附图对详细实施例进行描述,以上和其它特征和优点对本领域技术人员将变得更加显而易见。The drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure and form a part of the specification. They are used to explain the present disclosure together with the detailed embodiments and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed embodiments with reference to the accompanying drawings.
本公开可借助本公开的理想示意图而参考平面图和/或截面图进行描述。因此,可根据制造技术和/或容限来修改示例图示。The present disclosure may be described with reference to plan and/or cross-sectional illustrations, which are schematic illustrations of the disclosure. Accordingly, example illustrations may be modified based on manufacturing techniques and/or tolerances.
在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。The embodiments of the present disclosure and the features in the embodiments may be combined with each other without conflict.
本公开所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本公开所使用的术语“和/或”包括一个或多个相关列举条目的任何和所有组合。如本公开所使用的单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。如本公开所使用的术语“包括”、“由……制成”,指定存在特定特征、整体、步骤、操作、元件和/或组件,但不排除存在或可添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。The terminology used in this disclosure is for describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure, the term "and/or" includes any and all combinations of one or more of the associated listed items. As used in this disclosure, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. As used in this disclosure, the terms “comprising” and “made of” specify the presence of particular features, integers, steps, operations, elements and/or components but do not exclude the presence or the possibility that one or more other features, Integers, steps, operations, elements, components and/or groups thereof.
除非另外限定,否则本公开所用的所有术语(包括技术和科学 术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如在常用字典中限定的术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本公开明确如此限定。Unless otherwise defined, all terms (including technical and scientific terms) have the same meanings as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be construed to have meanings consistent with their meanings in the context of the relevant art and the present disclosure, and will not be construed as having idealized or excessively formal meanings, except as provided herein. Disclosure is expressly so qualified.
本公开不限于附图中所示的实施例,而是包括基于制造工艺而形成的配置的修改。因此,附图中例示的区具有示意性属性,并且图中所示区的形状例示了元件的区的具体形状,但并不是旨在限制性的。The present disclosure is not limited to the embodiments shown in the drawings but includes modifications of configurations formed based on manufacturing processes. Accordingly, the regions illustrated in the figures are of a schematic nature and the shapes of the regions shown in the figures are illustrative of the specific shapes of regions of the element and are not intended to be limiting.
一些相关技术的分布式文件存储系统包括文件分发服务器和多个存储节点,而文件管理均由文件分发服务器负责,即,文件分发服务器将需要创建(写入)的文件随机分配到各个存储节点,并通过其中的随机性来保证各存储节点容量的均衡。Distributed file storage systems of some related technologies include a file distribution server and multiple storage nodes, and file management is performed by the file distribution server. That is, the file distribution server randomly distributes the files that need to be created (written) to each storage node. And the randomness is used to ensure the balance of the capacity of each storage node.
但是,以上方式所有的文件管理均由文件分发服务器承担,导致其网络负载大,文件分发时延较长,而影响整个系统效率。However, all file management in the above method is undertaken by the file distribution server, which results in heavy network load and long file distribution delay, which affects the efficiency of the entire system.
第一方面,本公开实施例提供一种文件管理的方法,用于文件存储系统的管理服务器,文件存储系统包括管理服务器和多个存储节点。In a first aspect, embodiments of the present disclosure provide a file management method for use in a management server of a file storage system. The file storage system includes a management server and multiple storage nodes.
本公开实施例的方法由文件存储系统中的管理服务器执行。The method of the embodiment of the present disclosure is executed by the management server in the file storage system.
本公开实施例的文件存储系统包括多个用于实际存储文件的存储节点,故其属于“分布式文件存储系统”;文件存储系统中还包括具有管理作用的管理服务器,但是,文件存储系统中对文件的管理并不是完全由管理服务器进行。The file storage system in the embodiment of the present disclosure includes multiple storage nodes for actually storing files, so it belongs to a "distributed file storage system"; the file storage system also includes a management server with a management function. However, the file storage system Management of files is not entirely performed by the management server.
而客户端(例如用户终端,或文件存储系统的接口设备)可与该文件存储系统进行交互,从而通过该文件存储系统进行文件管理。The client (such as a user terminal, or an interface device of the file storage system) can interact with the file storage system, thereby performing file management through the file storage system.
图1为本公开实施例提供的一种用于管理服务器的文件管理的方法的流程图,参照图1,本公开实施例的方法包括如下步骤S101至S303。FIG. 1 is a flow chart of a method for file management of a management server provided by an embodiment of the disclosure. Referring to FIG. 1 , the method of the embodiment of the disclosure includes the following steps S101 to S303.
在步骤S101中,确定包括多个哈希值的哈希带。In step S101, a hash strip including a plurality of hash values is determined.
管理服务器计算出待使用的哈希(Hash)带,该哈希带包括多个哈希值。The management server calculates a hash band to be used, and the hash band includes a plurality of hash values.
在步骤S102中,根据哈希带和文件存储系统中每个存储节点的 总容量,确定哈希节点对应关系。In step S102, according to the hash band and the data of each storage node in the file storage system, The total capacity determines the hash node correspondence.
哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,哈希带中的每个哈希值分配给每个存储节点。The hash node correspondence includes the hash value corresponding to each storage node in the hash band. The number of hash values corresponding to each storage node is proportional to the total capacity of each storage node. Each hash value in the hash band A hash value is assigned to each storage node.
将以上哈希带的所有哈希值,分配给文件存储系统中当前有的各存储节点,每个哈希值都被分配给每个存储节点,而每个存储节点对应一个或多个哈希值,且每个存储节点对应的哈希值的个数,正比于其总容量(包括已用的容量和未使用的容量)。All hash values of the above hash bands are assigned to each storage node currently in the file storage system. Each hash value is assigned to each storage node, and each storage node corresponds to one or more hashes. value, and the number of hash values corresponding to each storage node is proportional to its total capacity (including used capacity and unused capacity).
也就是说,按照每个存储节点的总容量在所有存储节点的总容量的占比分配哈希值:每个存储节点的总容量在所有存储节点的总容量的占比(比例),等于每个存储节点对应的哈希值的数量在哈希带的所有哈希值的数量的占比。That is to say, the hash value is allocated according to the proportion of the total capacity of each storage node to the total capacity of all storage nodes: the proportion (ratio) of the total capacity of each storage node to the total capacity of all storage nodes is equal to each The ratio of the number of hash values corresponding to each storage node to the number of all hash values in the hash band.
在步骤S103中,将哈希节点对应关系发送至每个存储节点。In step S103, the hash node correspondence is sent to each storage node.
将以上分配后得到的存储节点与哈希值的对应关系(哈希节点对应关系),分配给所有的存储节点,以使每个存储节点均获知所有的存储节点与哈希值的对应关系。The correspondence between storage nodes and hash values (correspondence between hash nodes) obtained after the above allocation is allocated to all storage nodes, so that each storage node knows the correspondence between all storage nodes and hash values.
在一些实施例中,哈希带中哈希值的总数量根据文件存储系统能支持的最大存储节点数量确定。In some embodiments, the total number of hash values in the hash strip is determined based on the maximum number of storage nodes that the file storage system can support.
作为本公开实施例的一种方式,哈希带中哈希值的总数量可以是根据文件存储系统能支持的最大存储节点数量N确定的,例如,哈希带的长度(哈希值个数)可为2N,即,哈希值在[0,2N-1]。As an embodiment of the present disclosure, the total number of hash values in the hash strip may be determined based on the maximum number of storage nodes N that the file storage system can support, for example, the length of the hash strip (the number of hash values ) can be 2 N , that is, the hash value is in [0,2 N -1].
由此,当文件存储系统中接入新存储节点或有存储节点被删除时,总的哈希带不变,只是其中具体哈希值对应的存储节点可能变化。Therefore, when a new storage node is added to the file storage system or a storage node is deleted, the total hash band remains unchanged, but the storage node corresponding to the specific hash value may change.
在一些实施例中,本公开实施例的方法还包括:当文件存储系统发生存储节点变更,则根据哈希带和变更后文件存储系统中每个存储节点的总容量,确定更新的哈希节点对应关系。In some embodiments, the method of the embodiment of the present disclosure also includes: when the storage node changes in the file storage system, determine the updated hash node based on the hash band and the total capacity of each storage node in the file storage system after the change. Correspondence.
在一些实施例中,存储节点变更包括接入新的存储节点,和/或,删除已有的存储节点。In some embodiments, storage node changes include accessing new storage nodes and/or deleting existing storage nodes.
将更新的哈希节点对应关系发送至每个存储节点。Send the updated hash node correspondence to each storage node.
作为本公开实施例的一种方式,当文件存储系统发生存储节点 变更(接入新存储节点或有存储节点被删除)时,存储节点的总容量的占比关系显然也会变化,故此时需要管理服务器重新分配哈希值(但不必重新计算哈希带),并将得到的“新”哈希节点对应关系发给存储节点。As a way of the embodiment of the present disclosure, when the file storage system has a storage node When changes occur (new storage nodes are connected or storage nodes are deleted), the proportion of the total capacity of the storage nodes will obviously change. Therefore, the management server needs to redistribute hash values at this time (but does not need to recalculate the hash band). And send the obtained "new" hash node correspondence to the storage node.
应当理解,由于每次更新的哈希节点对应关系都会发给存储节点,故对存储节点而言,某次更新前的“旧”哈希节点对应关系实际是上一次更新的“新”哈希节点对应关系,故存储节点对更新前后的哈希节点对应关系都是可知的。It should be understood that since each updated hash node correspondence will be sent to the storage node, so for the storage node, the "old" hash node correspondence before a certain update is actually the "new" hash of the last update. Node correspondence, so the correspondence between the storage node and the hash node before and after the update is known.
第二方面,本公开实施例提供一种文件管理的方法,用于文件存储系统的第一存储节点,文件存储系统包括管理服务器和多个存储节点。In a second aspect, embodiments of the present disclosure provide a file management method for the first storage node of a file storage system. The file storage system includes a management server and multiple storage nodes.
本公开实施例的方法由文件存储系统中的存储节点执行。The method of the embodiment of the present disclosure is executed by a storage node in the file storage system.
应当理解,第一存储节点仅作为一个执行该文件管理的方法的存储节点的示例,并不指代任何先后顺序,文件存储系统中的任意存储节点均可执行本公开实施例的方法,即本公开实施例的方法是所有存储节点均可执行的通用方法。It should be understood that the first storage node is only an example of a storage node that performs the file management method, and does not refer to any sequence. Any storage node in the file storage system can perform the method of the disclosed embodiment, that is, this The methods of the disclosed embodiments are general methods executable by all storage nodes.
图2为本公开实施例提供的一种用于存储节点的文件管理的方法的流程图,参照图2,本公开实施例的方法包括如下步骤S201至S204。FIG. 2 is a flow chart of a method for file management of a storage node provided by an embodiment of the present disclosure. Referring to FIG. 2 , the method of the embodiment of the present disclosure includes the following steps S201 to S204.
在步骤S201中,接收对第一目标文件的创建请求。In step S201, a creation request for a first target file is received.
某个存储节点被选为最终目标存储节点(如,实际存储第一目标文件内容的存储节点),从而会接收到请求,要求在该存储节点中创建(如写入)一个文件(如,第一目标文件)。A certain storage node is selected as the final target storage node (for example, the storage node that actually stores the content of the first target file), and thus a request is received to create (for example, write) a file (for example, the first target file) in the storage node. a target file).
应当理解,本公开实施例中的第一目标文件、第二目标文件、第三目标文件并非指特定的文件,而是根据应用场景决定的,即同一个文件在不同应用场景下可能为不同类型的目标文件。It should be understood that the first target file, the second target file, and the third target file in the embodiments of the present disclosure do not refer to specific files, but are determined according to the application scenario, that is, the same file may be of different types in different application scenarios. target file.
例如,当要将一个文件写入文件存储系统时,该文件就是第一目标文件;而在写入后,当要对该文件进行打开、删除等操作时,该文件就是第二目标文件。For example, when a file is written to the file storage system, the file is the first target file; and after writing, when the file is opened, deleted, etc., the file is the second target file.
在步骤S202中,根据第一目标文件的信息确定对应的第一目标 哈希值,根据预设的哈希节点对应关系确定第一目标哈希值对应的第一目标存储节点。In step S202, the corresponding first target is determined based on the information of the first target file. The hash value determines the first target storage node corresponding to the first target hash value according to the preset hash node correspondence relationship.
在一些实施例中,哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,哈希带包括多个哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,哈希带中的每个哈希值分配给每个存储节点,每个存储节点对应一个或多个哈希值。In some embodiments, the hash node correspondence includes the hash value corresponding to each storage node in the hash band, the hash band includes multiple hash values, and the number of hash values corresponding to each storage node is proportional to The total capacity of each storage node, each hash value in the hash band is assigned to each storage node, and each storage node corresponds to one or more hash values.
存储节点可根据第一目标文件的部分信息(如文件名)计算其对应的第一哈希值,该第一哈希值必须位于以上哈希带中,从而存储节点可根据该存储节点中预存(如,由管理服务器发送)的哈希节点对应关系,确定该第一哈希值对应的第一目标存储节点,也就是该第一目标文件理论上应在的存储节点。The storage node can calculate the corresponding first hash value based on part of the information (such as the file name) of the first target file. The first hash value must be located in the above hash band, so the storage node can pre-store the file based on the first hash value in the storage node. The hash node correspondence relationship (for example, sent by the management server) determines the first target storage node corresponding to the first hash value, that is, the storage node where the first target file should theoretically be located.
在一些实施例中,该第一目标存储节点可能就是该第一存储节点,即执行本方法的存储节点本身,也可能是其它的存储节点,根据该情况的不同可进行不同的后续操作。In some embodiments, the first target storage node may be the first storage node, that is, the storage node itself that executes the method, or it may be another storage node. Different subsequent operations may be performed depending on the situation.
在步骤S203中,如果该第一存储节点,即执行本方法的存储节点自身,为第一目标存储节点,则第一存储节点本地存储第一目标文件。In step S203, if the first storage node, that is, the storage node itself that executes the method, is the first target storage node, the first storage node locally stores the first target file.
如果执行本方法的存储节点本身就是第一目标存储节点,则表明第一目标存储节点同时是最终目标存储节点(实际存储第一目标文件内容的存储节点),故可直接将第一目标文件存储在本地。If the storage node that executes this method is itself the first target storage node, it means that the first target storage node is also the final target storage node (the storage node that actually stores the content of the first target file), so the first target file can be directly stored locally.
在步骤S204中,如果第一存储节点,即执行本方法的存储节点自身,不同于第一目标存储节点,则第一存储节点本地存储第一目标文件,并在第一目标存储节点中创建第一目标文件的链接。In step S204, if the first storage node, that is, the storage node itself that executes the method, is different from the first target storage node, the first storage node locally stores the first target file and creates the first target file in the first target storage node. A link to an object file.
如果执行本方法的存储节点本身不是第一目标存储节点,则表明第一目标存储节点与最终目标存储节点是不同的;故存储节点可将第一目标文件的内容存储在本地,但还要在第一目标存储节点中创建第一目标文件的链接,从而客户端可在第一目标存储节点中找到第一目标文件的链接,并通过第一目标存储节点操作第一目标文件。If the storage node that executes this method is not the first target storage node, it means that the first target storage node is different from the final target storage node; therefore, the storage node can store the content of the first target file locally, but it must also store the content of the first target file locally. A link to the first target file is created in the first target storage node, so that the client can find the link to the first target file in the first target storage node and operate the first target file through the first target storage node.
在一些实施例中,本公开实施例的方法还包括:接收对第二目标文件的操作请求。 In some embodiments, the method of the embodiment of the present disclosure further includes: receiving an operation request for the second target file.
在一些实施例中,所述操作包括打开第二目标文件,和/或,删除第二目标文件。In some embodiments, the operation includes opening the second target file, and/or deleting the second target file.
当第二目标文件在本地存储,则根据操作请求操作第二目标文件。When the second target file is stored locally, the second target file is operated according to the operation request.
当第二目标文件不在本地存储,则基于第二目标文件的链接响应操作请求。When the second target file is not stored locally, the operation request is responded to based on the link of the second target file.
一个存储节点(如,第一目标存储节点)被写入文件后还可能接收到请求,要对存储在其中的文件(如,第二目标文件)进行删除、打开(读取)等操作。After a file is written to a storage node (eg, the first target storage node), it may also receive a request to delete, open (read), and other operations on the file (eg, the second target file) stored therein.
此时,若第二目标文件就在存储节点本地存储(即,存储节点同时也是最终目标存储节点),则可直接对文件进行操作;而若存储节点本地并无第二目标文件(即,存储节点不是最终目标存储节点),则获得第二目标文件的链接,基于该链接响应以上操作(如,打开链接对应的文件,或删除链接对应的文件和链接本身)。At this time, if the second target file is stored locally on the storage node (that is, the storage node is also the final target storage node), the file can be directly operated; and if there is no second target file locally on the storage node (that is, the storage node node is not the final target storage node), obtain the link to the second target file, and respond to the above operations based on the link (for example, open the file corresponding to the link, or delete the file corresponding to the link and the link itself).
在一些实施例中,本公开实施例的方法还包括:接收更新的哈希节点对应关系。In some embodiments, the method of the embodiment of the present disclosure further includes: receiving updated hash node correspondence.
根据本地存储的第三目标文件的信息确定对应的第三目标哈希值,根据更新的哈希节点对应关系确定第三目标哈希值对应的第三目标存储节点。The corresponding third target hash value is determined according to the locally stored third target file information, and the third target storage node corresponding to the third target hash value is determined according to the updated hash node correspondence.
如果执行本方法的存储节点自身,不同于第三目标存储节点,则将第三目标文件迁移至第三目标存储节点。If the storage node itself that executes this method is different from the third target storage node, then the third target file is migrated to the third target storage node.
当文件存储系统发生存储节点变更(如,接入新存储节点或有存储节点被删除)时,各存储节点会接收到管理服务器分配的“新”哈希节点对应关系,而“新”哈希节点对应关系中,可能有部分哈希值对应的存储节点与之前不同,故相应哈希值的文件所应在的存储节点也可能与之前不同。When a storage node changes in the file storage system (for example, a new storage node is connected or a storage node is deleted), each storage node will receive the "new" hash node correspondence assigned by the management server, and the "new" hash node In the node correspondence relationship, the storage nodes corresponding to some hash values may be different from before, so the storage nodes where the files with corresponding hash values should be located may also be different from before.
为此,每个存储节点均需要检查自身存储的文件(如,第三目标文件),根据“新”哈希节点对应关系应在的存储节点(如,第三目标存储节点):如果该第三目标存储节点是存储节点自身则不必操作;而如果该第三目标存储节点不是存储节点自身,则表明第三目标 文件的存储位置应变更,故应将第三目标文件迁移到新的第三目标存储节点。To this end, each storage node needs to check the file it stores (for example, the third target file), and according to the storage node (for example, the third target storage node) where the "new" hash node correspondence should be: if the third target storage node If the third target storage node is the storage node itself, no operation is required; if the third target storage node is not the storage node itself, it indicates that the third target storage node is not the storage node itself. The storage location of the file should be changed, so the third target file should be migrated to the new third target storage node.
第三方面,本公开实施例提供一种文件管理的方法,用于客户端。In a third aspect, embodiments of the present disclosure provide a file management method for a client.
本公开实施例的方法由客户端执行,而该客户端可与本公开实施例的文件存储系统交互,从而用该文件存储系统进行文件管理。The method of the embodiment of the present disclosure is executed by the client, and the client can interact with the file storage system of the embodiment of the present disclosure, thereby using the file storage system for file management.
图3为本公开实施例提供的一种用于客户端的文件管理的方法的流程图,参照图3,本公开实施例的方法包括如下步骤S301至S303。Figure 3 is a flow chart of a method for client file management provided by an embodiment of the disclosure. Referring to Figure 3, the method of the embodiment of the disclosure includes the following steps S301 to S303.
在步骤S301中、根据第一目标文件的信息确定所述第一目标文件对应的第一目标哈希值,根据预设的哈希节点对应关系确定第一目标哈希值对应的第一目标存储节点。In step S301, the first target hash value corresponding to the first target file is determined according to the information of the first target file, and the first target storage corresponding to the first target hash value is determined according to the preset hash node correspondence relationship. node.
在一些实施例中,第一目标存储节点为文件存储系统的存储节点,文件存储系统包括管理服务器和多个存储节点,哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,哈希带包括多个哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,哈希带中的每个哈希值分配给每个存储节点,每个存储节点对应一个或多个哈希值。In some embodiments, the first target storage node is a storage node of a file storage system. The file storage system includes a management server and multiple storage nodes, and the hash node correspondence includes the corresponding hash of each storage node in the hash band. value. The hash band includes multiple hash values. The number of hash values corresponding to each storage node is proportional to the total capacity of each storage node. Each hash value in the hash band is assigned to each storage node. Each storage node corresponds to one or more hash values.
当客户端需要向文件存储系统写入文件(第一目标文件)时,根据第一目标文件的信息(如文件名)计算出属于哈希带的第一哈希值,并根据从管理服务器获取的哈希节点对应关系,确定该第一哈希值对应的第一目标存储节点,也就是该第一目标文件理论上应在的存储节点。When the client needs to write a file (first target file) to the file storage system, it calculates the first hash value belonging to the hash band based on the information of the first target file (such as the file name), and obtains the first hash value from the management server. The hash node correspondence relationship determines the first target storage node corresponding to the first hash value, that is, the storage node where the first target file should theoretically be located.
在步骤S302中,根据第一目标存储节点确定最终目标存储节点。In step S302, the final target storage node is determined according to the first target storage node.
在一些实施例中,第一目标存储节点中已用容量的占比与第一目标存储节点被确定为最终目标存储节点的概率负相关。In some embodiments, the proportion of used capacity in the first target storage node is negatively correlated with the probability that the first target storage node is determined to be the final target storage node.
在确定出第一目标存储节点后,继续确定出实际存储第一目标文件的内容的最终目标存储节点,该最终目标存储节点可能就是第一目标存储节点,也可能为其它的存储节点。而第一目标存储节点为最终目标存储节的概率,与第一目标存储节点中已用容量的占比(即第一目标存储节点中已用容量占其自身总容量的比例)负相关。 After determining the first target storage node, continue to determine the final target storage node that actually stores the content of the first target file. The final target storage node may be the first target storage node, or it may be another storage node. The probability that the first target storage node is the final target storage node is negatively correlated with the proportion of the used capacity in the first target storage node (that is, the proportion of the used capacity in the first target storage node to its own total capacity).
可见,存储节点对应的哈希值数量与其总容量成正比,故总容量越大的存储节点越容易被选为第一目标存储节点并写入第一目标文件,以实现容量分配的均衡。It can be seen that the number of hash values corresponding to a storage node is proportional to its total capacity. Therefore, a storage node with a larger total capacity is more likely to be selected as the first target storage node and write the first target file to achieve balanced capacity allocation.
同时,存储节点被选为第一目标存储节点后,其中已用容量的比例越大(即,负载越大),则第一目标文件实际被写入其中的概率越低,从而实现负载的均衡。At the same time, after the storage node is selected as the first target storage node, the greater the proportion of used capacity (ie, the greater the load), the lower the probability that the first target file is actually written to it, thereby achieving load balancing. .
在步骤S303中,向最终目标存储节点发送对第一目标文件的创建请求。In step S303, a creation request for the first target file is sent to the final target storage node.
将对第一目标文件的创建请求发送给最终目标存储节点,由最终目标存储节点执行以上的文件管理的方法,将第一目标文件实际写入。The creation request for the first target file is sent to the final target storage node, and the final target storage node executes the above file management method to actually write the first target file.
在一些实施例中,根据第一目标存储节点确定最终目标存储节点包括:产生0至1之间的随机值。In some embodiments, determining the final target storage node based on the first target storage node includes generating a random value between 0 and 1.
当随机值大于第一目标存储节点中已用容量的占比,则确定第一目标存储节点为最终目标存储节点。When the random value is greater than the proportion of used capacity in the first target storage node, the first target storage node is determined to be the final target storage node.
当随机值小于或等于第一目标存储节点中已用容量的占比,则确定第一目标存储节点外的其它存储节点为最终目标存储节点。When the random value is less than or equal to the proportion of used capacity in the first target storage node, other storage nodes other than the first target storage node are determined to be the final target storage nodes.
作为本公开实施例的一种方式,可以是先计算得到一个0至1间的随机值r,而将r与第一目标存储节点中已用容量的占比w进行比较,若r大于w则确定第一目标存储节点就是最终目标存储节点,而若r不大于w则选择其它存储节点为最终目标存储节点。As a method of the embodiment of the present disclosure, a random value r between 0 and 1 can be calculated first, and then r is compared with the proportion w of the used capacity in the first target storage node. If r is greater than w, then The first target storage node is determined to be the final target storage node, and if r is not greater than w, other storage nodes are selected as the final target storage node.
在一些实施例中,确定第一目标存储节点外的其它存储节点为最终目标存储节点包括:确定除第一目标存储节点外的已用容量的占比最小的存储节点为最终目标存储节点。In some embodiments, determining storage nodes other than the first target storage node as the final target storage node includes: determining the storage node with the smallest proportion of used capacity other than the first target storage node as the final target storage node.
作为本公开实施例的一种方式,可以是将所有存储节点按照已用容量的占比w升序排序,当要选择其它存储节点为最终目标存储节点时,选择w最小的其它存储节点为最终目标存储节点。As a method of the embodiment of the present disclosure, all storage nodes can be sorted in ascending order according to the proportion of used capacity w. When other storage nodes are to be selected as the final target storage nodes, the other storage nodes with the smallest w are selected as the final target. storage node.
应当理解,这里的选择也可以是“迭代”的。It should be understood that the selection here can also be "iterative".
在一些实施例中,本公开实施例的方法还包括:根据第二目标文件的信息确定对应的第二目标哈希值,根据预设的哈希节点对应关 系确定第二目标哈希值对应的第二目标存储节点。In some embodiments, the method of the embodiment of the present disclosure further includes: determining the corresponding second target hash value according to the information of the second target file, and determining the corresponding hash node according to the preset relationship. The second target storage node corresponding to the second target hash value is determined.
向第二目标存储节点发送对第二目标文件的操作请求。Send an operation request for the second target file to the second target storage node.
在一些实施例中,操作包括打开第二目标文件,和/或,删除第二目标文件。In some embodiments, the operations include opening the second target file, and/or deleting the second target file.
当客户端要对文件存储系统中的某个文件(如,第二目标文件)进行操作时,可计算其第二目标哈希值,并查找到第二目标哈希值对应的第二目标存储节点,向第二目标存储节点发出相应的操作请求,使第二目标存储节点执行以上的文件管理的方法。When the client wants to operate a certain file (such as a second target file) in the file storage system, it can calculate its second target hash value and find the second target storage corresponding to the second target hash value. The node sends a corresponding operation request to the second target storage node, so that the second target storage node performs the above file management method.
本公开实施例中,客户端可直接计算出文件所在的目标存储节点,且实际的文件管理(如存储)也由各存储节点按照一定的规则进行,而不是由文件分发服务器统一进行,故其既可保证各存储节点的容量均衡,又不会导致某个节点网络负载过大,从而使得文件分发时延短,整个系统的效率高。In this disclosed embodiment, the client can directly calculate the target storage node where the file is located, and the actual file management (such as storage) is also performed by each storage node according to certain rules instead of being uniformly performed by the file distribution server, so it It can ensure the balanced capacity of each storage node without causing excessive network load on a certain node, resulting in short file distribution delay and high efficiency of the entire system.
第四方面,参照图4,本公开实施例提供一种管理服务器,其包括一个或多个存储器、一个或多个处理器;存储器存储有能被处理器执行的计算机程序,计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。In the fourth aspect, referring to Figure 4, an embodiment of the present disclosure provides a management server, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
第五方面,参照图5,本公开实施例提供一种存储节点,其包括一个或多个存储器、一个或多个处理器;存储器存储有能被处理器执行的计算机程序,计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。In the fifth aspect, referring to Figure 5, an embodiment of the present disclosure provides a storage node, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
第六方面,参照图6,本公开实施例提供一种文件存储系统,其包括管理服务器和多个存储节点;管理服务器为本公开实施例的管理服务器;存储节点为本公开实施例的存储节点。In the sixth aspect, referring to FIG. 6 , an embodiment of the present disclosure provides a file storage system, which includes a management server and multiple storage nodes; the management server is the management server of the embodiment of the present disclosure; the storage node is the storage node of the embodiment of the present disclosure. .
第七方面,参照图7,本公开实施例提供一种客户端,其包括一个或多个存储器、一个或多个处理器;存储器存储有能被处理器执行的计算机程序,计算机程序被处理器执行,使得处理器执行本公开实施例的任意一种文件管理的方法。In the seventh aspect, referring to Figure 7, an embodiment of the present disclosure provides a client, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor. Execution causes the processor to execute any file management method in the embodiments of the present disclosure.
在一些实施例中,处理器为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器为具有数据存储能力的器件, 其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)连接在处理器与存储器间,能实现存储器与处理器的信息交互,其包括但不限于数据总线(Bus)等。In some embodiments, the processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory is a device with data storage capabilities, It includes but is not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); I/O interface ( The read-write interface) is connected between the processor and the memory, and can realize the information interaction between the memory and the processor, including but not limited to the data bus (Bus), etc.
示例性的,用本公开实施例的文件存储系统可进行多种不同的应用场景,下面分别对各应用场景下的文件管理的方法的详细过程进行介绍。For example, the file storage system of the embodiment of the present disclosure can be used in a variety of different application scenarios. The detailed process of the file management method in each application scenario is introduced below.
(1)存储节点接入文件存储系统(集群)的过程可包括以下步骤。(1) The process of a storage node accessing a file storage system (cluster) may include the following steps.
参照图9,管理服务器(Management Center,MC)根据系统支持的最大存储节点数N初始化哈希带,哈希带长度为2N,哈希带的区间分布为[0,2N-1]。Referring to Figure 9, the management server (Management Center, MC) initializes the hash band according to the maximum number of storage nodes N supported by the system. The length of the hash band is 2 N and the interval distribution of the hash band is [0, 2 N -1].
例如,若文件存储系统支持的最大存储节点数为16,则哈希带分布为[0,65535]。For example, if the maximum number of storage nodes supported by the file storage system is 16, the hash band distribution is [0,65535].
存储节点(Store Node,SN)接入文件存储系统时,首先向MC发起接入请求,请求内容包括存储节点的总容量totalCap、已用容量usedCap。When a storage node (Store Node, SN) accesses the file storage system, it first initiates an access request to the MC. The request content includes the total capacity of the storage node totalCap and the used capacity usedCap.
MC根据在网存储节点数量,分配存储节点标识SNid;SNid分布为[0,N-1]。MC allocates storage node identifiers SNid based on the number of storage nodes on the network; the SNid distribution is [0, N-1].
例如,第一个存储节点SNid为0,第二个存储节点SNid为1,第三个存储节点SNid为2;而SNid1删除后,新接入的存储节点优先分配空缺的SNid,即在第四个存储节点接入后,SNid为2。For example, the SNid of the first storage node is 0, the SNid of the second storage node is 1, and the SNid of the third storage node is 2; after SNid1 is deleted, the newly connected storage node will be allocated the vacant SNid first, that is, in the fourth After a storage node is connected, the SNid is 2.
MC将分配的存储节点标识SNid发给存储节点,存储节点保存自身SNid。MC sends the allocated storage node ID SNid to the storage node, and the storage node saves its own SNid.
参照图8,MC还解析存储节点加入请求中的总容量totalCap、已用容量usedCap,根据现有的所有存储节点的总容量划分每个存储节点的哈希带占比。Referring to Figure 8, MC also analyzes the total capacity totalCap and used capacity usedCap in the storage node join request, and divides the hash band proportion of each storage node according to the total capacity of all existing storage nodes.
例如,在网存储节点数为3个,存储节点1总容量10000G,存储节点2总容量4000G,存储节点3总容量6000G,则存储节点1占总容量的50%,存储节点2占比20%,存储节点3占比30%,按向上 取整计算,存储节点1的哈希带占比长度(哈希值个数)为2N*0.5,存储节点占比长度为2N*0.2,存储节点3占比长度为2N*0.3。For example, if there are 3 storage nodes on the network, the total capacity of storage node 1 is 10000G, the total capacity of storage node 2 is 4000G, and the total capacity of storage node 3 is 6000G, then storage node 1 accounts for 50% of the total capacity, and storage node 2 accounts for 20%. , storage node 3 accounts for 30%, press up Rounding calculation shows that the hash band length (number of hash values) of storage node 1 is 2 N *0.5, that of storage node 1 is 2 N *0.2, and that of storage node 3 is 2 N *0.3.
由此,也就相当于建立了存储节点标识SNid与哈希值的对应关系。Therefore, it is equivalent to establishing the corresponding relationship between the storage node identifier SNid and the hash value.
MC还计算各存储节点权重因子权重因子w代表已用容量在总容量中的占比。MC also calculates the weight factor of each storage node The weight factor w represents the proportion of used capacity in the total capacity.
MC在新存储节点接入成功或有存储节点被删除后,就立即向文件存储系统内所有存储节点同步最新的哈希带信息HashStripe以及存储节点信息SnInfoList。After the new storage node is successfully connected or a storage node is deleted, MC immediately synchronizes the latest hash strip information HashStripe and storage node information SnInfoList to all storage nodes in the file storage system.
在一些实施例中,HashStripe包含每个存储节点的hash分布(哈希节点对应关系),SnInfoList则包含文件存储系统内的所有存储节点信息,包括按SNid索引获得存储节点的IP,端口以及存储节点权重w。In some embodiments, HashStripe contains the hash distribution of each storage node (hash node correspondence), and SnInfoList contains all storage node information in the file storage system, including obtaining the IP, port and storage node of the storage node by SNid index. weight w.
而客户端可定时从MC同步HashStripe和SnInfoList信息。The client can synchronize HashStripe and SnInfoList information from MC regularly.
(2)创建(写入)文件的过程可包括以下步骤。(2) The process of creating (writing) a file may include the following steps.
参照图11,客户端利用所需要创建的文件名fileName进行散列计算其哈希值hashid=hash(fileName);并计算hashid mod 2N,从而确定所选择的存储节点的SNid(第一目标存储节点)。Referring to Figure 11, the client uses the file name fileName to be created to hash and calculate its hash value hashid=hash(fileName); and calculates hashid mod 2 N to determine the SNid of the selected storage node (the first target storage node).
客户端根据SNid从SnInfoList中解析出存储节点的IP、端口以及存储节点权重w。The client parses the IP, port and storage node weight w of the storage node from the SnInfoList based on the SNid.
客户端通过以下方式产生一个随机因子(随机值):即r属于(0,1)的区间;并将权重w与r进行对比,如果r≤w,则表示权重不满足要求,则按照w的升序迭代选择下一个存储节点为最终目标存储节点;如果r>w,则表示权重满足要求,则选择该存储节点为最终目标存储节点。The client generates a random factor (random value) in the following way: That is, r belongs to the interval of (0, 1); and compare the weight w with r. If r ≤ w, it means that the weight does not meet the requirements, and iteratively selects the next storage node as the final target storage node in ascending order of w; if r>w, it means that the weight meets the requirements, then the storage node is selected as the final target storage node.
为保持整个文件存储系统中容量的均衡,应优先向已用容量小的存储节点创建文件。由于w表示已用容量的占比,因此对于总容量相同的存储节点,已用容量越小,w就越小,则在(0,1)区间中小于w的区间就越小,相反r>w的几率就越大,则存储节点被选择中的概率就越大,以此均衡文件存储系统内存储节点容量。 In order to maintain a balanced capacity in the entire file storage system, files should be created first on storage nodes with small used capacity. Since w represents the proportion of used capacity, for storage nodes with the same total capacity, the smaller the used capacity, the smaller w, and the smaller the interval smaller than w in the (0,1) interval, on the contrary r> The greater the probability of w, the greater the probability that the storage node will be selected, thereby balancing the storage node capacity in the file storage system.
客户端选择好最终目标存储节点后,构造创建文件请求,发送给该最终目标存储节点(可能是第一目标存储节点),请求内容包括文件名fileName,文件容量fileCap。After the client selects the final target storage node, it constructs a file creation request and sends it to the final target storage node (which may be the first target storage node). The request content includes the file name fileName and the file capacity fileCap.
参照图12,最终目标存储节点接受到文件创建请求后,首先解析出fileName和SNid1Referring to Figure 12, after receiving the file creation request, the final target storage node first parses out fileName and SNid 1 .
计算hashid=hash(fileName),并依据文件名fileName判断本地是否已经存在该文件,如果已经存在,则直接响应创建失败。Calculate hashid=hash(fileName), and determine whether the file already exists locally based on the file name fileName. If it already exists, respond directly to the creation failure.
如果本地不存在该文件,则继续检查本地是否存在该文件链接(链接结构参照图10);如果存在文件链接,则解析文件链接信息获取目标存储节点(链接指向的存储节点)IP、端口,并向目标存储节点发起文件是否有效查询请求;如果文件不在链接指向的目标存储节点,则表示链接已经无效,可创建该文件;如果文件仍在链接指向的目标存储节点,则表示文件存储系统中已存在该文件,直接向客户端响应失败。If the file does not exist locally, continue to check whether the file link exists locally (refer to Figure 10 for the link structure); if a file link exists, parse the file link information to obtain the IP and port of the target storage node (the storage node pointed by the link), and Initiate a query request to the target storage node to check whether the file is valid; if the file is not in the target storage node pointed by the link, it means that the link is invalid and the file can be created; if the file is still in the target storage node pointed by the link, it means that the file storage system has been The file exists and the direct response to the client fails.
如果不存在文件,也不存在链接(或链接已经无效),则开始创建该文件。If the file does not exist and the link does not exist (or the link is invalid), the creation of the file begins.
将HashStripe中获取的SNid1与自身存储节点标识SNid2比较是否相等(即确定自身是否为第一目标存储节点),如果相等则表示该文件应该创建在本存储节点,创建文件并响应创建成功给客户端。Compare the SNid 1 obtained from the HashStripe with its own storage node ID SNid 2 to see if they are equal (that is, determine whether it is the first target storage node). If they are equal, it means that the file should be created in this storage node. Create the file and respond to the success of the creation. client.
如果SNid1与SNid2不相等,则表示文件本应该创建于存储节点SNid1上,此时,应在SNid1上创建一个文件链接,该链接指向SNid2,而真实文件仍存在于SNid2上。故SNid2向SNid1发起创建文件链接请求,请求内容包括目标存储节点标识SNid2,文件名。If SNid 1 and SNid 2 are not equal, it means that the file should have been created on storage node SNid 1. At this time, a file link should be created on SNid 1 , which points to SNid 2 , and the real file still exists on SNid 2 . . Therefore, SNid 2 initiates a file link creation request to SNid 1. The request content includes the target storage node identifier SNid 2 and the file name.
SNid1收到创建文件链接请求后,按照之前的方法检查本存储节点是否已存在该文件或该文件链接(以及检查文件链接是否有效);如果其中一个存在,则向SNid2响应文件已存在;如果文件和文件链接均不存在,则创建文件链接,以hashid为索引,并本地存储链接。After SNid 1 receives the request to create a file link, it checks whether the file or file link already exists on this storage node according to the previous method (and checks whether the file link is valid); if one of them exists, it responds to SNid 2 that the file already exists; If neither the file nor the file link exists, the file link is created, indexed by hashid, and the link is stored locally.
以上过程中,如果SNid1返回文件已存在,则直接向客户端响应创建文件失败;如果SNid1返回创建文件链接成功,则SNid2创建文件fileName并响应客户端。 In the above process, if SNid 1 returns that the file already exists, it directly responds to the client that the file creation failed; if SNid 1 returns that the file creation link is successful, SNid 2 creates the file fileName and responds to the client.
文件创建成功后,存储节点已用容量更新为usedCap+fileCap,并上报给MC。After the file is successfully created, the used capacity of the storage node is updated to usedCap+fileCap and reported to MC.
(3)文件读写(打开)的过程可包括以下步骤。(3) The process of file reading and writing (opening) may include the following steps.
参照图13,客户端对要读写的文件的文件名进行散列计算hashid=hash(FileName),根据hashid从哈希带中获取存储节点标识SNid,从SnInfoList解析出对应的存储节点信息,然后向存储节点发起文件打开请求,请求内容包括文件名FileName。Referring to Figure 13, the client performs hash calculation hashid=hash(FileName) on the file name of the file to be read and written, obtains the storage node identifier SNid from the hash band according to the hashid, parses the corresponding storage node information from SnInfoList, and then Initiate a file open request to the storage node, and the request content includes the file name FileName.
存储节点收到请求后,首先根据文件名检查本地文件是否存在,如果存在,则直接打开该文件,并将文件句柄响应给客户端。After receiving the request, the storage node first checks whether the local file exists based on the file name. If it exists, it directly opens the file and responds to the client with the file handle.
如果文件不存在,则根据文件名进行散列计算hashid=hash(FileName),然后根据hashid查询文件链接列表(FileLinkList),判断是否存在该文件的链接,如果不存在,则直接向客户端响应文件不存在错误。If the file does not exist, hash calculation is performed based on the file name hashid=hash(FileName), and then the file link list (FileLinkList) is queried based on the hashid to determine whether a link to the file exists. If it does not exist, the file is directly responded to the client. There are no errors.
如果文件链接存在,则按hashid索引出目标存储节点(实际存储文件内容的最终目标存储节点)的信息,将目标存储节点信息响应给客户端,并将响应类型置为文件链接。If the file link exists, index the information of the target storage node (the final target storage node that actually stores the file content) according to the hashid, respond to the target storage node information to the client, and set the response type to file link.
客户端收到响应后,如果响应类型为文件链接,则解析出链接指向的目标存储节点,并向该存储节点发起文件打开请求。After the client receives the response, if the response type is a file link, it parses out the target storage node pointed by the link and initiates a file open request to the storage node.
客户端获取到句柄后,向目标存储节点发送读写请求,请求内容包含文件句柄,读写长度,读写偏移。After the client obtains the handle, it sends a read and write request to the target storage node. The request content includes the file handle, read and write length, and read and write offset.
(4)删除文件的过程可包括以下步骤。(4) The process of deleting files may include the following steps.
客户端根据文件名计算hashid并依据哈希带选择存储节点SNid1,向存储节点发起删除文件请求,请求内容包括文件名fileName。The client calculates the hashid based on the file name and selects the storage node SNid 1 based on the hash band, and initiates a file deletion request to the storage node. The request content includes the file name fileName.
存储节点SNid1收到删除请求后,首先检测文件是否存在,如果存在则直接删除文件。After storage node SNid 1 receives the deletion request, it first checks whether the file exists, and if it exists, deletes the file directly.
如果文件不存在,则继续检测是否存在该文件链接,如果存在文件链接则根据hashid获取链接信息,并将链接指向的目标存储节点SNid2信息响应给客户端,响应类型置为文件链接,如果链接也不存在则报错。If the file does not exist, continue to detect whether the file link exists. If the file link exists, obtain the link information based on the hashid, and respond to the client with the SNid 2 information of the target storage node pointed to by the link. The response type is set to file link. If the link If it does not exist, an error will be reported.
如果响应类型为文件链接,则客户端解析响应中目标存储节点 SNid2的IP、端口信息,并向SNid2发起删除文件请求。If the response type is a file link, the client parses the target storage node in the response. IP and port information of SNid 2 , and initiate a file deletion request to SNid 2 .
如果SNid2响应删除文件成功,客户端向SNid1发起删除文件链接请求。If SNid 2 responds successfully to deleting the file, the client initiates a deletion file link request to SNid 1 .
(5)文件链接管理的过程可包括以下步骤。(5) The process of file link management may include the following steps.
每个存储节点的文件链接管理模块(File Link Management)负责清理本存储节点无效文件链接。The File Link Management module of each storage node is responsible for cleaning up invalid file links of this storage node.
文件链接管理模块定时遍历FileLinkList,获取链接信息,然后向目标存储节点发起文件是否有效查询,如果文件已经被删除,则表示链接已无效,文件链接管理模块则直接将该链接剔除。The file link management module periodically traverses the FileLinkList to obtain the link information, and then initiates a query to the target storage node to see if the file is valid. If the file has been deleted, it means that the link is invalid, and the file link management module will directly remove the link.
(6)哈希带管理的过程可包括以下步骤。(6) The process of hash band management may include the following steps.
存储节点的哈希带管理模块(Hash Stripe Management)负责在哈希带更新时进行文件迁移。The hash stripe management module (Hash Stripe Management) of the storage node is responsible for file migration when the hash strip is updated.
存储节点更新哈希带后,哈希带管理模块遍历本存储节点已经创建的文件名,然后散列计算出hashid=hash(fileName),然后分别从新、旧哈希带中分别取出SNid1和SNid2,如果SNid相同则不做处理,如果不相同,则表示文件应迁移至SNid1中。After the storage node updates the hash band, the hash band management module traverses the file names that have been created by the storage node, then hashes and calculates hashid=hash(fileName), and then takes out SNid 1 and SNid from the new and old hash bands respectively. 2. If the SNids are the same, no processing will be performed. If they are not the same, it means that the file should be migrated to SNid 1 .
SNid2首先向SNid1发起创建该文件链接请求,SNid1收到请求后创建该文件的文件链接。SNid 2 first initiates a file link request to SNid 1 , and SNid 1 creates a file link to the file after receiving the request.
本领域普通技术人员可以理解,上文中所公开的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。Those of ordinary skill in the art can understand that all or some of the steps, systems, and functional modules/units in the devices disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof.
在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。In hardware implementations, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may consist of several physical components. Components execute cooperatively.
某些物理组件或所有物理组件可以被实施为由处理器(如中央处理器(CPU)、数字信号处理器或微处理器)执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如 计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH)或其它磁盘存储器;只读光盘(CD-ROM)、数字多功能盘(DVD)或其它光盘存储器;磁盒、磁带、磁盘存储或其它磁存储器;可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, Such as application specific integrated circuits. Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes all media used to store information, such as volatile and non-volatile, removable and non-removable media implemented in any method or technology (computer readable instructions, data structures, program modules or other data). Computer storage media includes but is not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk memory ; Compact Disk Read-Only (CD-ROM), Digital Versatile Disk (DVD) or other optical disk storage; Magnetic cassette, magnetic tape, disk storage or other magnetic storage; Any other storage device that can be used to store desired information and can be accessed by a computer medium. Additionally, it is known to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
本公开已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则与特定实施例相结合描述的特征、特性和/或元素可单独使用,或可与结合其它实施例描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。 Example embodiments have been disclosed, and although specific terms are employed, they are used and should be interpreted in a general illustrative sense only and not for purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless expressly stated otherwise, features, characteristics, and/or elements described in connection with a particular embodiment may be used alone, or may be combined with features, characteristics, and/or elements described in connection with other embodiments. and/or used in combination with components. Accordingly, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims (14)

  1. 一种文件管理的方法,用于文件存储系统的管理服务器,所述文件存储系统包括管理服务器和多个存储节点,所述方法包括:A method of file management, used for a management server of a file storage system. The file storage system includes a management server and multiple storage nodes. The method includes:
    确定包括多个哈希值的哈希带;Determine a hash band that includes multiple hash values;
    根据所述哈希带和所述文件存储系统中每个存储节点的总容量,确定哈希节点对应关系;所述哈希节点对应关系包括每个存储节点在所述哈希带中对应的哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值分配给每个存储节点;以及The hash node correspondence is determined according to the hash band and the total capacity of each storage node in the file storage system; the hash node correspondence includes the hash corresponding to each storage node in the hash band. Hash values, the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node, and each hash value in the hash band is allocated to each storage node; and
    将所述哈希节点对应关系发送至每个存储节点。Send the hash node correspondence to each storage node.
  2. 根据权利要求1所述的方法,其中,The method of claim 1, wherein,
    所述哈希带中哈希值的总数量根据所述文件存储系统能支持的最大存储节点数量确定。The total number of hash values in the hash band is determined based on the maximum number of storage nodes that the file storage system can support.
  3. 根据权利要求1所述的方法,其中,还包括:The method of claim 1, further comprising:
    所述文件存储系统发生存储节点变更,则根据所述哈希带和变更后所述文件存储系统中每个存储节点的总容量,确定更新的哈希节点对应关系;所述存储节点变更包括接入新的存储节点,和/或,删除已有的存储节点;以及When a storage node is changed in the file storage system, the updated hash node correspondence is determined based on the hash band and the total capacity of each storage node in the file storage system after the change; the storage node change includes: Add new storage nodes, and/or delete existing storage nodes; and
    将更新的所述哈希节点对应关系发送至每个存储节点。Send the updated hash node correspondence to each storage node.
  4. 一种文件管理的方法,用于文件存储系统的第一存储节点,所述文件存储系统包括管理服务器和多个存储节点,所述方法包括:A method of file management, used for the first storage node of a file storage system. The file storage system includes a management server and multiple storage nodes. The method includes:
    接收对第一目标文件的创建请求;Receive a creation request for the first target file;
    根据所述第一目标文件的信息确定所述第一目标文件对应的第一目标哈希值,根据预设的哈希节点对应关系确定所述第一目标哈希值对应的第一目标存储节点;所述哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,所述哈希带包括多个哈希值,每个存储 节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值分配给每个存储节点;Determine the first target hash value corresponding to the first target file according to the information of the first target file, and determine the first target storage node corresponding to the first target hash value according to the preset hash node correspondence relationship. ; The hash node correspondence includes the hash value corresponding to each storage node in the hash band, the hash band includes multiple hash values, each storage node The number of hash values corresponding to a node is proportional to the total capacity of each storage node, and each hash value in the hash band is allocated to each storage node;
    所述第一存储节点即为所述第一目标存储节点,则所述第一存储节点本地存储所述第一目标文件;以及The first storage node is the first target storage node, and the first storage node locally stores the first target file; and
    所述第一存储节点不同于所述第一目标存储节点,则所述第一存储节点本地存储所述第一目标文件,并在所述第一目标存储节点中创建所述第一目标文件的链接。If the first storage node is different from the first target storage node, then the first storage node locally stores the first target file and creates a copy of the first target file in the first target storage node. Link.
  5. 根据权利要求4所述的方法,其中,还包括:The method of claim 4, further comprising:
    接收对第二目标文件的操作请求;所述操作包括打开所述第二目标文件,和/或,删除所述第二目标文件;Receive an operation request for the second target file; the operation includes opening the second target file, and/or deleting the second target file;
    所述第二目标文件在本地存储,则根据所述操作请求操作所述第二目标文件;以及If the second target file is stored locally, the second target file is operated according to the operation request; and
    所述第二目标文件不在本地存储,则基于所述第二目标文件的链接响应所述操作请求。If the second target file is not stored locally, the operation request is responded to based on the link of the second target file.
  6. 根据权利要求4所述的方法,其中,还包括:The method of claim 4, further comprising:
    接收更新的所述哈希节点对应关系;Receive the updated hash node correspondence;
    根据所述第一存储节点本地存储的第三目标文件的信息确定所述第三目标文件对应的第三目标哈希值,根据更新的所述哈希节点对应关系确定所述第三目标哈希值对应的第三目标存储节点;以及The third target hash value corresponding to the third target file is determined based on the information of the third target file stored locally on the first storage node, and the third target hash is determined based on the updated correspondence between the hash nodes. The third target storage node corresponding to the value; and
    所述第一存储节点不同于所述第三目标存储节点,则将所述第三目标文件迁移至所述第三目标存储节点。If the first storage node is different from the third target storage node, the third target file is migrated to the third target storage node.
  7. 一种文件管理的方法,用于客户端,所述方法包括:A file management method for a client, the method includes:
    根据第一目标文件的信息确定所述第一目标文件对应的第一目标哈希值,根据预设的哈希节点对应关系确定所述第一目标哈希值对应的第一目标存储节点;所述第一目标存储节点为文件存储系统的存储节点,所述文件存储系统包括管理服务器和多个存储节点,所述哈希节点对应关系包括每个存储节点在哈希带中对应的哈希值,所述哈 希带包括多个哈希值,每个存储节点对应的哈希值的数量正比于每个存储节点的总容量,所述哈希带中的每个哈希值分配给每个存储节点;Determine the first target hash value corresponding to the first target file according to the information of the first target file, and determine the first target storage node corresponding to the first target hash value according to the preset hash node correspondence; The first target storage node is a storage node of a file storage system. The file storage system includes a management server and multiple storage nodes. The hash node correspondence includes the hash value corresponding to each storage node in the hash band. , as mentioned The hash band includes multiple hash values, the number of hash values corresponding to each storage node is proportional to the total capacity of each storage node, and each hash value in the hash band is allocated to each storage node;
    根据所述第一目标存储节点确定最终目标存储节点;所述第一目标存储节点中已用容量的占比与所述第一目标存储节点被确定为最终目标存储节点的概率负相关;以及Determine the final target storage node according to the first target storage node; the proportion of used capacity in the first target storage node is negatively correlated with the probability that the first target storage node is determined to be the final target storage node; and
    向所述最终目标存储节点发送对所述第一目标文件的创建请求。Send a creation request for the first target file to the final target storage node.
  8. 根据权利要求7所述的方法,其中,所述根据所述第一目标存储节点确定最终目标存储节点包括:The method according to claim 7, wherein determining the final target storage node according to the first target storage node includes:
    产生0至1之间的随机值;Generate a random value between 0 and 1;
    所述随机值大于所述第一目标存储节点中已用容量的占比,则确定所述第一目标存储节点为所述最终目标存储节点;If the random value is greater than the proportion of used capacity in the first target storage node, then the first target storage node is determined to be the final target storage node;
    所述随机值小于或等于所述第一目标存储节点中已用容量的占比,则确定所述第一目标存储节点外的其它所述存储节点为所述最终目标存储节点。If the random value is less than or equal to the proportion of used capacity in the first target storage node, then the other storage nodes other than the first target storage node are determined to be the final target storage nodes.
  9. 根据权利要求8所述的方法,其中,所述确定所述第一目标存储节点外的其它所述存储节点为所述最终目标存储节点包括:The method according to claim 8, wherein determining that other storage nodes other than the first target storage node are the final target storage nodes includes:
    确定除所述第一目标存储节点外的已用容量的占比最小的所述存储节点为所述最终目标存储节点。The storage node with the smallest proportion of used capacity other than the first target storage node is determined to be the final target storage node.
  10. 根据权利要求7所述的方法,其中,还包括:The method of claim 7, further comprising:
    根据第二目标文件的信息确定所述第二目标文件对应的第二目标哈希值,根据预设的哈希节点对应关系确定所述第二目标哈希值对应的第二目标存储节点;以及Determine the second target hash value corresponding to the second target file according to the information of the second target file, and determine the second target storage node corresponding to the second target hash value according to the preset hash node correspondence; and
    向所述第二目标存储节点发送对所述第二目标文件的操作请求;所述操作包括打开所述第二目标文件,和/或,删除所述第二目标文件。Send an operation request for the second target file to the second target storage node; the operation includes opening the second target file, and/or deleting the second target file.
  11. 一种管理服务器,所述其包括一个或多个存储器、一个或 多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得所述处理器执行权利要求1至3中任意一项所述的文件管理的方法。A management server including one or more memories, one or A plurality of processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor, so that the processor executes the file management method according to any one of claims 1 to 3 .
  12. 一种存储节点,所述其包括一个或多个存储器、一个或多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得所述处理器执行权利要求4至6中任意一项所述的文件管理的方法。A storage node, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor, so that the processor Perform the file management method according to any one of claims 4 to 6.
  13. 一种文件存储系统,其包括管理服务器和多个存储节点;A file storage system, which includes a management server and multiple storage nodes;
    所述管理服务器为权利要求11所述的管理服务器;以及The management server is the management server of claim 11; and
    所述存储节点为权利要求12所述的存储节点。The storage node is the storage node according to claim 12.
  14. 一种客户端,其包括一个或多个存储器、一个或多个处理器;所述存储器存储有能被处理器执行的计算机程序,所述计算机程序被处理器执行,使得所述处理器执行权利要求7至10中任意一项所述的文件管理的方法。 A client, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and the computer program is executed by the processor, causing the processor to execute the right The method of file management according to any one of claims 7 to 10.
PCT/CN2023/104790 2022-07-01 2023-06-30 File management method, server, storage node, file storage system, and client WO2024002349A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210767064.9A CN117370275A (en) 2022-07-01 2022-07-01 File method, server, storage node, file storage system and client
CN202210767064.9 2022-07-01

Publications (1)

Publication Number Publication Date
WO2024002349A1 true WO2024002349A1 (en) 2024-01-04

Family

ID=89383339

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104790 WO2024002349A1 (en) 2022-07-01 2023-06-30 File management method, server, storage node, file storage system, and client

Country Status (2)

Country Link
CN (1) CN117370275A (en)
WO (1) WO2024002349A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855294A (en) * 2012-08-13 2013-01-02 北京联创信安科技有限公司 Intelligent hash data layout method, cluster storage system and method thereof
US20130263151A1 (en) * 2012-04-03 2013-10-03 Microsoft Corporation Consistent Hashing Table for Workload Distribution
CN106161610A (en) * 2016-06-29 2016-11-23 华为技术有限公司 A kind of method and system of distributed storage
CN106453611A (en) * 2016-11-10 2017-02-22 郑州云海信息技术有限公司 A method and apparatus for load balancing at a plurality of storage nodes
CN107562913A (en) * 2017-09-12 2018-01-09 郑州云海信息技术有限公司 The date storage method and device of a kind of distributed file system
CN110633053A (en) * 2019-09-16 2019-12-31 北京马赫谷科技有限公司 Storage capacity balancing method, object storage method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130263151A1 (en) * 2012-04-03 2013-10-03 Microsoft Corporation Consistent Hashing Table for Workload Distribution
CN102855294A (en) * 2012-08-13 2013-01-02 北京联创信安科技有限公司 Intelligent hash data layout method, cluster storage system and method thereof
CN106161610A (en) * 2016-06-29 2016-11-23 华为技术有限公司 A kind of method and system of distributed storage
CN106453611A (en) * 2016-11-10 2017-02-22 郑州云海信息技术有限公司 A method and apparatus for load balancing at a plurality of storage nodes
CN107562913A (en) * 2017-09-12 2018-01-09 郑州云海信息技术有限公司 The date storage method and device of a kind of distributed file system
CN110633053A (en) * 2019-09-16 2019-12-31 北京马赫谷科技有限公司 Storage capacity balancing method, object storage method and device

Also Published As

Publication number Publication date
CN117370275A (en) 2024-01-09

Similar Documents

Publication Publication Date Title
US9053167B1 (en) Storage device selection for database partition replicas
US8694578B2 (en) Swarm-based synchronization over a network of object stores
US9699017B1 (en) Dynamic utilization of bandwidth for a quorum-based distributed storage system
CN109684282B (en) Method and device for constructing metadata cache
US20190392053A1 (en) Hierarchical namespace with strong consistency and horizontal scalability
WO2016202199A1 (en) Distributed file system and file meta-information management method thereof
CN110096220B (en) Distributed storage system, data processing method and storage node
US20150095384A1 (en) File transfer to a distributed file system
BR112017005646B1 (en) COMPOSITE PARTITION FUNCTIONS
CN110321225B (en) Load balancing method, metadata server and computer readable storage medium
CN107391033B (en) Data migration method and device, computing equipment and computer storage medium
CN112417036A (en) Method and device for processing metadata of object in distributed storage system
WO2021057108A1 (en) Data reading method, data writing method, and server
JP2022550401A (en) Data upload method, system, device and electronic device
CN116578746A (en) Object de-duplication method and device
CN112148206A (en) Data reading and writing method and device, electronic equipment and medium
WO2024002349A1 (en) File management method, server, storage node, file storage system, and client
CN117407159A (en) Memory space management method and device, equipment and storage medium
WO2022206170A1 (en) Data processing method, server and system
CN113312328B (en) Control method, data processing method, data access method and computing device
CN117376364A (en) Data processing method and related equipment
CN114138711A (en) File migration method and device, storage medium and electronic equipment
WO2020151337A1 (en) Distributed file processing method and apparatus, computer device and storage medium
CN113553314A (en) Service processing method, device, equipment and medium of super-convergence system
CN114610740B (en) Data version management method and device of medical data platform

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: 23830512

Country of ref document: EP

Kind code of ref document: A1