CN109062935A - A kind of method and apparatus of file operation - Google Patents

A kind of method and apparatus of file operation Download PDF

Info

Publication number
CN109062935A
CN109062935A CN201810615147.XA CN201810615147A CN109062935A CN 109062935 A CN109062935 A CN 109062935A CN 201810615147 A CN201810615147 A CN 201810615147A CN 109062935 A CN109062935 A CN 109062935A
Authority
CN
China
Prior art keywords
file
file destination
cephfs
cryptographic hash
node
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201810615147.XA
Other languages
Chinese (zh)
Inventor
邵剑雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810615147.XA priority Critical patent/CN109062935A/en
Publication of CN109062935A publication Critical patent/CN109062935A/en
Pending legal-status Critical Current

Links

Abstract

This application provides a kind of method and apparatus of file operation, to solve the existing low efficiency operated in the art to the file in distributed NAS storage system, so as to cause the performance bottleneck of distributed NAS storage system.The file operation method includes: to generate the Hash table of CephFS share directory when configuring CephFS share directory in CephFS the CIFS share directory of client;Wherein, Hash table includes the ltsh chain table of multiple nodes for storage file name;Receive include the file operation requests of file destination name transmitted by the file in client operation CIFS share directory when, the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash is determined according to the cryptographic Hash of file destination name;By the node of the gauge outfit, determine whether be stored with file destination name in the node of the corresponding ltsh chain table of cryptographic Hash, and the corresponding file operation of file operation requests is executed according to determining storage result.

Description

A kind of method and apparatus of file operation
Technical field
This application involves technical field of distributed memory, in particular to a kind of method and apparatus of file operation.
Background technique
Currently, the rise of the emerging services such as cloud computing, Internet of Things and social networks so that data class and data scale just Increase at an unprecedented rate, big data era formally arrives.The scale effect of big data has been come greatly to data tape Challenge.Network Attached Storage (Network Attached Storage, NAS) based on file-level shared access stores system System be widely used, distributed NAS storage system due to its memory capacity can linear expansion, in the storage of file data just Play the part of more and more important role.
In the prior art, the realization of the distributed NAS storage system based on Ceph file system is as shown in Figure 1, Ceph is literary Part system (Ceph File System, CephFS) is as the NAS Virtual Service that the storage system of bottom is in NAS storage system All NAS nodes provide storage service in device (NAS Virtual Server), and NAS node arrangement has Samba service, NAS It is connected each other between node (node) by cluster simple data library (cluster temple data base, ctdb) technology, Network storage service is provided a user based on Samba service simultaneously.Samba allows Linux to take as a kind of Network File System It is communicated between business device and Windows product, makes it possible cross-platform exchanging visit.
The operating system of client (client) is generally Windows operating system, used in Windows operating system Filename case-insensitive (i.e. file A in New Technology File System (New Technology File System, NTFS) It is considered as same file with file a), and the filename in CephFS is to discriminate between capital and small letter that (i.e. file A and file a is recognized To be different file), thus the Universal Internet File System of client (Common Internet File System, CIFS) the file A in share directory, may be considered file A in CephFS may also be considered as file a.Work as client When carrying out file operation in CIFS share directory, it is necessary first to confirm corresponding text in the CephFS share directory of CephFS Part whether there is, and is in the prior art total to the filename of the file operated in CIFS share directory with CephFS based on Samba The filename for enjoying the All Files of catalogue is compared, and comparison result is replied to window client.As CephFS is shared The filename traversal matching way of the continuous growth of quantity of documents in catalogue, the mode based on present technology deposits distributed NAS The efficiency linear decline that file in storage system is operated, so as to cause the performance bottleneck of distributed NAS storage system.
Summary of the invention
In view of this, a kind of method and apparatus for being designed to provide file operation of the application, for solving present skill Under the efficiency linear that the filename traversal matching way of the mode of art operates the file in distributed NAS storage system Drop, so as to cause distributed NAS storage system performance bottleneck the problem of.
In a first aspect, the embodiment of the present application provides a kind of method of file operation, deposited applied to the NAS based on CephFS The NAS node that preparatory arrangement has Samba to service in storage system;The described method includes:
When CephFS share directory is configured in CephFS the CIFS share directory of client, generate the CephFS The Hash table of share directory;Wherein, the Hash table includes multiple ltsh chain tables, each ltsh chain table includes multiple for depositing Store up the node of filename;
It include file destination receiving transmitted by the file in CIFS share directory described in the client operation When the file operation requests of name, the table of the corresponding ltsh chain table of the cryptographic Hash is determined according to the cryptographic Hash of the file destination name The node of head;
By the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash, the corresponding hash chain of the cryptographic Hash is determined It whether is stored with the file destination name in the node of table, and the file operation requests pair are executed according to determining storage result The file operation answered.
Optionally, the Hash table for generating the CIFS share directory, comprising:
The table name using the directory name of the CephFS share directory as the Hash table is serviced based on the Samba, it is raw It, will be literary if being stored with file in the CephFS share directory at the Hash table of the CephFS share directory Part name is stored in corresponding ltsh chain table according to the corresponding cryptographic Hash of filename.
Optionally, the cryptographic Hash according to the file destination name determines the table of the corresponding ltsh chain table of the cryptographic Hash The node of head, comprising:
It is serviced by the alphabetical upper in the file destination name, after conversion based on the Samba The file destination name generates cryptographic Hash, and the section of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash is determined according to the cryptographic Hash Point.
Optionally, the file operation requests are the file destination of the creation file destination name characterization;
The file destination name, and root whether are stored in the node of the corresponding ltsh chain table of the determination cryptographic Hash The corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared Compared with, if the filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash not with the consistent text of file destination name Part name then shows the not stored file destination to be created of the CephFS share directory, and the file destination name is stored Wound is executed in the CephFS share directory in the corresponding ltsh chain table of the cryptographic Hash, and according to the file destination name Build the file operation of the file destination;Otherwise, show that the CephFS share directory has been stored with the mesh to be created File is marked, the file operation for creating the file destination is terminated.
Optionally, the file operation requests are duplication or the file destination for deleting the file destination name characterization;
The file destination name, and root whether are stored in the node of the corresponding ltsh chain table of the determination cryptographic Hash The corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared Compared with if the filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash has and the consistent file of file destination name Name, then show that the CephFS share directory is stored with the file destination, execute duplication in the CephFS share directory The file operation of the file destination, or will be with node where the consistent filename of the file destination name by the cryptographic Hash It is deleted in corresponding ltsh chain table, and executes the file operation for deleting the file destination in the CephFS share directory; Otherwise, showing that the CephFS share directory is not stored has the file destination that is to be copied or deleting, terminates duplication or deletes The file operation of the file destination.
In the embodiment of the present application, the CIFS that CephFS share directory is configured to client is shared into mesh in CephFS When record, by generating the Hash table for the CephFS share directory, according to the file in the CephFS share directory The cryptographic Hash that filename generates, filename can be uniformly distributed in the ltsh chain table of the Hash table, shared in CIFS When carrying out file operation in catalogue, it is corresponding cryptographic Hash can quickly to be positioned in the Hash table according to the file destination name Ltsh chain table simultaneously confirms whether the file destination name has been stored in the CephFS share directory, and depositing according to confirmation It stores up result and executes the corresponding file operation of the file operation requests.All texts to the entire CIFS share directory are not needed The filename of part carries out traversal formula matching, improves the efficiency operated to the file in distributed NAS storage system, in turn Improve the performance of distributed NAS storage system.
Second aspect, the embodiment of the present application provide a kind of device of file operation, store system as the NAS based on CephFS The NAS node of system, and arrangement has Samba service in advance;Described device includes:
Table generation unit, for configuring CephFS share directory in CephFS the CIFS share directory of client When, generate the Hash table of the CephFS share directory;Wherein, the Hash table includes multiple ltsh chain tables, each Hash Chained list includes multiple nodes for storage file name;
Table node locating unit, for receiving transmitted by the file in CIFS share directory described in the client operation When including the file operation requests of file destination name, the cryptographic Hash pair is determined according to the cryptographic Hash of the file destination name The node of the gauge outfit for the ltsh chain table answered;
Processing unit determines the Hash for by the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash It is worth in the node of corresponding ltsh chain table and whether is stored with the file destination name, and according to determining storage result execution The corresponding file operation of file operation requests.
Optionally, the table generation unit generates the Hash table of the CIFS share directory, comprising:
The table name using the directory name of the CephFS share directory as the Hash table is serviced based on the Samba, it is raw At the CephFS share directory the Hash table and initialize, if being stored with text in the CephFS share directory Filename is then stored in corresponding ltsh chain table by part according to the corresponding cryptographic Hash of filename.
Optionally, the table node locating unit determines the cryptographic Hash pair according to the cryptographic Hash of the file destination name The node of the gauge outfit for the ltsh chain table answered, comprising:
It is serviced by the alphabetical upper in the file destination name, after conversion based on the Samba The file destination name generates cryptographic Hash, determines the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash according to cryptographic Hash described in this Node.
Optionally, the file operation requests are the file destination of the creation file destination name characterization;
The processing unit determines the target text whether is stored in the node of the corresponding ltsh chain table of the cryptographic Hash Part name, and the corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared Compared with, if the filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash not with the consistent text of file destination name Part name then shows the not stored file destination to be created of the CephFS share directory, and the file destination name is stored Wound is executed in the CephFS share directory in the corresponding ltsh chain table of the cryptographic Hash, and according to the file destination name Build the file operation of the file destination;Otherwise, show that the CephFS share directory has been stored with the mesh to be created File is marked, the file operation for creating the file destination is terminated.
Optionally, the file operation requests are duplication or the file destination for deleting the file destination name characterization;
The processing unit determines the target text whether is stored in the node of the corresponding ltsh chain table of the cryptographic Hash Part name, and the corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared Compared with if the filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash has and the consistent file of file destination name Name, then show that the CephFS share directory is stored with the file destination, execute duplication in the CephFS share directory The file operation of the file destination, or will be with node where the consistent filename of the file destination name by the cryptographic Hash It is deleted in corresponding ltsh chain table, and executes the file operation for deleting the file destination in the CephFS share directory; Otherwise, showing that the CephFS share directory is not stored has the file destination that is to be copied or deleting, terminates duplication or deletes The file operation of the file destination.
In the embodiment of the present application, the CIFS that CephFS share directory is configured to client is shared into mesh in CephFS It is that the CephFS share directory generates the Hash table by the table generation unit when record, it is shared according to the CephFS Filename, can be uniformly distributed in the ltsh chain table of the Hash table by the cryptographic Hash that the filename of the file in catalogue generates In, when carrying out file operation in CIFS share directory, the table node locating unit can exist according to the file destination name The corresponding ltsh chain table of cryptographic Hash is quickly positioned in the Hash table and confirms whether the file destination name has been stored in institute It states in CephFS share directory, and the file operation requests is executed according to the storage result of confirmation by the processing unit and are corresponded to File operation.It does not need to carry out traversal formula matching to the filename of the All Files of the entire CIFS share directory, improve Efficiency that file in distributed NAS storage system is operated, and then improve the performance of distributed NAS storage system.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the structural schematic diagram of the distributed NAS storage system of the prior art;
Fig. 2 is a kind of flow diagram of the method for file operation provided by the embodiments of the present application;
Fig. 3 is the schematic diagram for the Hash table that the embodiment of the present application provides;
Fig. 4 is a kind of schematic diagram of the device of file operation provided by the embodiments of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application Middle attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only It is some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is real The component for applying example can be arranged and be designed with a variety of different configurations.Therefore, below to the application's provided in the accompanying drawings The detailed description of embodiment is not intended to limit claimed scope of the present application, but is merely representative of the selected reality of the application Apply example.Based on embodiments herein, those skilled in the art institute obtained without making creative work There are other embodiments, shall fall in the protection scope of this application.
As shown in Fig. 2, being deposited the invention relates to a kind of method of file operation applied to the NAS based on CephFS The NAS node that preparatory arrangement has Samba to service in storage system;This method comprises:
101, when CephFS share directory is configured in CephFS the CIFS share directory of client, generate CephFS The Hash table of share directory;Wherein, Hash table includes multiple ltsh chain tables, each ltsh chain table includes multiple for storing text The node of part name.
Optionally, NAS node generates the Hash table of CIFS share directory, comprising:
The table name using the directory name of CephFS share directory as Hash table is serviced based on Samba, it is shared to generate CephFS The Hash table of catalogue, if being stored with file in CephFS share directory, by filename according to the corresponding Hash of filename Value is stored in corresponding ltsh chain table.
It should be noted that Hash table is the data structure directly to be accessed according to key value (Key value). In the present embodiment, Hash table can be an array of pointers, and each of array of pointers element is all a direction Hash The pointer of the gauge outfit node of chained list.And " key " is filename, the index of array is pointer, is reflected filename by hash function Some pointer become in array of pointers is penetrated, corresponding filename can be found in the ltsh chain table that pointer is directed toward.Such as Fig. 3 Shown, NAS node generates a Hash table in the caching of the process of Samba, according to the text of the file in Ceph share directory The cryptographic Hash that part name generates will be evenly distributed in ltsh chain table, wherein 0,1,2,3,4,5 and 6 indicate array of pointers, number Each member of group includes a pointer, and pointer is directed toward the gauge outfit of ltsh chain table, filename1, filename3, filename2 Filename with filename4 to be stored in the node of ltsh chain table.Obvious filename1, filename2 and filename institute Node be corresponding ltsh chain table gauge outfit node, filename1 and filename3 are stored in same ltsh chain table.
102, it include file destination name receiving transmitted by the file in client operation CIFS share directory When file operation requests, the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash is determined according to the cryptographic Hash of file destination name.
Optionally, the node of the gauge outfit of ltsh chain table is determined according to the cryptographic Hash of file destination name, comprising:
It is serviced based on Samba by the alphabetical upper in file destination name, according to the file destination after conversion Name generates cryptographic Hash, and the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash is determined according to the cryptographic Hash.
103, by the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash, determine the corresponding ltsh chain table of cryptographic Hash It whether is stored with file destination name in node, and the corresponding file of file operation requests is executed according to determining storage result and is grasped Make.
File operation requests such as can be to look for, create, replicate or delete at the operation, for different file operations, be based on Present invention thought can have different embodiments, be exemplified below:
For example, file operation requests are when creating the file destination of file destination name characterization, to determine the corresponding Kazakhstan of cryptographic Hash Whether file destination name is stored in the node of uncommon chained list, and corresponding according to determining storage result execution file operation requests File operation, comprising: the filename stored in the node of file destination name ltsh chain table corresponding with cryptographic Hash is compared, If the filename stored in the node of the corresponding ltsh chain table of cryptographic Hash with the consistent filename of file destination name, does not show File destination name is stored in the corresponding ltsh chain table of cryptographic Hash by the not stored file destination to be created of CephFS share directory In, and the file operation for creating file destination is executed in CephFS share directory according to file destination name;Otherwise, show CephFS share directory has been stored with file destination to be created, terminates the file operation of creation file destination.
In another example file operation requests be duplication or delete target filename characterization file destination when, determine cryptographic Hash It whether is stored with file destination name in the node of corresponding ltsh chain table, and file operation is executed according to determining storage result and is asked Ask corresponding file operation, comprising: the filename that will be stored in the node of file destination name ltsh chain table corresponding with cryptographic Hash It is compared, if the filename stored in the node of the corresponding ltsh chain table of cryptographic Hash has and the consistent file of file destination name Name, then show that CephFS share directory is stored with file destination, and the text of duplication file destination is executed in CephFS share directory Part operation, or will be deleted with node where the consistent filename of file destination name by the corresponding ltsh chain table of cryptographic Hash, and The file operation of delete target file is executed in CephFS share directory;Otherwise, show that CephFS share directory is not stored to need Duplication or the file destination deleted terminate duplication or the file operation of delete target file.
In the embodiment of the present application, CephFS share directory is configured in CephFS the CIFS share directory of client When, by generating Hash table for CephFS share directory, the Kazakhstan generated according to the filename of the file in CephFS share directory Uncommon value, filename can be uniformly distributed in the ltsh chain table of Hash table, file operation is carried out in CIFS share directory When, the corresponding ltsh chain table of cryptographic Hash can be quickly positioned in Hash table according to file destination name and confirm that file destination name is It is no to have been stored in CephFS share directory, and the corresponding file of file operation requests is executed according to the storage result of confirmation and is grasped Make.It does not need to carry out the filename of the All Files of entire CIFS share directory traversal formula matching, improve to distributed NAS The efficiency that file in storage system is operated, and then improve the performance of distributed NAS storage system.
As shown in figure 4, the embodiment of the present application provides a kind of device of file operation, the device is as based on CephFS's The NAS node of NAS storage system, and arrangement has Samba service in advance;Device includes:
Table generation unit 401, for configuring CephFS share directory in CephFS the CIFS share directory of client, Generate the Hash table of CephFS share directory;Wherein, Hash table includes multiple ltsh chain tables, each ltsh chain table includes multiple Node for storage file name;
Table node locating unit 402 is taken transmitted by the file in client operation CIFS share directory for receiving When file operation requests with file destination name, the corresponding ltsh chain table of cryptographic Hash is determined according to the cryptographic Hash of file destination name Gauge outfit node;
Processing unit 403 determines that cryptographic Hash is corresponding for by the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash Ltsh chain table node in whether be stored with file destination name, and file operation requests pair are executed according to determining storage result The file operation answered.
Optionally, table generation unit 401 generates the Hash table of CIFS share directory, comprising:
The table name using the directory name of CephFS share directory as Hash table is serviced based on Samba, it is shared to generate CephFS The Hash table of catalogue and initialization, if file has been stored in CephFS share directory, by filename according to filename pair The cryptographic Hash answered is stored in corresponding ltsh chain table.
Optionally, table node locating unit 402 determines the corresponding hash chain of cryptographic Hash according to the cryptographic Hash of file destination name The node of the gauge outfit of table, comprising:
It is serviced based on Samba by the alphabetical upper in file destination name, according to the file destination after conversion Name generates cryptographic Hash, and the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash is determined according to the cryptographic Hash.
Optionally, file operation requests are the file destination for creating file destination name characterization;
Processing unit 403 determines file destination name whether is stored in the node of the corresponding ltsh chain table of cryptographic Hash, and root The corresponding file operation of file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with cryptographic Hash is compared, if Hash It is worth the filename stored in the node of corresponding ltsh chain table not with the consistent filename of file destination name, then shows CephFS The not stored file destination to be created of share directory, file destination name is stored in the corresponding ltsh chain table of cryptographic Hash, and root The file operation of creation file destination is executed in CephFS share directory according to file destination name;Otherwise, show that CephFS is shared Catalogue has been stored with file destination to be created, terminates the file operation of creation file destination.
Optionally, file operation requests are the file destination of duplication or delete target filename characterization;
Processing unit 403 determines file destination name whether is stored in the node of the corresponding ltsh chain table of cryptographic Hash, and root The corresponding file operation of file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with cryptographic Hash is compared, if Hash Be worth the filename stored in the node of corresponding ltsh chain table have with the consistent filename of file destination name, then show that CephFS is total It enjoys catalogue and is stored with file destination, the file operation of duplication file destination is executed in CephFS share directory, or will be with mesh Node is deleted by the corresponding ltsh chain table of cryptographic Hash where marking the consistent filename of filename, and is held in CephFS share directory The file operation of row delete target file;Otherwise, showing that CephFS share directory is not stored has target text that is to be copied or deleting Part terminates duplication or the file operation of delete target file.
In the embodiment of the present application, the CIFS that CephFS share directory is configured to client is shared into mesh in CephFS It is that CephFS share directory generates Hash table by table generation unit 401, according to the file in CephFS share directory when record The cryptographic Hash that filename generates, filename can be uniformly distributed in the ltsh chain table of the Hash table, shared in CIFS When carrying out file operation in catalogue, table node locating unit 402 can quickly positioning be breathed out in Hash table according to file destination name The uncommon corresponding ltsh chain table of value simultaneously confirms whether file destination name has been stored in CephFS share directory, and by processing unit 403 execute the corresponding file operation of file operation requests according to the storage result of confirmation.It does not need shared to the entire CIFS The filename of the All Files of catalogue carries out traversal formula matching, improves and grasps to the file in distributed NAS storage system The efficiency of work, and then improve the performance of distributed NAS storage system.
In embodiment provided herein, it should be understood that disclosed method and apparatus, it can be by others side Formula is realized.The apparatus embodiments described above are merely exemplary, for example, the division of the unit, only one kind are patrolled Function division is collected, there may be another division manner in actual implementation, in another example, multiple units or components can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in embodiment provided by the present application can integrate in one processing unit, it can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing, in addition, term " the One ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Finally, it should be noted that embodiment described above, the only specific embodiment of the application, to illustrate the application Technical solution, rather than its limitations, the protection scope of the application is not limited thereto, although with reference to the foregoing embodiments to this Shen It please be described in detail, those skilled in the art should understand that: anyone skilled in the art Within the technical scope of the present application, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of the embodiment of the present application technical solution.The protection in the application should all be covered Within the scope of.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.

Claims (10)

1. a kind of method of file operation has Samba to service applied to arrangement preparatory in the NAS storage system based on CephFS NAS node characterized by comprising
When CephFS share directory is configured in CephFS the CIFS share directory of client, it is shared to generate the CephFS The Hash table of catalogue;Wherein, the Hash table includes multiple ltsh chain tables, each ltsh chain table includes multiple for storing text The node of part name;
It include file destination name transmitted by the file in CIFS share directory described in the client operation receiving When file operation requests, the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash is determined according to the cryptographic Hash of the file destination name Node;
By the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash, the corresponding ltsh chain table of the cryptographic Hash is determined Whether the file destination name is stored in node, and corresponding according to the determining storage result execution file operation requests File operation.
2. the method according to claim 1, wherein the Hash for generating the CIFS share directory Table, comprising:
The table name using the directory name of the CephFS share directory as the Hash table is serviced based on the Samba, generates institute The Hash table of CephFS share directory is stated, if file has been stored in the CephFS share directory, by filename It is stored in corresponding ltsh chain table according to the corresponding cryptographic Hash of filename.
3. the method according to claim 1, wherein the cryptographic Hash according to the file destination name determines institute State the node of the gauge outfit of the corresponding ltsh chain table of cryptographic Hash, comprising:
It is serviced by the alphabetical upper in the file destination name, according to after conversion based on the Samba File destination name generates cryptographic Hash, and the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash is determined according to the cryptographic Hash.
4. according to claim 1 to method described in 3 any one, which is characterized in that the file operation requests are creation institute State the file destination of file destination name characterization;
It whether is stored with the file destination name in the node of the corresponding ltsh chain table of the determination cryptographic Hash, and according to true Fixed storage result executes the corresponding file operation of the file operation requests, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared, if The filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash not with the consistent filename of file destination name, Then show the not stored file destination to be created of the CephFS share directory, the file destination name is stored in described In the corresponding ltsh chain table of cryptographic Hash, and executed in the CephFS share directory described in creation according to the file destination name The file operation of file destination;Otherwise, show that the CephFS share directory has been stored with the file destination to be created, Terminate the file operation of the creation file destination.
5. according to claim 1 to method described in 3 any one, which is characterized in that the file operation requests be duplication or Delete the file destination of the file destination name characterization;
It whether is stored with the file destination name in the node of the corresponding ltsh chain table of the determination cryptographic Hash, and according to true Fixed storage result executes the corresponding file operation of the file operation requests, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared, if The filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash have with the consistent filename of file destination name, then Show that the CephFS share directory is stored with the file destination, is executed in the CephFS share directory and replicate the mesh The file operation of file is marked, or will be corresponding by the cryptographic Hash with node where the consistent filename of the file destination name It is deleted in ltsh chain table, and executes the file operation for deleting the file destination in the CephFS share directory;Otherwise, table The bright CephFS share directory is not stored the file destination that is to be copied or deleting, terminates duplication or deletes the target The file operation of file.
6. a kind of device of file operation, as the NAS node of the NAS storage system based on CephFS, and in advance, arrangement has Samba service;It is characterized in that, described device includes:
Table generation unit, it is raw when for configuring CephFS share directory in CephFS the CIFS share directory of client At the Hash table of the CephFS share directory;Wherein, the Hash table includes multiple ltsh chain tables, each ltsh chain table packet Containing multiple nodes for storage file name;
Table node locating unit, for receiving packet transmitted by the file in CIFS share directory described in the client operation When file operation requests containing file destination name, determine that the cryptographic Hash is corresponding according to the cryptographic Hash of the file destination name The node of the gauge outfit of ltsh chain table;
Processing unit determines the cryptographic Hash pair for by the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash It whether is stored with the file destination name in the node for the ltsh chain table answered, and the file is executed according to determining storage result The corresponding file operation of operation requests.
7. device according to claim 6, which is characterized in that the table generation unit generates the CIFS share directory The Hash table, comprising:
The table name using the directory name of the CephFS share directory as the Hash table is serviced based on the Samba, generates institute It states the Hash table of CephFS share directory and initializes, if being stored with file in the CephFS share directory, Filename is stored in corresponding ltsh chain table according to the corresponding cryptographic Hash of filename.
8. device according to claim 6, which is characterized in that the table node locating unit, according to the file destination The cryptographic Hash of name determines the node of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash, comprising:
It is serviced by the alphabetical upper in the file destination name, according to after conversion based on the Samba File destination name generates cryptographic Hash, and the section of the gauge outfit of the corresponding ltsh chain table of the cryptographic Hash is determined according to cryptographic Hash described in this Point.
9. according to device described in claim 6 to 8 any one, which is characterized in that the file operation requests are creation institute State the file destination of file destination name characterization;
The processing unit determines the file destination whether is stored in the node of the corresponding ltsh chain table of the cryptographic Hash Name, and the corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared, if The filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash not with the consistent filename of file destination name, Then show the not stored file destination to be created of the CephFS share directory, the file destination name is stored in described In the corresponding ltsh chain table of cryptographic Hash, and executed in the CephFS share directory described in creation according to the file destination name The file operation of file destination;Otherwise, show that the CephFS share directory has been stored with the file destination to be created, Terminate the file operation of the creation file destination.
10. according to device described in claim 6 to 8 any one, which is characterized in that the file operation requests be duplication or Delete the file destination of the file destination name characterization;
The processing unit determines the file destination whether is stored in the node of the corresponding ltsh chain table of the cryptographic Hash Name, and the corresponding file operation of the file operation requests is executed according to determining storage result, comprising:
The filename stored in the node of file destination name ltsh chain table corresponding with the cryptographic Hash is compared, if The filename stored in the node of the corresponding ltsh chain table of the cryptographic Hash have with the consistent filename of file destination name, then Show that the CephFS share directory is stored with the file destination, is executed in the CephFS share directory and replicate the mesh The file operation of file is marked, or will be corresponding by the cryptographic Hash with node where the consistent filename of the file destination name It is deleted in ltsh chain table, and executes the file operation for deleting the file destination in the CephFS share directory;Otherwise, table The bright CephFS share directory is not stored the file destination that is to be copied or deleting, terminates duplication or deletes the target The file operation of file.
CN201810615147.XA 2018-06-14 2018-06-14 A kind of method and apparatus of file operation Pending CN109062935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810615147.XA CN109062935A (en) 2018-06-14 2018-06-14 A kind of method and apparatus of file operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810615147.XA CN109062935A (en) 2018-06-14 2018-06-14 A kind of method and apparatus of file operation

Publications (1)

Publication Number Publication Date
CN109062935A true CN109062935A (en) 2018-12-21

Family

ID=64820934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810615147.XA Pending CN109062935A (en) 2018-06-14 2018-06-14 A kind of method and apparatus of file operation

Country Status (1)

Country Link
CN (1) CN109062935A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110543448A (en) * 2019-07-22 2019-12-06 深圳壹账通智能科技有限公司 data synchronization method, device, equipment and computer readable storage medium
CN110880986A (en) * 2019-10-30 2020-03-13 烽火通信科技股份有限公司 High-availability NAS storage system based on Ceph
CN112131200A (en) * 2020-09-15 2020-12-25 北京精一强远科技有限公司 Distributed mass file query system and method based on cifs sharing
CN113094336A (en) * 2021-04-01 2021-07-09 中山大学 Cuckoo hash-based file system directory management method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446984A (en) * 2009-01-09 2009-06-03 成都市华为赛门铁克科技有限公司 Method and device for storing files and method and device for deleting files
CN103077199A (en) * 2012-12-26 2013-05-01 北京思特奇信息技术股份有限公司 File resource searching and locating method and device
CN103631915A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Hybrid system file data processing method and system
CN103902577A (en) * 2012-12-27 2014-07-02 中国移动通信集团四川有限公司 Method and system for searching and locating resources
US20150370821A1 (en) * 2004-12-17 2015-12-24 Microsoft Licensing Technology, LLC Quick Filename Lookup Using Name Hash

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150370821A1 (en) * 2004-12-17 2015-12-24 Microsoft Licensing Technology, LLC Quick Filename Lookup Using Name Hash
CN101446984A (en) * 2009-01-09 2009-06-03 成都市华为赛门铁克科技有限公司 Method and device for storing files and method and device for deleting files
CN103077199A (en) * 2012-12-26 2013-05-01 北京思特奇信息技术股份有限公司 File resource searching and locating method and device
CN103902577A (en) * 2012-12-27 2014-07-02 中国移动通信集团四川有限公司 Method and system for searching and locating resources
CN103631915A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Hybrid system file data processing method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110543448A (en) * 2019-07-22 2019-12-06 深圳壹账通智能科技有限公司 data synchronization method, device, equipment and computer readable storage medium
CN110880986A (en) * 2019-10-30 2020-03-13 烽火通信科技股份有限公司 High-availability NAS storage system based on Ceph
CN112131200A (en) * 2020-09-15 2020-12-25 北京精一强远科技有限公司 Distributed mass file query system and method based on cifs sharing
CN113094336A (en) * 2021-04-01 2021-07-09 中山大学 Cuckoo hash-based file system directory management method and system
CN113094336B (en) * 2021-04-01 2022-11-01 中山大学 Cuckoo hash-based file system directory management method and system

