CN106777394B - Cluster file system - Google Patents
Cluster file system Download PDFInfo
- Publication number
- CN106777394B CN106777394B CN201710113470.2A CN201710113470A CN106777394B CN 106777394 B CN106777394 B CN 106777394B CN 201710113470 A CN201710113470 A CN 201710113470A CN 106777394 B CN106777394 B CN 106777394B
- Authority
- CN
- China
- Prior art keywords
- block device
- file system
- nfs
- lock
- management module
- 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
Links
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 238000001514 detection method Methods 0.000 claims description 3
- 239000000126 substance Substances 0.000 claims description 3
- 238000000034 method Methods 0.000 abstract description 5
- 230000008569 process Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 3
- 210000004556 brain Anatomy 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/116—Details of conversion of file system types or formats
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 invention discloses a cluster file system, comprising: the lvm management module and the nfs management module; the lvm management module is used for creating corresponding block equipment according to the block equipment creation information and providing the block equipment for the cluster user, so that the cluster user directly performs IO operation in the block equipment; the nfs management module is used for mounting an nfs file system on a node of the mounted lvm storage pool and managing the lvm storage pool through sanlock; the cluster file system provides block equipment to enable the virtual equipment to format the block equipment into a file system required by the virtual equipment according to a required file format, so that the process of IO operation each time is reduced; meanwhile, IO operation with higher speed is provided, the efficiency of the cluster file system is improved, and meanwhile the IO speed of the virtual equipment of the cluster is improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a cluster file system.
Background
With the rapid development of computer technology and network technology, the cluster system gradually becomes the focus of the computer industry with its powerful computing capability and robust fault-tolerant mechanism. However, the development of the cluster file system as a complete set is influenced by the distribution and is slow, and most of the cluster file systems are in a file system format required by the re-creation of the virtual machine on the basis of the original file system. The file system deepens the flow of IO operation each time and reduces the access rate of the file system. Therefore, how to improve the efficiency of the cluster file system is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a cluster file system, which provides block equipment to enable virtual equipment to format the block equipment into a file system required by the virtual equipment according to a required file format, so that the process of IO operation at each time is reduced.
To solve the above technical problem, the present invention provides a cluster file system, including: the lvm management module and the nfs management module; wherein the content of the first and second substances,
the lvm management module is used for creating corresponding block equipment according to the block equipment creation information and providing the block equipment for a cluster user, so that the cluster user directly performs IO operation in the block equipment;
and the nfs management module is used for mounting an nfs file system on a node of the mounted lvm storage pool and managing the lvm storage pool through sanlock.
Optionally, the nfs management module includes:
and the initialization module is used for creating a corresponding lvm storage pool lock information file in the nfs file system when the lvm storage pool is created.
Optionally, the initialization module specifically executes initlockspace through sanlock when the lvm storage pool is created, executes add lockspace operation on each host, creates a file named as uuid of vg, and enables the file to have a resource lock corresponding to the lvm storage pool.
Optionally, the nfs management module includes:
and the metadata consistency unit is used for acquiring the corresponding vg lock resources through sanlock and then executing the corresponding metadata operation if the metadata operation request is received, and releasing the vg lock resources after the metadata operation is completed.
Optionally, the nfs management module includes:
and the block device lock information creating unit is used for creating a corresponding block device lock information file in the nfs file system when creating the block device.
Optionally, the block device lock information creating unit is specifically configured to create, by using sanlock, a file named by uuid of the block device when the block device is created, and execute an init resource operation by using sanlock, so that the file has a resource lock of the block device.
Optionally, the nfs management module includes:
and the block device operation unit is used for acquiring the corresponding lock resource through sanlock and then executing the corresponding block device operation if the block device operation request is received, and releasing the lock resource after the block device operation is completed.
Optionally, the nfs management module includes:
and the block device lock information deleting unit is used for deleting the block device when detecting that the lock resource corresponding to the block device is not occupied through sanlock when the block device deleting request is received, and deleting the block device lock information file corresponding to the block device after the deletion is successful.
Optionally, the scheme further includes:
and the lock information detection module is used for detecting the lock information in the nfs management module and the block device information in the kernel at regular time and deleting the kernel information corresponding to the deleted block device.
The invention provides a cluster file system, comprising: the lvm management module and the nfs management module; the lvm management module is used for creating corresponding block equipment according to the block equipment creation information and providing the block equipment for the cluster user, so that the cluster user directly performs IO operation in the block equipment; the nfs management module is used for mounting an nfs file system on a node of the mounted lvm storage pool and managing the lvm storage pool through sanlock;
therefore, the cluster file system provides the block device, so that the virtual device directly formats the block device into a file system required by the virtual device according to a required file format, namely, a user directly performs IO operation in the block device, the steps of performing IO operation in the file system in the prior art are reduced, and the flow of each IO operation is reduced; meanwhile, IO operation with higher speed is provided, the efficiency of the cluster file system is improved, and meanwhile the IO speed of the virtual equipment of the cluster 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 embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a block diagram of a cluster file system according to an embodiment of the present invention;
fig. 2 is a block diagram of another cluster file system according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a cluster file system, which provides block devices to enable virtual devices to format the block devices into file systems required by the virtual devices according to required file formats, so that the process of IO operation at each time is reduced.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present 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.
In this embodiment, lvm is local volume manager, nfs (network file system), and sanlock is a lightweight and flexible distributed lock manager implemented by software, and is applied to open-source virtualization projects such as ovirt and libvirt. In the prior art, the IO operation is performed in the file system at first, and then the file system writes the corresponding IO operation into the block device, that is, the flow of the IO operation is performed twice, so that the IO operation speed is reduced. In this embodiment, the block device is directly provided, so that the block device directly performs IO operation in the block device, thereby saving the flow of the IO operation and improving the speed of the IO operation. Referring to fig. 1 in detail, fig. 1 is a block diagram of a cluster file system according to an embodiment of the present invention; the system may include: the lvm management module 100 and the nfs management module 200; wherein the content of the first and second substances,
the lvm management module 100 is configured to create a corresponding block device according to the block device creation information and provide the block device to a cluster user, so that the cluster user directly performs IO operation in the block device;
specifically, the lvm management module 100 provides a specific block device for the cluster to use, so as to increase the access speed of the cluster file system.
And the nfs management module 200 is used for mounting an nfs file system on a node of the mount lvm storage pool and managing the lvm storage pool through sanlock.
Specifically, the nfs management module 200 provides a dependency file for cluster management, and determines a storage target managed by the sanlock lock through nfs. And the purpose of sanlock management in the nfs management module 200 is to better adapt to cluster management files for lvm, and simultaneously prevent common access of cluster members from causing a split brain phenomenon. Namely, the nfs file system provides storage dependence managed by sanlock, namely, nodes for mounting the lvm storage pool all need to mount the nfs file system, and the lvm storage pool is managed by sanlock, so that the nfs file system is suitable for a cluster file system.
Further, sanlock can not only provide a lock management scheme; meanwhile, the Sanlock can also provide a weak cluster management scheme, namely cluster lvm storage pool access node control. So as to improve the management efficiency and the management reliability of the nfs management module 200.
The system achieves management control of a cluster file system through a lvm management module 100 and an nfs management module 200. The shared readable and writable file is provided by a file system which can be mutually accessed by cluster members provided by nfs, and the exclusive lock operation is provided by sanlock, so that the resource is prevented from being reused by different machines.
Based on the above technical solution, in the cluster file system provided in the embodiments of the present invention, the system provides the virtual device with a specific block file, and the virtual device formats the block file into a file system required by the virtual device according to a required file format, thereby reducing a flow of each IO operation. Meanwhile, IO operation with higher speed is provided, the efficiency of the cluster file system is improved, and meanwhile the IO speed of the virtual equipment of the cluster is improved.
Based on the above embodiment, when creating lv, metadata of lv is operated, because multiple hosts can access and create the lvm storage pool at the same time, in order to ensure security of the metadata of lv, each operation on metadata of lv of a cluster must be mutually exclusive, and therefore, the operation on metadata of the cluster is ensured to be mutually exclusive through sanlock, and therefore, sanlock + nfs provides a vg lock, that is, the operation on metadata must acquire a vg lock through sanlock, then operate, and release the vg lock after the operation is completed. That is, optionally, in this embodiment, the nfs management module 200 may include:
and the initialization module is used for creating a corresponding lvm storage pool lock information file in the nfs file system when the lvm storage pool is created.
Specifically, the initialization module executes initlockspace through sanlock when the lvm storage pool is created, executes add lockspace operation on each host, creates a file named as uuid of vg, and enables the file to have a resource lock corresponding to the lvm storage pool.
That is, the iscsi device or FC block device is configured first, and the LUN can be accessed normally by the host, and an nfs file system that can be accessed by each host is mounted on each host using the LUN. Deploying the sanlock management software, then executing init lockspace (using uuid of vg to be created as lockspace name of the lock information) operation on one host, namely initializing the distributed lock information, then executing addockspace operation on each host, namely executing connection lock operation, and performing lock management operation on each host; create vg (uuid of lockspace name mentioned above), then create lock information for vg (file named uuid of vg) on nfs file system, and then initialize.
And the metadata consistency unit is used for acquiring the corresponding vg lock resource through sanlock and then executing the corresponding metadata operation if the metadata operation request is received, and releasing the vg lock resource after the metadata operation is completed.
The method comprises the steps of connecting a plurality of disk partitions into a whole volume group (vg) to form an lvm storage pool.
Based on the above embodiment, in order to prevent the split brain problem caused by simultaneous access of clusters, the nfs management module in this embodiment may include:
and the block device lock information creating unit is used for creating a corresponding block device lock information file in the nfs file system when the block device is created.
Specifically, the block device lock information creating unit is to create a file named by uuid of the block device through sanlock when the block device is created, and execute an init resource operation through sanlock, so that the file has a resource lock of the block device.
That is, each operation that creates an lv (i.e., block device) must create a file named uuid of the lv on top of the nfs file system, while performing an init resource operation on the file, that is, the file is the lock information of the lv.
And the block device operation unit is used for executing the corresponding block device operation after acquiring the corresponding lock resource through sanlock and releasing the lock resource after the block device operation is completed when the block device operation request is received.
And the block device lock information deleting unit is used for deleting the block device when detecting that the lock resource corresponding to the block device is not occupied through sanlock when the block device deleting request is received, and deleting the block device lock information file corresponding to the block device after the block device is successfully deleted.
Specifically, each time the lv is used, the resource lock of the lv must be acquired, and when the lv is deleted, the resource lock must be deleted at the same time. For the residual data of the lv of the kernel, each operation for creating the lv must create a lock of a resource of the sanlock through the sanlock, that is, resource information named by uuid of the lv, the lock of the lv is acquired each time the lv is used, and then the lv can be normally used; and when the lv can be deleted normally, the deleting operation is executed, and the lock information of the lv is required to be deleted after the lv is deleted, so that the information residue is avoided.
Based on any of the above embodiments, please refer to fig. 2, this embodiment may further include:
and the lock information detection module is used for detecting the lock information in the nfs management module and the block device information in the kernel at regular time and deleting the kernel information corresponding to the deleted block device.
Specifically, other cluster member nodes need to have a timing task to detect the content of the lock information and the kernel lv information, and delete the deleted kernel lv information. Ensuring that system resources are not occupied.
The cluster file system provided by the invention is 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 (7)
1. A clustered file system, comprising: the lvm management module and the nfs management module; wherein the content of the first and second substances,
the lvm management module is used for creating corresponding block equipment according to the block equipment creation information and providing the block equipment for a cluster user, so that the cluster user directly performs IO operation in the block equipment;
the nfs management module is used for mounting an nfs file system on a node of a mounted lvm storage pool and managing the lvm storage pool through sanlock;
the nfs management module comprises:
a block device lock information deleting unit, configured to delete a block device when detecting, through sanlock, that a lock resource corresponding to the block device is not occupied when a block device deletion request is received, and delete a block device lock information file corresponding to the block device after the deletion is successful;
further comprising: and the lock information detection module is used for detecting the lock information in the nfs management module and the block device information in the kernel at regular time and deleting the kernel information corresponding to the deleted block device.
2. The cluster file system of claim 1, wherein the nfs management module comprises:
and the initialization module is used for creating a corresponding lvm storage pool lock information file in the nfs file system when the lvm storage pool is created.
3. The cluster file system of claim 2, wherein the initialization module is specifically configured to execute an init lockspace through sanlock when the lvm storage pool is created, and execute add lockspace operation on each host to create a file named uuid of vg, so that the file has a resource lock corresponding to the lvm storage pool.
4. The cluster file system of claim 3, wherein the nfs management module comprises:
and the metadata consistency unit is used for acquiring the corresponding vg lock resources through sanlock and then executing the corresponding metadata operation if the metadata operation request is received, and releasing the vg lock resources after the metadata operation is completed.
5. The cluster file system of claim 4, wherein the nfs management module comprises:
and the block device lock information creating unit is used for creating a corresponding block device lock information file in the nfs file system when creating the block device.
6. The cluster file system according to claim 5, wherein the block device lock information creating unit is specifically configured to create a file named uuid of the block device by sanlock when creating the block device, and perform an init resource operation by sanlock to make the file have a resource lock of the block device.
7. The cluster file system of claim 6, wherein the nfs management module comprises:
and the block device operation unit is used for acquiring the corresponding lock resource through sanlock and then executing the corresponding block device operation if the block device operation request is received, and releasing the lock resource after the block device operation is completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710113470.2A CN106777394B (en) | 2017-02-28 | 2017-02-28 | Cluster file system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710113470.2A CN106777394B (en) | 2017-02-28 | 2017-02-28 | Cluster file system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106777394A CN106777394A (en) | 2017-05-31 |
CN106777394B true CN106777394B (en) | 2020-09-18 |
Family
ID=58959799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710113470.2A Active CN106777394B (en) | 2017-02-28 | 2017-02-28 | Cluster file system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106777394B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391236B (en) * | 2017-09-15 | 2020-03-06 | 郑州云海信息技术有限公司 | Cluster block storage implementation method and device |
CN109240601B (en) * | 2018-07-24 | 2021-08-27 | 中国建设银行股份有限公司 | Storage space processing method and device for cloud storage and storage medium |
CN111225020B (en) * | 2019-11-07 | 2021-06-29 | 苏州浪潮智能科技有限公司 | User mode network file system dual-stack access method, device and equipment |
CN112988319A (en) * | 2019-12-02 | 2021-06-18 | 中兴通讯股份有限公司 | LVM data processing method and device, computer equipment and computer readable medium |
CN111813507B (en) * | 2020-07-22 | 2023-05-02 | 超越科技股份有限公司 | Method, system, equipment and medium for high availability of virtual machine based on sanlock |
CN115102972A (en) * | 2022-07-15 | 2022-09-23 | 济南浪潮数据技术有限公司 | Method, device, equipment and medium for storing NFS (network file system) file |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120266162A1 (en) * | 2011-04-12 | 2012-10-18 | Red Hat Israel, Inc. | Mechanism for Storing a Virtual Machine on a File System in a Distributed Environment |
CN102664923A (en) * | 2012-03-30 | 2012-09-12 | 浪潮电子信息产业股份有限公司 | Method for realizing shared storage pool by utilizing Linux global file system |
CN103731508A (en) * | 2014-01-23 | 2014-04-16 | 易桂先 | Cloud-storage-based network hard disk device and management method thereof |
CN105471695A (en) * | 2014-08-21 | 2016-04-06 | 西安慧泽知识产权运营管理有限公司 | Storage area network virtualization management method |
CN106201357A (en) * | 2016-07-18 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The construction method of a kind of storage pool and system |
-
2017
- 2017-02-28 CN CN201710113470.2A patent/CN106777394B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106777394A (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106777394B (en) | Cluster file system | |
US10379759B2 (en) | Method and system for maintaining consistency for I/O operations on metadata distributed amongst nodes in a ring structure | |
US9671967B2 (en) | Method and system for implementing a distributed operations log | |
CN111488241B (en) | Method and system for realizing agent-free backup and recovery operation in container arrangement platform | |
US9286344B1 (en) | Method and system for maintaining consistency for I/O operations on metadata distributed amongst nodes in a ring structure | |
EP3008600B1 (en) | Virtual machine backup from storage snapshot | |
US9092248B1 (en) | Systems and methods for restoring distributed applications within virtual data centers | |
US10067692B2 (en) | Method and apparatus for backing up and restoring cross-virtual machine application | |
US9678680B1 (en) | Forming a protection domain in a storage architecture | |
US20150095597A1 (en) | High performance intelligent virtual desktop infrastructure using volatile memory arrays | |
US9354907B1 (en) | Optimized restore of virtual machine and virtual disk data | |
US8881144B1 (en) | Systems and methods for reclaiming storage space from virtual machine disk images | |
US8615488B2 (en) | Physical replication of database subset to improve availability and reduce resource cost in a cloud environment | |
US9354908B2 (en) | Instantly restoring virtual machines by providing read/write access to virtual disk before the virtual disk is completely restored | |
US11099735B1 (en) | Facilitating the recovery of full HCI clusters | |
JP6663995B2 (en) | System and method for backing up a large-scale distributed scale-out data system | |
US9336131B1 (en) | Systems and methods for enabling virtual environments to mount non-native storage disks | |
US9003139B1 (en) | Systems and methods for recovering virtual machines after disaster scenarios | |
US20170322793A1 (en) | Upgrade of an operating system of a virtual machine | |
US9805038B2 (en) | Efficient conflict resolution among stateless processes | |
US8990815B1 (en) | Synchronizing allocated blocks of virtual disk files across primary and secondary volumes by excluding unused blocks | |
US11635948B2 (en) | Systems and methods for mapping software applications interdependencies | |
US10831554B2 (en) | Cohesive clustering in virtualized computing environment | |
WO2019155308A1 (en) | Data migration in a hierarchical storage management system | |
US20210132840A1 (en) | Storage management system and method |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200821 Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601 Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |