CN107172152B - Statistical quota system and method based on CEPH cluster CAP mechanism - Google Patents

Statistical quota system and method based on CEPH cluster CAP mechanism Download PDF

Info

Publication number
CN107172152B
CN107172152B CN201710355342.9A CN201710355342A CN107172152B CN 107172152 B CN107172152 B CN 107172152B CN 201710355342 A CN201710355342 A CN 201710355342A CN 107172152 B CN107172152 B CN 107172152B
Authority
CN
China
Prior art keywords
client
quota
data end
mds data
cap
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
CN201710355342.9A
Other languages
Chinese (zh)
Other versions
CN107172152A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201710355342.9A priority Critical patent/CN107172152B/en
Publication of CN107172152A publication Critical patent/CN107172152A/en
Application granted granted Critical
Publication of CN107172152B publication Critical patent/CN107172152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a statistical quota system based on a CEPH cluster CAP mechanism, which comprises: a plurality of clients and MDS data terminals; the MDS data end is in communication connection with each client respectively; the MDS data end is used for setting client quota, the quota takes bytes as a unit, both the client and the MDS data end are provided with quota amount, and the quota amount of the client is based on the MDS data end setting; when the client needs data operation, the client applies for Cap authorization and quota amount to the MDS data end, and when the MDS data end is provided with the quota amount, the Cap authorization and quota amount are updated to the client. And counting quota based on the client by using a cap authority control mechanism of ceph, reducing the communication message types of the client and an MDS data end, realizing quota counting based on files and enabling quota counting to be more accurate and efficient.

Description

