Method and apparatus for reading and writing files of a distributed file system

A distributed file and file technology, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve the problems of high processing load and low efficiency of metadata server, reduce the number of interactions, improve efficiency, simplify The effect of the process

CN104965835AActive Publication Date: 2015-10-07ZHEJIANG DAHUA TECH CO LTD
5 Cites 12 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2015-10-07

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a method and apparatus for reading and writing files of a distributed file system for addressing the problems of low efficiency upon accessing larger files and over-loaded processing of a metadata server of prior art. The method comprises: sending a file establishment request to the metadata server, and receiving a file ID sent back by the metadata server based on the file establishment request, the file ID at least carrying a data node information; converting the file ID to a string file name based on a pre-determined set of coding rules; after having received a file reading and writing request sent by a user by means of the string file name, reverse coding the string file name to the file ID according to the pre-determined set of coding rules; reading and writing a file in a data server indicated by the data node information on the basis of the file ID. By means of the method, the processing load of the metadata server is effectively lowered, the concurrent processing capability of the metadata server is increased and the safety of file accessing and the efficiency of large file accessing are increased.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of file systems, in particular to a method and device for reading and writing files in a distributed file system. Background technique

[0002] A distributed file system means that the physical storage resources managed by the file system are not necessarily directly connected to the local node, but are connected to the node through a computer network. refer to figure 1 As shown, the specific steps of reading and writing files in a traditional distributed file system are as follows:

[0003] Step 100: the client receives the file creation request sent by the user;

[0004] Step 110: the client requests the metadata server to create a file;

[0005] Step 120: the client receives the file ID returned by the metadata server after creating the file in the data server according to the file creation request;

[0006] Step 130: the client encodes the file ID into a character string file name and sends it to the user; ...

Examples

Embodiment Construction

[0073] In order to provide an implementation plan for improving the processing efficiency of the metadata server, the embodiment of the present invention provides a method and device for reading and writing files in a distributed file system, which effectively reduces the processing load of the metadata server and improves the performance of the metadata server. Concurrent processing capabilities improve the security of file access and the efficiency of large file access. Preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0074] refer to figure 2 As shown, in the distributed file system architecture adopted by the present invention, the metadata server performs active-standby switching through a high-availability cluster (High Available, HA) to improve system reliability, wherein HA is an effective solution to ensure business continuity, Generally, there are two or more nodes, and they are divided into acti...