Similar Documents

Publication Publication Date Title
CN109062935A (en) A kind of method and apparatus of file operation
US20200117569A1 (en) Graphical user interface for visual correlation of virtual machine information and storage volume information
US9667720B1 (en) Shard reorganization based on dimensional description in sharded storage systems
CN103729225B (en) A kind of telefile real time updating method based on content piecemeal
CN110114751A (en) The ZFS cloud storage of the End to End Encryption of compression and safety
CN103714123B (en) Enterprise's cloud memory partitioning object data de-duplication and restructuring version control method
CN102708165B (en) Document handling method in distributed file system and device
CN104881466B (en) The processing of data fragmentation and the delet method of garbage files and device
US9535630B1 (en) Leveraging array operations at virtualized storage processor level
US20160350302A1 (en) Dynamically splitting a range of a node in a distributed hash table
CN104516974B (en) A kind of management method and device of file system directories item
CN105302668B (en) A kind of method of block device data access performance in optimization object storage system
CN105138281B (en) A kind of sharing method and device of physical disk
CN106484820A (en) A kind of renaming method, access method and device
CN103970875A (en) Parallel repeated data deleting method
CN109522283A (en) A kind of data de-duplication method and system
CN109542861A (en) File management method, device and system
US20230176791A1 (en) Metadata compaction
CN109284273A (en) A kind of mass small documents querying method and system using Suffix array clustering index
CN105677238A (en) Method for distributed storage based data deduplication on virtual machine system disk
CN103326925A (en) Message push method and device
CN108090186A (en) A kind of electric power data De-weight method on big data platform
CN104331525B (en) Sharing method based on data de-duplication
CN109271105A (en) Date storage method and distributed storage cluster applied to distributed storage cluster
CN102902696A (en) Method and equipment for managing content of social network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20181221

RJ01 Rejection of invention patent application after publication