Statistical quota system and method based on CEPH cluster CAP mechanism
Technical Field
The invention relates to the field of distributed storage software, in particular to a system and a method for counting quota based on a CAP mechanism of a CEPH cluster.
Background
In present multimedia storage, the data bulk is the geometric grade and increases, and the disk space of storage data increases gradually, promotes to present TB so that to PB level by GB before, how to avoid the abuse of user to disk space, causes other users to be unable to use disk space for the technical problem that waits to be solved currently.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a statistical quota system based on a CEPH cluster CAP mechanism, which comprises: a plurality of clients and MDS data terminals; the MDS data end is in communication connection with each client respectively;
the MDS data end is used for setting client quota, the quota takes bytes as a unit, both the client and the MDS data end are provided with quota amount, and the quota amount of the client is based on the MDS data end setting; when the client needs data operation, the client applies for Cap authorization and quota amount to the MDS data end, and when the MDS data end is provided with the quota amount, the Cap authorization and quota amount are updated to the client.
Preferably, the Cap authorization comprises: read permission, write permission, append write and update permission.
A statistical quota method based on a CEPH cluster CAP mechanism comprises the following steps:
when a new file is written or an existing file is additionally written in a client, the client sends write Cap authorization of the file to an MDS data end and applies for quota amount;
after receiving a write Cap authorization request sent by the client, the MDS data end inquires whether the client authorizes write Cap of the file, and then inquires whether the MDS data end has the residual quota amount;
if the client has the write permission to the file, and the MDS data end is provided with the quota amount applied by the client;
and the MDS data end sends write Cap authorization to the client and updates the quota amount of the client.
Preferably, the quota method comprises:
if the client has the write permission to the file, and the MDS data end does not have the quota amount applied by the client;
the MDS data end acquires whether the existing residual quota amount of the client meets the Cap writing authorization;
when the existing residual quota amount of the client meets the write Cap authorization, the MDS data end sends the write Cap authorization to the client;
and when the existing residual quota amount of the client does not meet the write Cap authorization, the MDS data end sends the excess quota amount to the client, and withdraws the write Cap authorization.
Preferably, the quota method comprises:
when the file size is reduced by the client, recording a quota reduction value;
the client sends a Cap quota reduction application to the MDS data end and sends a quota reduction value;
the MDS data end receives a Cap update file size application sent by the client and updates a quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and a quota reduction value of the client;
updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
the client updates the local quota value.
Preferably, the quota method comprises:
when a client deletes a local file or a directory, recording the total size of the deleted file or directory;
the client sends a directory or file deletion application to the MDS data end and attaches the size of the deleted directory or file;
the MDS data end receives a deletion directory or file application sent by the client and updates a quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and the size of the deletion directory or file of the client;
updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
the client updates the local quota value.
Preferably, the quota method comprises:
when a new client is accessed to the MDS data end, the MDS data end expands the total quota value;
the MDS data side distributes a preset quota value to the newly accessed client side;
scanning each client by an MDS data end in real time, and when the client does not exist or does not need to set quota, recovering the quota of the client by the MDS data end and deleting the quota amount of the client;
and adding the client to the quota residual value of the MDS data end.
Preferably, the MDS data terminal measures whether the quota amount allocated in the current system is balanced by comparing the variance D between each client and the average quota amount of the system, and the balance degree is calculated by formula 1.1; n is a system with N clients, PAVERepresents the system average quota amount, PiRepresenting the quota amount of the ith client;
Figure BDA0001298925870000031
according to the technical scheme, the invention has the following advantages:
and counting quota based on the client by using a cap authority control mechanism of ceph, reducing the communication message types of the client and an MDS data end, realizing quota counting based on files and enabling quota counting to be more accurate and efficient. The MDS data end sets quota for the client, divides magnetic quota amount for the client, and improves storage space utilization rate of the client and the MDS data end.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings used in the description will be briefly introduced, 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 schematic diagram of a statistical quota system based on a CEPH cluster CAP mechanism;
FIG. 2 is a flowchart of an embodiment of a method for counting quotas based on a CEPH cluster CAP mechanism;
FIG. 3 is a flow chart of another embodiment of a statistical quota based method for a CEPH cluster CAP mechanism;
FIG. 4 is a flow chart of another embodiment of a statistical quota based method for a CEPH cluster CAP mechanism;
FIG. 5 is a flow chart of another embodiment of a statistical quota based method for a CEPH cluster CAP mechanism;
fig. 6 is a flowchart of another embodiment of a method for counting quotas based on a CEPH cluster CAP mechanism.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions of the present invention will be clearly and completely described below with reference to specific embodiments and drawings. 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 scope of protection of this patent.
The embodiment provides a statistical quota system based on a CEPH cluster CAP mechanism, as shown in fig. 1, including: a plurality of clients 2 and MDS data terminals 1; the MDS data terminal 1 is in communication connection with each client terminal 1 respectively;
the MDS data end 1 is used for setting quota of the client end 2, the quota takes bytes as a unit, both the client end 2 and the MDS data end 1 are provided with quota amount, and the quota amount of the client end is based on the setting of the MDS data end; when the client 2 needs data operation, the client 2 applies for Cap authorization and quota amount to the MDS data end 1, and when the MDS data end 1 is provided with quota amount, the Cap authorization and quota amount are updated to the client 1; therefore, interaction between the client and the MDS data end 1 is reduced, and data processing pressure of the MDS data end 1 is relieved.
A statistical quota system based on a CEPH cluster CAP mechanism is divided into Clients: client (data user), mds: metadata server cluster, Metadata server (cache and synchronization distributed Metadata) osd: objectstorage cluster (stores data and metadata as objects, performs other key functions). mon: cluster monitors (executing monitoring function), a client stores data into a Ceph system through a POSIX interface, distributed storage, viewing, modification and deletion of the data are realized through cooperation among other three parts, and the operation principles are transparent to users.
Data stored in a Ceph distributed storage system is created, updated and deleted in a file unit for an upper layer user (Client), wherein the Ceph sets permissions on files, different users have different operation permissions on the same files or directories, the Ceph needs a mechanism for managing file permissions, the mechanism is a CAP (capacity) mechanism, the Cap is an operation ability permission which is allocated to the files/directories by an MDS (data processing system) for the users, different clients or the same Client at different times, the caps held on the same files/directories are possibly different, and the Cap permissions are divided into three types in general: the invention relates to a method for managing authority of a file/directory, which comprises the steps of reading authority, writing authority and updating authority, wherein an MDS operates the same file/directory on a plurality of clients through a Cap for authority management, but Ceph lacks the limit on a user reading and writing storage space, cannot reasonably utilize the storage space and cannot meet the requirements of clients.
The present invention further provides a quota counting method based on a CEPH cluster CAP mechanism, as shown in fig. 2, the quota counting method includes:
s1, when a new file is written or an existing file is additionally written in the client, the client sends the writing Cap authorization of the file to the MDS data terminal and applies for quota amount;
s2, after receiving a write Cap authorization request sent by the client, the MDS data end inquires whether the client authorizes write Cap of the file, and then inquires whether the MDS data end has residual quota;
s3, if the client has the write right to the file, and the MDS data end is provided with the quota amount applied by the client;
s4, sending write Cap authorization to the client by the MDS data terminal and updating the quota amount of the client.
In this embodiment, the quota method includes: as shown in figure 3 of the drawings,
s11, if the client has the write right to the file, and the MDS data end does not have the quota amount applied by the client;
s12, the MDS data end acquires whether the existing residual quota amount of the client meets the Cap writing authorization;
s13, when the existing residual quota amount of the client meets the write Cap authorization, the MDS data end sends the write Cap authorization to the client;
and S14, when the existing residual quota of the client does not meet the write Cap authorization, the MDS data end sends the excess quota to the client, and withdraws the write Cap authorization.
In this embodiment, the quota method includes: as shown in figure 4 of the drawings,
s21, when the file size is reduced by the client, recording a quota reduction value;
s22, the client sends a Cap quota reduction application to the MDS data end and sends a quota reduction value;
s23, the MDS data end receives a Cap update file size application sent by the client, and updates a quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and a quota reduction value of the client;
s24, updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
and S25, the client updates the local quota value.
In this embodiment, the quota method includes: as shown in figure 5 of the drawings,
s31, when deleting the local file or directory, the client records the total size of the deleted file or directory;
s32, the client sends a request for deleting the directory or the file to the MDS data end and attaches the size of the deleted directory or the file;
s33, the MDS data end receives the deletion directory or file application sent by the client, and updates the quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and the size of the deletion directory or file of the client;
s34, updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
and S35, the client updates the local quota value.
In this embodiment, the quota method includes: as shown in figure 6 of the drawings,
s41, when a new client accesses the MDS data end, the MDS data end expands the total quota value;
s42, allocating a preset quota value to the newly accessed client by the MDS data end;
s43, scanning each client in real time by the MDS data end, and when the client does not exist or does not need to set quota, recovering the quota of the client by the MDS data end and deleting the quota amount of the client;
and S44, adding the client to the quota residual value of the MDS data end.
In this embodiment, the MDS data side measures whether the quota amount allocated in the current system is balanced by comparing the variance D between each client and the average quota amount of the system, and the balance degree is calculated by formula 1.1; n is a system with N clients, PAVERepresents the system average quota amount, PiRepresenting the quota amount of the ith client;
Figure BDA0001298925870000061
in the initial work or normal work, the MDS data end measures whether the quota amount distributed in the current system is balanced or not by calculating the balance degree and the variance D, and the quota amount of each client is ensured to be balanced. When the client newly applies for the quota amount or reduces the quota amount, the method is executed.
In some embodiments, some or all of the functionality or processing of one or more of the devices is implemented or supported by a computer program that is formed from computer readable program code and that is included in a computer readable medium. The phrase "computer readable program code" includes any type of computer code, including source code, object code, and executable code. The phrase "computer readable medium" includes any type of medium capable of being accessed by a computer, such as Read Only Memory (ROM), Random Access Memory (RAM), a hard disk drive, a Compact Disc (CD), a Digital Video Disc (DVD), or any other type of memory.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention 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.

