[go: up one dir, main page]

CN107944010B - Method and device for reading and writing files in distributed file system - Google Patents

Method and device for reading and writing files in distributed file system Download PDF

Info

Publication number
CN107944010B
CN107944010B CN201711296507.6A CN201711296507A CN107944010B CN 107944010 B CN107944010 B CN 107944010B CN 201711296507 A CN201711296507 A CN 201711296507A CN 107944010 B CN107944010 B CN 107944010B
Authority
CN
China
Prior art keywords
file
read
storage path
write
request
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.)
Active
Application number
CN201711296507.6A
Other languages
Chinese (zh)
Other versions
CN107944010A (en
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.)
Sina Technology China Co Ltd
Original Assignee
Sina Technology China 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 Sina Technology China Co Ltd filed Critical Sina Technology China Co Ltd
Priority to CN201711296507.6A priority Critical patent/CN107944010B/en
Publication of CN107944010A publication Critical patent/CN107944010A/en
Application granted granted Critical
Publication of CN107944010B publication Critical patent/CN107944010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

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

The embodiment of the invention provides a method and a device for reading and writing files in a distributed file system, wherein the method comprises the following steps: creating a first file storage path in each server of the server cluster, and mounting a second file storage path based on a preset file access interface; hijacking the file read-write request when receiving the file read-write request aiming at each server, and determining the read-write type of the file read-write request; and according to the determined read-write type of the file read-write request, executing file reading operation corresponding to the file read-write request through the first file storage path or executing file writing operation corresponding to the file read-write request through the second file storage path. The invention realizes the separation of the file read-write request, and simultaneously realizes the direct read-write of the local file system without a network when reading the file, thereby greatly improving the performance of the read-write of the file.

Description

Method and device for reading and writing files in distributed file system
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for reading and writing files in a distributed file system.
Background
At present, a distributed File System mainly includes two categories, namely object storage and block storage, wherein the two categories generally provide some Portable Operating System Interfaces (POSIX) and mount the provided POSIX onto an Operating System, so as to facilitate users to access the Operating System, such as a distributed File System (Gluster File System) and a distributed File System (Ceph File System). However, in all similar file systems at present, when reading and writing files through the POSIX interface, a server actually storing the files must be accessed through a network, so as to read the corresponding files.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: in practical application, the number of times of reading requests for files is far greater than the number of times of writing requests for files, the ratio can reach 1000:1, and when a large number of small files are required, the file reading and writing mode of the distributed file system in the prior art is not efficient and relatively slow.
Therefore, a file reading and writing method for a distributed file system is needed to achieve efficient, fast and accurate reading and writing of files.
Disclosure of Invention
The embodiment of the invention provides a method and a device for reading and writing files in a distributed file system, which greatly improve the reading and writing performance of the files under the condition that a large number of files exist.
In one aspect, an embodiment of the present invention provides a method for reading and writing a file in a distributed file system, where the distributed file system is deployed in a server cluster, and the method includes:
creating a first file storage path in each server of the server cluster, and mounting a second file storage path based on a preset file access interface;
hijacking the file read-write request when receiving the file read-write request aiming at each server, and determining the read-write type of the file read-write request;
and according to the determined read-write type of the file read-write request, executing file reading operation corresponding to the file read-write request through the first file storage path or executing file writing operation corresponding to the file read-write request through the second file storage path.
On the other hand, an embodiment of the present invention provides a device for reading and writing a file in a distributed file system, where the distributed file system is deployed in a server cluster, and the device includes:
the system comprises a creating and mounting unit, a file access interface and a file storage unit, wherein the creating and mounting unit is used for creating a first file storage path in each server of a server cluster and mounting a second file storage path based on a preset file access interface;
the hijacking unit is used for hijacking the file read-write request when receiving the file read-write request aiming at each server and determining the read-write type of the file read-write request;
and the execution unit is used for executing the file reading operation corresponding to the file reading and writing request through the first file storage path or executing the file writing operation corresponding to the file reading and writing request through the second file storage path according to the determined reading and writing type of the file reading and writing request.
The technical scheme has the following beneficial effects: creating a first file storage path in each server of the server cluster, mounting a second file storage path based on a preset file access interface, and providing necessary precondition guarantee for realizing reading and writing of the separated files; according to the determined read-write type of the file read-write request, the file read operation corresponding to the file read-write request is executed through the first file storage path or the file write operation corresponding to the file read-write request is executed through the second file storage path, so that the separation of the file read-write request is realized, and meanwhile, when the file is read, a local file system can be directly read and written without a network, so that the performance of reading and writing the file is greatly improved, the situations of low efficiency and slow speed of reading and writing the file under the condition of a large number of files are avoided, and further, the use experience of a user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for reading and writing files in a distributed file system according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a device for reading and writing files in a distributed file system according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating an architecture of a server cluster of the distributed file system in accordance with a preferred embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a file read-write flow in a server of a server cluster according to another preferred embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, which is a flowchart of a method for reading and writing a file in a distributed file system according to an embodiment of the present invention, where the distributed file system is deployed in a server cluster, the method includes:
101. creating a first file storage path in each server of the server cluster, and mounting a second file storage path based on a preset file access interface;
102. hijacking the file read-write request when receiving the file read-write request aiming at each server, and determining the read-write type of the file read-write request;
103. and according to the determined read-write type of the file read-write request, executing file reading operation corresponding to the file read-write request through the first file storage path or executing file writing operation corresponding to the file read-write request through the second file storage path.
Preferably, the creating, in each server of the server cluster, a first file storage path and mounting a second file storage path based on a predetermined file access interface includes:
the method comprises the steps of creating a first file storage path in each server of a server cluster through a replication mode provided by a file storage service of a distributed file system, and mounting a second file storage path based on a preset file access interface, wherein the distributed file system comprises a distributed file system GlusterFS.
Optionally, the method further comprises:
in the plurality of servers of the server cluster, any two servers communicate with each other through the respective file storage services of the any two servers.
Preferably, the executing, according to the determined read-write type of the file read-write request, a file read operation corresponding to the file read-write request through the first file storage path or a file write operation corresponding to the file read-write request through the second file storage path includes:
and when the read-write type of the file read-write request is determined to be a read type, executing file reading operation corresponding to the file read-write request through the first file storage path.
Preferably, the executing, according to the determined read-write type of the file read-write request, a file read operation corresponding to the file read-write request through the first file storage path or a file write operation corresponding to the file read-write request through the second file storage path includes:
when the read-write type of the file read-write request is determined to be a write type, judging whether a request path in the file read-write request is the first file storage path or not;
if so, replacing a request path in the file read-write request with the second file storage path;
and executing the file writing operation corresponding to the file reading and writing request through the second file storage path.
As shown in fig. 2, a schematic structural diagram of a device for reading and writing a file in a distributed file system according to another embodiment of the present invention is shown, where the distributed file system is deployed in a server cluster, and includes:
the system comprises a creating and mounting unit, a file access interface and a file storage unit, wherein the creating and mounting unit is used for creating a first file storage path in each server of a server cluster and mounting a second file storage path based on a preset file access interface;
the hijacking unit is used for hijacking the file read-write request when receiving the file read-write request aiming at each server and determining the read-write type of the file read-write request;
and the execution unit is used for executing the file reading operation corresponding to the file reading and writing request through the first file storage path or executing the file writing operation corresponding to the file reading and writing request through the second file storage path according to the determined reading and writing type of the file reading and writing request.
Preferably, the creation and mounting unit is specifically adapted to
The method comprises the steps of creating a first file storage path in each server of a server cluster through a replication mode provided by a file storage service of a distributed file system, and mounting a second file storage path based on a preset file access interface, wherein the distributed file system comprises a distributed file system GlusterFS.
Preferably, the execution unit includes:
and the first execution module is used for executing the file reading operation corresponding to the file reading and writing request through the first file storage path when the reading and writing type of the file reading and writing request is determined to be the reading type.
Preferably, the execution unit includes:
the judging module is used for judging whether a request path in the file read-write request is the first file storage path or not when the read-write type of the file read-write request is determined to be the write type;
the replacing module is used for replacing the request path in the file reading and writing request with the second file storage path if the request path is the second file storage path;
and the second execution module is used for executing the file writing operation corresponding to the file reading and writing request through the second file storage path.
The technical scheme of the embodiment of the invention has the following beneficial effects: creating a first file storage path in each server of the server cluster, mounting a second file storage path based on a preset file access interface, and providing necessary precondition guarantee for realizing reading and writing of the separated files; according to the determined read-write type of the file read-write request, the file read operation corresponding to the file read-write request is executed through the first file storage path or the file write operation corresponding to the file read-write request is executed through the second file storage path, so that the separation of the file read-write request is realized, and meanwhile, when the file is read, a local file system can be directly read and written without a network, so that the performance of reading and writing the file is greatly improved, the situations of low efficiency and slow speed of reading and writing the file under the condition of a large number of files are avoided, and further, the use experience of a user is improved.
The above technical solutions of the embodiments of the present invention are described in detail below with reference to application examples:
the application example of the invention aims to greatly improve the file reading and writing performance under the condition that a large number of files exist.
As shown in fig. 1, for example, in the server cluster a, an application server Service1, an application server Service2, and an application server Service3 are included; creating a first file storage path, such as "/realpath", in the application server Service1, the application server Service2, and the application server Service3 of the server cluster a, and mounting a second file storage path, such as "/hookpath", based on a predetermined file access interface, such as a POSIX interface; when a file read-write request aiming at each application server in the server cluster A is received, hijacking the file read-write request through the function of LD _ PRELOAD environment variables provided under a Linux operating system and hijacking a file read-write function, and determining the read-write type of the file read-write request; if the read-write type of the file read-write request is a read type, executing a file read operation corresponding to the file read-write request through a first file storage path '/realpath'; and if the read-write type of the file read-write request is the write type, executing file write operation corresponding to the file read-write request through a second file storage path/Hookpath. The architecture diagram of the server cluster refers to fig. 3.
It should be noted that, as can be understood by those skilled in the art, there are various ways of hijacking a file read/write request, and a specific way is taken as an example in the present invention, but the present invention is not limited thereto.
In a preferred embodiment, the creating a first file storage path and mounting a second file storage path based on a predetermined file access interface in each server of the server cluster in step 101 includes: the method comprises the steps of creating a first file storage path in each server of a server cluster through a replication mode provided by a file storage service of a distributed file system, and mounting a second file storage path based on a preset file access interface, wherein the distributed file system comprises a distributed file system GlusterFS.
For example, in each application server of server cluster a, a first file storage path, such as "/realpath", is created in each reference server of server cluster a through a replication schema provided by a file storage service of a distributed file system, such as GlusterFS, and a second file storage path, such as "/hookpath", based on a predetermined file access interface, such as a POSIX interface, is mounted.
It should be noted that, as can be understood by those skilled in the art, the distributed file system GlusterFS is an open-source distributed file system, and has a strong lateral expansion capability, and can support a PB (byte beat) storage capacity and handle thousands of clients by expansion, and the GlusterFS can automatically copy files, such as mirroring or multiple copying, so as to ensure that data can always be accessed, and even can be normally accessed in the event of a hardware failure, and the GlusterFS copy mode is a characteristic, and can also implement changing one-time writing into multiple times writing on all machines. The POSIX standard defines the Interface standard that an operating system should provide for applications, and is a generic name of a series of API (Application Programming Interface) standards defined by IEEE for software to be run on various UNIX operating systems, which is formally called IEEE 1003, and the international standard name ISO/IEC 9945, and is intended to obtain software portability at the source code level, in other words, a program written for one POSIX-compatible operating system should be able to be compiled and executed on any other POSIX operating system, even from another vendor.
In a preferred embodiment, the method further comprises: in the plurality of servers of the server cluster, any two servers communicate with each other through the respective file storage services of the any two servers.
For example, in each application server of the server cluster a, communication between the application server Service1 and the application server Service2 is performed by the file storage Service of the application server Service1 and the file storage Service of the application server Service 2; the communication between the application server Service1 and the application server Service3 is carried out through the file storage Service of the application server Service1 and the file storage Service of the application server Service 3; communication between the application server Service3 and the application server Service2 is performed through the file storage Service of the application server Service3 and the file storage Service of the application server Service 2.
Through the embodiment, the mutual communication among all the servers in the server cluster is realized, so that the same files on all the servers are kept consistent, and the danger of data loss when a certain server has a problem is avoided.
In a preferred embodiment, the step 103, according to the determined read-write type of the file read-write request, performs a file read operation corresponding to the file read-write request through the first file storage path or performs a file write operation corresponding to the file read-write request through the second file storage path, and includes: and when the read-write type of the file read-write request is determined to be a read type, executing file reading operation corresponding to the file read-write request through the first file storage path.
For example, in each application server of the server cluster a, when a file read-write request for the application server Service1 in the server cluster a is received, the file read-write request is hijacked, the read-write type of the file read-write request is determined to be a read type, and then, an operation of reading the file of the application server Service1 corresponding to the file read-write request is performed through the first file storage path "/realpath". Refer to fig. 4 for a schematic diagram of a file read/write flow of the application server Service 1.
In a preferred embodiment, the step 103, according to the determined read-write type of the file read-write request, performs a file read operation corresponding to the file read-write request through the first file storage path or performs a file write operation corresponding to the file read-write request through the second file storage path, and includes: when the read-write type of the file read-write request is determined to be a write type, judging whether a request path in the file read-write request is the first file storage path or not; if so, replacing a request path in the file read-write request with the second file storage path; and executing the file writing operation corresponding to the file reading and writing request through the second file storage path.
For example, in each application server of the server cluster a, when a file read-write request for the application server Service1 in the server cluster a is received, the file read-write request is hijacked, the read-write type of the file read-write request is determined to be a write type, and then, whether a request path in the file read-write request is a first file storage path "/realpath" is determined; if so, replacing the request path in the file read-write request with a second file storage path "/hookpath"; and executing the operation of writing the file of the application server Service1 corresponding to the file read-write request through the second file storage path "/hookpath". After the mounting is completed, for example, when a file is written into the directory "/hookpath" of the application server Service1 through the POSIX interface, the written file is copied and written into the first file storage path "/realpath" of each of the other machines of the entire system, including the application server Service2 and the application server Service3, so as to ensure that the same file on each server is consistent, thereby avoiding the risk of data loss when a problem occurs in a certain server. Refer to fig. 4 for a schematic diagram of a file read/write flow of the application server Service 1.
The embodiment of the present invention provides a device for reading and writing a file in a distributed file system, which can implement the method embodiment provided above, and for specific function implementation, reference is made to the description in the method embodiment, which is not repeated herein.
It should be understood that the specific order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not intended to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. To those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
What has been described above includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, to the extent that the term "includes" is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term "comprising" as "comprising" is interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean a "non-exclusive or".
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or elements, described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for reading and writing files in a distributed file system is characterized in that the distributed file system is deployed in a server cluster, and comprises the following steps:
creating a first file storage path in each server of the server cluster, and mounting a second file storage path based on a preset file access interface;
hijacking the file read-write request when receiving the file read-write request aiming at each server, and determining the read-write type of the file read-write request;
according to the determined read-write type of the file read-write request, executing a file reading operation corresponding to the file read-write request through the first file storage path or executing a file writing operation corresponding to the file read-write request through the second file storage path;
and after the file writing operation corresponding to the file reading and writing request is executed through the second file storage path, copying and writing the written files into the first file storage paths of the servers.
2. The method according to claim 1, wherein the creating a first file storage path and mounting a second file storage path based on a predetermined file access interface in each server of the server cluster comprises:
the method comprises the steps of creating a first file storage path in each server of a server cluster through a replication mode provided by a file storage service of a distributed file system, and mounting a second file storage path based on a preset file access interface, wherein the distributed file system comprises a distributed file system GlusterFS.
3. The method of claim 2,
in the plurality of servers of the server cluster, any two servers communicate with each other through the respective file storage services of the any two servers.
4. The method according to claim 1, wherein the performing, according to the determined read-write type of the file read-write request, a file read operation corresponding to the file read-write request through the first file storage path or a file write operation corresponding to the file read-write request through the second file storage path includes:
and when the read-write type of the file read-write request is determined to be a read type, executing file reading operation corresponding to the file read-write request through the first file storage path.
5. The method according to claim 1, wherein the performing, according to the determined read-write type of the file read-write request, a file read operation corresponding to the file read-write request through the first file storage path or a file write operation corresponding to the file read-write request through the second file storage path includes:
when the read-write type of the file read-write request is determined to be a write type, judging whether a request path in the file read-write request is the first file storage path or not;
if so, replacing a request path in the file read-write request with the second file storage path;
and executing the file writing operation corresponding to the file reading and writing request through the second file storage path.
6. An apparatus for reading and writing a file in a distributed file system, wherein the distributed file system is deployed in a server cluster, comprising:
the system comprises a creating and mounting unit, a file access interface and a file storage unit, wherein the creating and mounting unit is used for creating a first file storage path in each server of a server cluster and mounting a second file storage path based on a preset file access interface;
the hijacking unit is used for hijacking the file read-write request when receiving the file read-write request aiming at each server and determining the read-write type of the file read-write request;
the execution unit is used for executing the file reading operation corresponding to the file reading and writing request through the first file storage path or executing the file writing operation corresponding to the file reading and writing request through the second file storage path according to the determined reading and writing type of the file reading and writing request; and after the file writing operation corresponding to the file reading and writing request is executed through the second file storage path, copying and writing the written files into the first file storage paths of the servers.
7. Device according to claim 6, characterized in that said creation and mounting unit is particularly adapted to
The method comprises the steps of creating a first file storage path in each server of a server cluster through a replication mode provided by a file storage service of a distributed file system, and mounting a second file storage path based on a preset file access interface, wherein the distributed file system comprises a distributed file system GlusterFS.
8. The apparatus of claim 7, wherein any two servers in the plurality of servers of the server cluster communicate with each other via respective file storage services of the any two servers.
9. The apparatus of claim 6, wherein the execution unit comprises:
and the first execution module is used for executing the file reading operation corresponding to the file reading and writing request through the first file storage path when the reading and writing type of the file reading and writing request is determined to be the reading type.
10. The apparatus of claim 6, wherein the execution unit comprises:
the judging module is used for judging whether a request path in the file read-write request is the first file storage path or not when the read-write type of the file read-write request is determined to be the write type;
the replacing module is used for replacing the request path in the file reading and writing request with the second file storage path if the request path is the second file storage path;
and the second execution module is used for executing the file writing operation corresponding to the file reading and writing request through the second file storage path.
CN201711296507.6A 2017-12-08 2017-12-08 Method and device for reading and writing files in distributed file system Active CN107944010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711296507.6A CN107944010B (en) 2017-12-08 2017-12-08 Method and device for reading and writing files in distributed file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711296507.6A CN107944010B (en) 2017-12-08 2017-12-08 Method and device for reading and writing files in distributed file system

Publications (2)

Publication Number Publication Date
CN107944010A CN107944010A (en) 2018-04-20
CN107944010B true CN107944010B (en) 2020-11-17

Family

ID=61946285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711296507.6A Active CN107944010B (en) 2017-12-08 2017-12-08 Method and device for reading and writing files in distributed file system

Country Status (1)

Country Link
CN (1) CN107944010B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767263B (en) * 2020-07-04 2022-08-30 武汉空心科技有限公司 Working platform file storage method and system
CN112187875B (en) * 2020-09-09 2022-05-13 苏州浪潮智能科技有限公司 Automatic matching method and system for multi-target cluster mounting strategy of distributed system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457822B1 (en) * 2002-11-01 2008-11-25 Bluearc Uk Limited Apparatus and method for hardware-based file system
CN103248656B (en) * 2012-02-10 2017-04-19 联想(北京)有限公司 Method for achieving data reading and writing as well as DSF (distributed file system) and client side
CN106709048B (en) * 2017-01-05 2019-11-15 无锡江南计算技术研究所 A kind of distributed data method for organizing towards high-performance calculation

Also Published As

Publication number Publication date
CN107944010A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US11687488B2 (en) Directory deletion method and apparatus, and storage server
US8819383B1 (en) Non-disruptive realignment of virtual data
EP1769329B1 (en) Dynamic loading of virtual volume data in a virtual tape server
US9614931B2 (en) Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system
US20080155130A1 (en) Apparatus, method and computer readable medium for disambiguating commands with respect to logical protocols
CN107172070B (en) Resource access processing method and device
US20160246683A1 (en) Clone volume merging
US9674312B2 (en) Dynamic protocol selection
CN107944010B (en) Method and device for reading and writing files in distributed file system
US20160048529A1 (en) Coalescing storage operations
US8806022B2 (en) Establishing communication path group identification for multiple storage devices
US20120084499A1 (en) Systems and methods for managing a virtual tape library domain
US20150381727A1 (en) Storage functionality rule implementation
EP4035009A1 (en) Selecting an error correction code type for a memory device
US11435955B1 (en) System and method for offloading copy processing across non-volatile memory express (NVMe) namespaces
CN110502187A (en) A kind of snapshot rollback method and device
AU2021238984B2 (en) Predictive provisioning of remotely-stored files
CN115098038A (en) Method, device and medium for binding mounted directory
US8688643B1 (en) Systems and methods for adaptively preferring mirrors for read operations
CN101977231A (en) Method for downloading mapping file
US8560789B2 (en) Disk apparatus, data replicating method onto disk apparatus and program recording medium
CA2878759A1 (en) Methods and systems for providing software applications
CN107330065A (en) A kind of MySQL database clone method based on ISER agreements
US11714805B1 (en) Method and system for streaming data from portable storage devices
US20150074301A1 (en) Host bus driver verifying apparatus, host bus verification system, and computer product

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230412

Address after: Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Patentee after: Sina Technology (China) Co.,Ltd.

Address before: 100193 7th floor, scientific research building, Sina headquarters, plot n-1, n-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Patentee before: Sina.com Technology (China) Co.,Ltd.