CN107491551B - Method and device for realizing client access of distributed file system - Google Patents

Method and device for realizing client access of distributed file system Download PDF

Info

Publication number
CN107491551B
CN107491551B CN201710764986.3A CN201710764986A CN107491551B CN 107491551 B CN107491551 B CN 107491551B CN 201710764986 A CN201710764986 A CN 201710764986A CN 107491551 B CN107491551 B CN 107491551B
Authority
CN
China
Prior art keywords
file system
root directory
client
export
access
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
CN201710764986.3A
Other languages
Chinese (zh)
Other versions
CN107491551A (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710764986.3A priority Critical patent/CN107491551B/en
Publication of CN107491551A publication Critical patent/CN107491551A/en
Application granted granted Critical
Publication of CN107491551B publication Critical patent/CN107491551B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS

Abstract

The invention discloses a method and a device for realizing client access of a distributed file system, wherein the method comprises the following steps: responding to an access request of a client, and sending a root directory mount request to a file system through an operation interface of the file system; acquiring root directory mount information returned by the file system through the operation interface; and synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the client can conveniently access the file system through the mounting information of the export directories. The method and the device provided by the invention effectively reduce the occupation of the memory of the distributed file system by mounting and improve the stability of the distributed file system and the stability of the service.

Description

Method and device for realizing client access of distributed file system
Technical Field
The invention relates to the field of computer electronics, in particular to a method and a device for realizing client access by a distributed file system.
Background
With the continuous development of the computer electronics field, people pursue larger data storage space and faster computing speed. The distributed file system can meet the requirements of people on mass data storage and calculation. The design of a distributed file system is based on servers and clients. Distributed file systems refer to a file system that manages physical storage resources connected to nodes through a computer network, a typical network may include multiple servers for access by multiple clients.
In the context of a distributed file system, when a client accesses a resource in the file system, a shared directory needs to be exported by a NAS (network attached storage) server, and the client accesses the resource in the file system by mounting the shared directory.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for a distributed file system to implement client access in the prior art. In the existing distributed file system, for an NAS server, when a client needs to access a file system, a corresponding export directory needs to be mounted with the file system once, that is, each export directory corresponds to a client of the file system, and the file system allocates a certain resource to each client. Each client corresponds to a certain resource and occupies a part of the memory space of the distributed file system. The NAS server comprises a plurality of export directories, and the export directories correspond to a plurality of mounts, which occupy a large memory space of the distributed file system, so that the stability of the distributed file system and the stability of services are influenced.
In summary, it can be seen that how to reduce the occupation of the memory of the file system when the client accesses the file system is a problem to be solved at present.
Disclosure of Invention
The invention aims to provide a method and a device for realizing client access of a distributed file system, which are used for solving the problem that in the prior art, a client excessively occupies a memory of the file system when accessing the file system.
In order to solve the above technical problem, the present invention provides a method for a distributed file system to implement client access, including: responding to an access request of a client, and sending a root directory mount request to a file system through an operation interface of the file system; acquiring root directory mount information returned by the file system through the operation interface; and synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the client can conveniently access the file system through the mounting information of the export directories.
Preferably, when the client stops accessing the file system, the root directory of the file system is unloaded.
Preferably, after the root directory of the file system is unloaded, mount information corresponding to the root directory of the file system is released.
Preferably, when the client stops accessing the file system, the mount information corresponding to the export directory is released.
The invention also provides a device for realizing client access of the distributed file system, which comprises:
the request module is used for responding to an access request of a client and sending a root directory mounting request to the file system through an operation interface of the file system;
the receiving module is used for acquiring the root directory mounting information returned by the file system through the operation interface;
a synchronization module: the method is used for synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the client can conveniently access the file system through the mounting information of the export directories.
Preferably, the system further comprises an unloading module, configured to unload the root directory of the file system when the client stops accessing the file system.
Preferably, the system further includes a releasing module, configured to release the mount information corresponding to the root directory of the file system after the root directory of the file system is unloaded.
Preferably, when the client stops accessing the file system, the release module releases the mount information corresponding to the export directory.
The invention provides a method and a device for realizing client access of a distributed file system.A root directory mounting request is sent to an operation interface of the file system when a client needs to access the file system, and the file system returns root directory information through the operation interface; by utilizing the method and the device provided by the invention, the mounting information of the root directory is synchronized into a plurality of export directories to form the mounting information corresponding to the export directories, and the client can access the file system according to the mounting information.
According to the method and the device, when the client accesses the file system, the mounting information of the corresponding export directories is the same as that of the root directory, and the export directories are mounted only once, so that the occupation of the mounting on the memory of the distributed file system is effectively reduced, and the stability of the distributed file system and the stability of the service are improved.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a diagram illustrating a method for a distributed file system to implement client access in the prior art;
FIG. 2 is a flowchart of a first embodiment of a method for implementing client access in a distributed file system according to the present invention;
FIG. 3 is a schematic flow chart of FIG. 2;
FIG. 4 is a flowchart of a second embodiment of a method for implementing client access in a distributed file system according to the present invention;
fig. 5 is a block diagram of a device for implementing client access in a distributed file system according to an embodiment of the present invention;
fig. 6 is a flow chart illustrating the operation of the apparatus for enabling client access to the distributed file system provided in fig. 5.
Detailed Description
The core of the invention is to provide a method and a device for realizing client access of a distributed file system, which effectively reduce the occupation of a mount on a memory of the distributed file system.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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.
Referring to fig. 2 and fig. 3, fig. 2 is a flowchart illustrating a method for implementing client access in a distributed file system according to a first embodiment of the present invention; FIG. 3 is a schematic flow chart of FIG. 2; the first embodiment comprises the following steps:
step S201: responding to an access request of a client, and sending a root directory mount request to a file system through an operation interface of the file system;
the operation interface of the file system refers to a communication protocol between servers.
Step S202: acquiring root directory mount information returned by the file system through the operation interface;
step S203: and synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the client can conveniently access the file system through the mounting information of the export directories.
The number of the clients and the export directories is the same and is not limited.
As shown in fig. 3, in this embodiment, the NAS server requests mount of a root export directory of the file system; the file system returns root directory mounting information to the NAS server through the operation interface, and the client can access the file system through the root directory mounting information of the root export directory; the NAS server synchronizes the mounting information of the root directory to the export directory so that the client can access the file system through the mounting information in the export directory.
In the prior art, if the number of clients to be accessed is n, the number of corresponding export directories is also n, the memory allocated to each mount client of the file system is x, and n clients occupy n × x memories.
In this embodiment, no matter how many clients and the corresponding number of exported directories, the NAS server only mounts the root directory of the file system, that is, only occupies the memory of size x of the file system, so that the occupation of the memory of the distributed file system by mounting is effectively reduced, and the stability of the distributed file system and the stability of the service are improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for implementing client access in a distributed file system according to a second embodiment of the present invention.
On the basis of the first specific embodiment, in this specific embodiment, when the client stops accessing, the steps of uninstalling and/or releasing the mount information of the root directory are added, which specifically include the following steps:
step S401: starting the NAS server;
step S402: responding to an access request of a client, and sending a root directory mount request to a file system through an operation interface of the file system;
step S403: acquiring root directory mount information returned by the file system through the operation interface;
step S404: synchronizing the root directory mounting information to a plurality of export directories to form mounting information corresponding to the export directories;
step S405: the client accesses the file system according to the mount information on the corresponding export directory;
step S406: the client stops accessing the file system and unloads the root export directory;
step S407: releasing the mounting information of the root directory;
step S408: and releasing the mounting information corresponding to the plurality of export directories.
In practical application, whether the root export directory is unloaded or not can be selected according to requirements, and the occupation of the memory of the NAS server can be reduced by unloading the root export directory after the root export directory is not needed. When the client end finishes accessing the file system, the root directory mount information can be released, and the memory occupied by the root directory mount information is released. Correspondingly, the directory mounting information can be released, and more memory space is saved. Of course, the time for unloading the root export directory, releasing the root directory mount information, and releasing the mount information corresponding to the export directory is not limited, and may be performed step by step, or may be performed any two steps or may be performed three steps at the same time. The time sequence of unloading the root export directory, releasing the root directory mount information, and releasing the mount information corresponding to the export directory, or the number of steps executed therein does not affect the implementation of the present embodiment.
Referring to fig. 5, fig. 5 is a block diagram illustrating a structure of a device for implementing client access by a distributed file system according to an embodiment of the present invention; the specific device may include:
a request module 100, configured to respond to an access request of a client, and send a root directory mount request to a file system through an operation interface of the file system;
a receiving module 200, configured to obtain, through the operation interface, root directory mount information returned by the file system;
the synchronization module 300: the method is used for synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the client can conveniently access the file system through the mounting information of the export directories.
In the specific implementation of the device, the device further comprises:
an uninstalling module 400, configured to uninstall the root directory of the file system when the client stops accessing the file system;
the releasing module 500 is configured to release the root directory mount information and/or the mount information corresponding to the export directory after the root directory of the file system is unloaded.
The request module 100 and the receiving module 200 may be collectively referred to as a docking module 600. A module that implements mount of a root directory of a file system and acquires mount information of the root directory returned by the file system may be a docking module.
The device for realizing the client access by the distributed file system provided by the embodiment of the invention is introduced below, and the device for realizing the client access by the distributed file system described below and the method for realizing the client access by the distributed file system described above can be referred to correspondingly.
The device for implementing client access by using a distributed file system of this embodiment is used to implement the method for implementing client access by using a distributed file system, and therefore, specific embodiments in the device for implementing client access by using a distributed file system may refer to the foregoing embodiment parts of the method for implementing client access by using a distributed file system, for example, the request module 100, the receiving module 200, and the synchronization module 300, which are respectively used to implement steps S101, S102, and S103 in the method for implementing client access by using a distributed file system, and therefore, the specific embodiments thereof may refer to descriptions of corresponding embodiments of each part, and are not described herein again.
Referring to fig. 6, fig. 6 is a flowchart illustrating a workflow of an apparatus for implementing client access in the distributed file system provided in fig. 5.
When a plurality of clients need to access the file system, the docking module 600 in the NAS server requests to mount a root directory of the file system and obtains root directory mounting information; the synchronization module 300 synchronizes the root directory mount information to a plurality of export directories, and the client can access the file system through the corresponding export directories; when the client stops accessing, the offload module 400 offloads the root export directory as required; the releasing module 500 releases the mounting information of the root directory and/or the mounting information corresponding to the export directory. Therefore, when a plurality of clients need to access the file system, the NAS server only needs to mount the file system once, so that the occupation of the memory of the distributed file system by mounting is effectively reduced, and the stability of the distributed file system and the stability of the service are improved.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 invention.
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 reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method and the device for realizing client access of the distributed file system provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. A method for realizing client access by a distributed file system is characterized by comprising the following steps:
responding to access requests of a plurality of clients, and sending a root directory mount request to a file system through an operation interface of the file system;
acquiring root directory mount information returned by the file system through the operation interface;
and synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the clients can access the file system through the mounting information of the export directories.
2. The method of claim 1, further comprising: and when the client stops accessing the file system, unloading the root directory of the file system.
3. The method of claim 2, wherein the uninstalling the root directory of the file system further comprises: and releasing the mounting information corresponding to the root directory of the file system.
4. The method of any of claims 1 to 3, further comprising: and when the client stops accessing the file system, releasing the mount information corresponding to the export directory.
5. An apparatus for a distributed file system to achieve client access, comprising:
the request module is used for responding to access requests of a plurality of clients and sending a root directory mount request to the file system through an operation interface of the file system;
the receiving module is used for acquiring the root directory mounting information returned by the file system through the operation interface;
a synchronization module: the file system management system is used for synchronizing the mounting information of the root directory to a plurality of export directories to form the mounting information corresponding to the export directories, so that the clients can access the file system through the mounting information of the export directories.
6. The apparatus of claim 5, further comprising:
and the unloading module is used for unloading the root directory of the file system when the client stops accessing the file system.
7. The apparatus of claim 6, further comprising:
and the release module is used for releasing the mounting information corresponding to the root directory of the file system after the root directory of the file system is unloaded.
8. The apparatus of claim 7, further comprising: and when the client stops accessing the file system, the release module releases the mount information corresponding to the export directory.
CN201710764986.3A 2017-08-30 2017-08-30 Method and device for realizing client access of distributed file system Active CN107491551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710764986.3A CN107491551B (en) 2017-08-30 2017-08-30 Method and device for realizing client access of distributed file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710764986.3A CN107491551B (en) 2017-08-30 2017-08-30 Method and device for realizing client access of distributed file system

Publications (2)

Publication Number Publication Date
CN107491551A CN107491551A (en) 2017-12-19
CN107491551B true CN107491551B (en) 2021-04-06

Family

ID=60645704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710764986.3A Active CN107491551B (en) 2017-08-30 2017-08-30 Method and device for realizing client access of distributed file system

Country Status (1)

Country Link
CN (1) CN107491551B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920628B (en) * 2018-06-29 2022-02-18 郑州云海信息技术有限公司 Distributed file system access method and device adaptive to big data platform
CN116501713B (en) * 2023-06-26 2023-09-22 成都谐盈科技有限公司 Method for realizing distributed file system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491155A (en) * 2013-09-17 2014-01-01 北京思特奇信息技术股份有限公司 Cloud computing method and system for achieving mobile computing and obtaining mobile data
CN104580517A (en) * 2015-01-27 2015-04-29 浪潮集团有限公司 HDFS (Hadoop distributed file system)-based access method and system and user local system equipment
CN106682227A (en) * 2017-01-06 2017-05-17 郑州云海信息技术有限公司 Log data storage system based on distributed file system and reading-writing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064927B (en) * 2012-12-21 2016-10-05 曙光信息产业(北京)有限公司 The data access method of distributed file system and device
CN103473062B (en) * 2013-09-13 2017-01-18 Tcl移动通信科技(宁波)有限公司 Method and system for mobile terminal customization based on user space file system
US9632892B1 (en) * 2015-03-30 2017-04-25 EMC IP Holding Company LLC NFS cluster failover
CN106709056B (en) * 2017-01-09 2020-11-20 苏州浪潮智能科技有限公司 Nfs mount directory export method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491155A (en) * 2013-09-17 2014-01-01 北京思特奇信息技术股份有限公司 Cloud computing method and system for achieving mobile computing and obtaining mobile data
CN104580517A (en) * 2015-01-27 2015-04-29 浪潮集团有限公司 HDFS (Hadoop distributed file system)-based access method and system and user local system equipment
CN106682227A (en) * 2017-01-06 2017-05-17 郑州云海信息技术有限公司 Log data storage system based on distributed file system and reading-writing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于RT-Thread的NANDFLASH文件系统中间层的设计与实现;司梦如;《中国优秀硕士学位论文全文数据库 信息科技辑》;20121015(第 10 期);I137-73 *

Also Published As

Publication number Publication date
CN107491551A (en) 2017-12-19

Similar Documents

Publication Publication Date Title
CN106210147B (en) Load balancing method and device based on polling
CN109768871B (en) Method for configuring multiple virtual network cards, host machine and storage medium
US9667750B2 (en) Client-initiated leader election in distributed client-server systems
US11157457B2 (en) File management in thin provisioning storage environments
CN108023953B (en) High-availability implementation method and device for FTP service
CN106713493B (en) System and method for constructing distributed file in computer cluster environment
CN109151028A (en) A kind of distributed memory system disaster recovery method and device
CN107172214B (en) Service node discovery method and device with load balancing function
CN107124469B (en) Cluster node communication method and system
EP2709337B1 (en) Service data processing method, device and system
CN107491551B (en) Method and device for realizing client access of distributed file system
CN111064786B (en) Account identifier management method and device
CN106686117B (en) Data storage processing system and method of distributed computing cluster
CN110515728B (en) Server scheduling method and device, electronic equipment and machine-readable storage medium
CN111225003B (en) NFS node configuration method and device
CN106709056B (en) Nfs mount directory export method and device
CN113971163A (en) Small file merging storage method, small file reading method and server
CN108829340B (en) Storage processing method, device, storage medium and processor
WO2023010948A1 (en) Cloud desktop data migration method, service node, management node, server, electronic device, and computer-readable storage medium
CN112597406A (en) File transmission method and device, terminal equipment and storage medium
CN115826845A (en) Storage resource allocation method and device, storage medium and electronic device
CN116668372B (en) Flow control method and related device
CN103973750A (en) User authentication system of cloud computing system
CN113873052B (en) Domain name resolution method, device and equipment of Kubernetes cluster
CN116155890B (en) Method and device for realizing distributed file system

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