Claims (1)

1. A statistical quota method based on a CEPH cluster CAP mechanism is characterized in that a statistical quota system based on the CEPH cluster CAP mechanism is adopted, and the system comprises: a plurality of clients and MDS data terminals; the MDS data end is in communication connection with each client respectively;
the MDS data end is used for setting client quota, the quota takes bytes as a unit, both the client and the MDS data end are provided with quota amount, and the quota amount of the client is based on the MDS data end setting; when a client needs data operation, the client applies for Cap authorization and quota amount to an MDS data end, and when the MDS data end is provided with quota amount, the Cap authorization and quota amount are updated to the client;
the Cap authorization includes: read permission, write permission, additional write and update permission;
the quota method comprises the following steps:
when a new file is written or an existing file is additionally written in a client, the client sends write Cap authorization of the file to an MDS data end and applies for quota amount;
after receiving a write Cap authorization request sent by the client, the MDS data end inquires whether the client authorizes write Cap of the file, and then inquires whether the MDS data end has the residual quota amount;
if the client has the write permission to the file, and the MDS data end is provided with the quota amount applied by the client;
the MDS data end sends write Cap authorization to the client and updates quota amount of the client;
if the client has the write permission to the file, and the MDS data end does not have the quota amount applied by the client;
the MDS data end acquires whether the existing residual quota amount of the client meets the Cap writing authorization;
when the existing residual quota amount of the client meets the write Cap authorization, the MDS data end sends the write Cap authorization to the client;
when the existing residual quota amount of the client does not meet the write Cap authorization, the MDS data end sends the excess quota amount to the client and withdraws the write Cap authorization;
when the file size is reduced by the client, recording a quota reduction value;
the client sends a Cap quota reduction application to the MDS data end and sends a quota reduction value;
the MDS data end receives a Cap update file size application sent by the client and updates a quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and a quota reduction value of the client;
updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
the client updates the local quota value;
when a client deletes a local file or a directory, recording the total size of the deleted file or directory;
the client sends a directory or file deletion application to the MDS data end and attaches the size of the deleted directory or file;
the MDS data end receives a deletion directory or file application sent by the client and updates a quota residual value of the MDS data end, wherein the quota residual value is the sum of the current quota residual value and the size of the deletion directory or file of the client;
updating the quota residual value by the MDS data terminal, and returning the quota updated value of the client;
the client updates the local quota value;
when a new client is accessed to the MDS data end, the MDS data end expands the total quota value;
the MDS data side distributes a preset quota value to the newly accessed client side;
scanning each client by an MDS data end in real time, and when the client does not exist or does not need to set quota, recovering the quota of the client by the MDS data end and deleting the quota amount of the client;
adding the client to a quota residual value of an MDS data end;
the MDS data end measures whether the quota amount distributed in the current system is balanced or not by comparing the variance D of each client with the average quota amount of the system, and the balance is calculated through a formula 1.1Weighing; n is a system with N clients, PaveRepresents the system average quota amount, PiRepresenting the quota amount of the ith client;
Figure FDA0002505777140000021
CN201710355342.9A 2017-05-19 2017-05-19 Statistical quota system and method based on CEPH cluster CAP mechanism Active CN107172152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710355342.9A CN107172152B (en) 2017-05-19 2017-05-19 Statistical quota system and method based on CEPH cluster CAP mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710355342.9A CN107172152B (en) 2017-05-19 2017-05-19 Statistical quota system and method based on CEPH cluster CAP mechanism

