This application claims priority to Chinese Patent Application No. 202010821009.4, filed on Aug. 14, 2020 in China National Intellectual Property Administration and entitled “File Storage Management Method and System, Device, and Medium”, which is hereby incorporated by reference in its entirety.
The present disclosure relates to a field of NFS (Network File System), in particular to a file storage management method and system, a device, and a storage medium.
On a cloud platform operating system, a user can easily create a shared file storage through a Manila service, and finally complete a creation of an underlying shared file directory under a drive of a corresponding driver. If a file storage is desired to be used in a cloud host, the cloud host shall be entered. A Linux (an operating system) system manually executes a mount command and mounts an export path of the file storage to a local directory before use. A Windows (an operating system) system requires manual mapping of a network driver to a partition and requires account password authentication before use. In addition, if an abnormality such as network interruption or restart of the cloud host occurs, the abnormality needs to be manually repaired, and the export path of the file storage needs to be remounted.
With an increase of cloud hosts in a cloud platform, increasing users may mount an export path of a same file storage, so a cloud platform administrator cannot control or know at present which cloud hosts mount the export path of the file storage, causing the file storage to be unmanageable.
In view of this, in order to overcome at least one aspect of the above problems, some embodiments of the present disclosure provide a file storage management method, including the following steps:
In some embodiments, the sending a mount request to a management platform by using an agent service, and receiving a mount parameter returned by the management platform further includes:
In some embodiments, the method further includes:
In some embodiments, the performing, according to the configuration file, remount in response to an abnormal mount state further includes:
In some embodiments, the method further includes:
In some embodiments, the method further includes:
In some embodiments, the sending a mount request to a management platform by using an agent service, and receiving a mount parameter returned by the management platform further includes:
Based on the same inventive concept, according to another aspect of the present disclosure, some embodiments of the present disclosure further provide a file storage management system, including:
Based on the same inventive concept, according to another aspect of the present disclosure, some embodiments of the present disclosure further provide a computer device, including:
Based on the same inventive concept, according to another aspect of the present disclosure, some embodiments of the present disclosure further provide a computer-readable storage medium storing a computer program that, when executed by a processor, executes the steps of any file storage management method as described above.
The present disclosure has one of the following beneficial technical effects: by means of the solution provided by the present disclosure, the management capability of a management platform for a file system mounted on a cloud host may be improved, and a file storage may be conveniently used without any operation of a user on the cloud host.
In order to describe the technical solutions in the embodiments of the present disclosure or in the prior art more clearly, drawings required to be used in the illustration of the embodiments or the prior art will be briefly introduced below. Apparently, the drawings in the illustration below are only some embodiments of the present application. Those ordinarily skilled in the art also may obtain other drawings according to the provided drawings without creative work.
In order to make objectives, technical solutions and advantages of the present disclosure clearer, embodiments of the present disclosure will be further described in detail below in conjunction with some embodiments and the accompanying drawings.
It should be noted that Manila in the embodiments of the present disclosure provides a file storage service for a cloud platform OpenStack (an open source cloud computing management platform project). File storage NFS is a network file system, and the network file system is one of file systems supported by FreeBSD (a UNIX operating system). By using NFS, users and programs may access files on remote systems as they access local files.
According to one aspect of the present disclosure, some embodiments of the present disclosure provide a file storage management method, as shown in
S1, a mount request is sent to a management platform by using an agent service, and a mount parameter returned by the management platform are received;
S2, the mount parameter is recorded into a configuration file of the agent service; S3, an address of a file storage to be mounted is determined according to the configuration file; and
S4, a file system is mounted in response to a determination that a heartbeat between an address of a cloud host and the address of the file storage to be mounted is normal.
By means of a solution provided by the present disclosure, a management capability of the management platform for the file system mounted on a cloud host may be improved, and the file storage may be conveniently used without any operation of a user on the cloud host.
In some embodiments, step S1 that the mount request is sent to the management platform by using the agent service, and the mount parameter returned by the management platform are received further includes:
Export paths of the file storage returned by the management platform based on a least connections algorithm are received.
In some embodiments, step S1 that the mount request is sent to the management platform by using the agent service, and the mount parameter returned by the management platform are received may further include:
In some embodiments, as shown in
It should be noted that, because the file storage usually has a plurality of export paths, if user's manual mount is required, it is difficult to achieve a load balance among the export paths. Therefore, a mount point mounted least may be selected by using the least connections algorithm for mounting, thereby ensuring a load balance among the export paths.
In some embodiments, S4 that the file system is mounted in response to a normal heartbeat between the address of a cloud host and the address of the file storage to be mounted is as follows: a mount command is executed after the mount parameter is saved by the Agent, where a linux system may execute the mount command, and a Windows system implements mapping into a network driver by invoking a dynamic link library of windows sdk (software development kit).
In some embodiments, the method further includes:
The management platform records the export path, a mounted cloud host, and mount time into a table.
In some embodiments, as shown in
In some embodiments, the method further includes:
A mount state is detected regularly in response to a determination that the file system is successfully mounted; and
Remount is performed according to the configuration file in response to an abnormal mount state.
In some embodiments, as shown in
In some embodiments, the step that remount is performed according to the configuration file in response to the abnormal mount state further includes:
In some embodiments, if a network ping (packet internet groper) between the address of the cloud host and the address of the file storage is blocked or the heartbeat is abnormal, the Agent will not try to mount all the time, but try to remount when the heartbeat is normal. After the cloud host restarts, the Agent starts and mounts the file storage automatically.
In some embodiments, the method further includes: The agent service modifies the configuration file and interrupts a connection with the file storage in response to a determination that receiving an unmount instruction delivered by the management platform.
In some embodiments, as shown in
In some embodiments, the file storage may be created by the management platform, and the cloud host may be created by using a mirror image with the Agent, or the Agent may be manually installed after the cloud host is created. An installation package of different Agents based on a Windows system and a Linux system may be provided, and at the same time, a unified C++ API may be provided to the outside. Service-oriented programming may be implemented on the Windows system, and a light-weighted application may be realized based on a Windows Service and embedded in the Windows system to self-start. On the Linux system, the Agent is registered as a service unit managed by systemd (system daemon), and a boot service is self-started and embedded into a Linux image. The Agent realizes functions such as regular monitoring (by modifying the configuration file), automatic mount, and automatic repair of the shared file storage.
By means of the solution provided by the present disclosure, the file storage may be directly mounted to a cloud host, and export paths of the file storage may be automatically obtained. The file storage usually has a plurality of export paths, and if user's manual mount is required, it is difficult to achieve a load balance among the export paths. Therefore, a mount point mounted least may be selected by using the least connections algorithm for mounting, thereby ensuring a load balance among the export paths. A cloud platform sends a mount request to a Manila service through a Manila REST API and records mount information; then the Nova service (novaclient, a client of Nova) is invoked to forward the request to an Agent in the cloud host, and the Agent records request information to a configuration file. In order to ensure a normal mount state of the file storage, the Agent not only executes a mount action, but also implements a regular detection mechanism. Under the condition that the heartbeat between the addresses of the local host and a remote file storage is normal, the Agent queries the mount state regularly. When the mount state is abnormal, the Agent will try to remount and repair, so as to ensure the high availability of the file storage. If the addresses of the local host and the remote file storage are not connected, the Agent will not try to mount all the time, but try to remount when the heartbeat is normal. After the cloud host restarts, the Agent starts and mounts the file storage automatically. After successful mount, the Manila service saves mount information to a database, and counts a number of cloud hosts connected to each export path, so as to meet the requirements of the least connections algorithm for load balancing. When the file storage is unmounted, the project administrator may directly select a corresponding file storage which may display all the mounted cloud hosts, and select a cloud host to unmount. During unmount, the Agent inside the cloud host synchronously changes the configuration file and no longer monitors the file storage, and the cloud platform deletes the mount information. In this way, a user may easily use the shared file storage without any operation, and the file storage management capability of a project administrator on the management platform is also improved.
Based on the same inventive concept, according to another aspect of the present disclosure, some embodiments of the present disclosure further provide a file storage management system 400, as shown in
Based on the same inventive concept, according to another aspect of the present disclosure, as shown in
Based on the same inventive concept, according to another aspect of the present disclosure, as shown in
Finally, it should be noted that those of ordinary skill in the art may understand that all or part of the flows of implementing the methods of the foregoing embodiments may be completed by a computer program instructing relevant hardware, the program may be stored in a computer-readable storage medium, and when executed, the program may include the flow of the embodiment of each method above.
Further, it should be understood that the computer-readable storage medium (for example, a memory) herein may be a transitory memory or a non-transitory memory, or may include both the transitory memory and the non-transitory memory.
Those skilled in the art will also appreciate that various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein may be implemented as electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps has been generally described in terms of their functions. Whether the functions are implemented as software or hardware depends on applications and design constraints imposed on an entire system. Those skilled in the art may implement the functions in various ways for each particular application, but such implementation decisions should not be interpreted as leading to a departure from the scope of the embodiments of the present disclosure.
Described above are exemplary embodiments of the present disclosure. However, it should be noted that various changes and modifications may be made without departing from the scope of the embodiments of the present disclosure as defined by the claims. The functions, steps and/or operations of the method claims according to the disclosed embodiments described herein do not need to be performed in any order. In addition, although the elements disclosed in the embodiments of the present disclosure may be described or required in individual forms, they may also be understood as plural unless explicitly limited to a singular number.
It should be understood that, as used herein, the singular form “a” is intended to include a plural form as well unless the context clearly supports exceptions. It should also be understood that “and/or” as used herein means any and all possible combinations including one or more items associatively listed.
The foregoing serial numbers of the embodiments of the present disclosure are disclosed for description only and do not represent the advantages and disadvantages of the embodiments.
Those of ordinary skill in the art may understand that all or some of the steps of the foregoing embodiments may be completed by hardware, or may be completed by a program instructing relevant hardware. The program may be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like.
It should be understood by those of ordinary skill in the art that the discussion of any of the above embodiments is exemplary only and is not intended to imply that the scope of the embodiments of the present disclosure (including the claims) is limited to these examples. Under the idea of the embodiments of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, and there are many other variations in different aspects of the embodiments of the present disclosure as above, which are not provided in detail for brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, and the like made within the spirit and principles of the embodiments of the present disclosure should be included within the scope of protection of the embodiments of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202010821009.4 | Aug 2020 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2021/096408 | 6/7/2021 | WO |