Publications (2)

Publication Number Publication Date
CN107172152A CN107172152A (en) 2017-09-15
CN107172152B true CN107172152B (en) 2020-10-23

Family

ID=59815481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710355342.9A Active CN107172152B (en) 2017-05-19 2017-05-19 Statistical quota system and method based on CEPH cluster CAP mechanism

Country Status (1)

Country Link
CN (1) CN107172152B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804038A (en) * 2018-05-29 2018-11-13 新华三技术有限公司 Method, apparatus, server and the computer-readable medium of daily record data migration
CN109284274B (en) * 2018-11-29 2021-09-28 郑州云海信息技术有限公司 Configuration asynchronous pre-allocation implementation method based on distributed file system
CN109583222A (en) * 2018-12-07 2019-04-05 浪潮(北京)电子信息产业有限公司 Distributed file system metadata service device recycles client jurisdiction method and device
CN111181791A (en) * 2019-12-31 2020-05-19 浪潮电子信息产业股份有限公司 Quota management method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201783A (en) * 2006-12-14 2008-06-18 英业达股份有限公司 Method for early warning insufficiency of memory space of network memory system
CN102447736A (en) * 2011-11-17 2012-05-09 华中科技大学 Management and control method for user quota in multi-network storage system
CN106603729A (en) * 2017-02-23 2017-04-26 郑州云海信息技术有限公司 Distributed-file-system multi-client synchronization method and system thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378993A1 (en) * 2014-06-27 2015-12-31 Netapp, Inc. System and method for implementing a quota system in a distributed file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201783A (en) * 2006-12-14 2008-06-18 英业达股份有限公司 Method for early warning insufficiency of memory space of network memory system
CN102447736A (en) * 2011-11-17 2012-05-09 华中科技大学 Management and control method for user quota in multi-network storage system
CN106603729A (en) * 2017-02-23 2017-04-26 郑州云海信息技术有限公司 Distributed-file-system multi-client synchronization method and system thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种分布式存储系统用户磁盘配额的实现;陈起等;《计算机研究与发展》;20120521;第49卷(第z1期);第263-268页 *
基于Ceph对象存储集群的高可用性设计与实现;杨飞等;《微电子学与计算机》;20160131;第33卷(第1期);第60-64页 *

Also Published As

Publication number Publication date
CN107172152A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
KR102240557B1 (en) Method, device and system for storing data
CN107172152B (en) Statistical quota system and method based on CEPH cluster CAP mechanism
US10133484B2 (en) Tier based data file management
US9519653B2 (en) Techniques for efficiently enforcing resource quotas in a multi-tenant cloud storage system
US20180152515A1 (en) File Storage Method and Apparatus for Instant Communication Messages
US8200930B2 (en) Interacting with data in hidden storage
CN106406759B (en) Data storage method and device
CN107562915A (en) Read the method, apparatus and equipment and computer-readable recording medium of small documents
WO2018141304A1 (en) Flash file system and data management method thereof
US10795579B2 (en) Methods, apparatuses, system and computer program products for reclaiming storage units
CN108089825B (en) Storage system based on distributed cluster
CN110457263B (en) Data storage method and device
CN109918352B (en) Memory system and method of storing data
RU2665272C1 (en) Method and apparatus for restoring deduplicated data
US8082230B1 (en) System and method for mounting a file system on multiple host computers
CN113806300A (en) Data storage method, system, device, equipment and storage medium
CN113687781A (en) Method, device, equipment and medium for pulling up thermal data
CN113590027B (en) Data storage method, data acquisition method, system, device and medium
US11429311B1 (en) Method and system for managing requests in a distributed system
KR20180099349A (en) User terminal, and cloud service system including the same
CN114428764A (en) File writing method, system, electronic device and readable storage medium
US10613761B1 (en) Data tiering based on data service status
CN109241011B (en) Virtual machine file processing method and device
CN102420856A (en) Data processing method and equipment
US10671311B1 (en) System and method for dynamic data migration

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: 20200916

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: 450000 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