CN106909384A - A kind of sanlock optimization method and devices based on cluster file system - Google Patents
A kind of sanlock optimization method and devices based on cluster file system Download PDFInfo
- Publication number
- CN106909384A CN106909384A CN201710107902.9A CN201710107902A CN106909384A CN 106909384 A CN106909384 A CN 106909384A CN 201710107902 A CN201710107902 A CN 201710107902A CN 106909384 A CN106909384 A CN 106909384A
- Authority
- CN
- China
- Prior art keywords
- agent
- sanlock
- multithreading
- offset values
- file system
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of sanlock optimization method and devices based on cluster file system, the method includes:Agent is acted on behalf of in deployment in cluster file system;Offset values required for safeguarding Distributed Lock Manager sanlock by agent, are the file application offset values for needing to lock by agent when the file for needing to lock is created;Multithreading is created on agent, set up agent using multithreading communicates with multiple socket of sanlock.The method realizes dependence of the optimization sanlock locks for offset values, solves the offset value problems of sanlock locks.
Description
Technical field
It is more particularly to a kind of based on cluster file system the present invention relates to cluster file system technical field
Sanlock optimization method and devices.
Background technology
At present, with the fast development of computer technology and network technology, group system with its powerful operational capability and
Healthy and strong fault tolerant mechanism allows its progressively focus as computer industry.Fissure phenomenon in cluster is referred to as current urgent need to resolve
Problem, therefore occur in that the distributed lock of the types such as dlm and sanlock, dlm lock bases in network, when there is large batch of operation
Influence the performance of the distributed lock, therefore major part to be switched to sanlock locks to manage cluster when treatment, prevent fissure
Phenomenon.But sanlock locks are for offset values highly dependent upon sanlock distributed locks must possess offset values management work(
Can, produce offset values, that is, there are problems that the offset values of sanlock locks.
The content of the invention
It is an object of the invention to provide a kind of sanlock optimization method and devices based on cluster file system, to realize
Optimization sanlock locks solve the offset value problems of sanlock locks for the dependence of offset values.
In order to solve the above technical problems, the present invention provides a kind of sanlock optimization methods based on cluster file system, should
Method includes:
Agent is acted on behalf of in deployment in cluster file system;
Offset values required for safeguarding Distributed Lock Manager sanlock by agent, when the text for creating needs locking
It is the file application offset values for needing to lock by agent during part;
Multithreading is created on agent, set up agent using multithreading communicates with multiple socket of sanlock.
Preferably, after the file application offset values locked for needs by agent, also include:
By offset values record on the offset value files on cluster file system.
Preferably, multithreading is created on agent, the multiple socket for setting up agent and sanlock using multithreading lead to
Before letter, also include:
Queuing mechanism and concurrent mechanism are set on agent.
Preferably, it is described that multithreading is created on agent, the multiple of agent and sanlock is set up using multithreading
After socket communications, also include:
Acted on behalf of by agent and obtain the corresponding lock resource of offset files, offset value files are performed using resource is locked
Mutually exclusive operation.
The present invention also provides a kind of sanlock optimization devices based on cluster file system, above-mentioned based on collection for realizing
The sanlock methods of group's file system, including:
Deployment module, for disposing proxy module agent in cluster file system;
Maintenance module, the offset values required for for safeguarding Distributed Lock Manager sanlock by agent, works as wound
It is the file application offset values for needing to lock by agent when building the file for needing to lock;
Creation module, for creating multithreading on agent, the multiple of agent and sanlock is set up using multithreading
Socket communicates.
Preferably, the maintenance module also includes:
Recording unit, for the offset value files by offset values record on cluster file system.
Preferably, described device also includes:
Setup module, for setting queuing mechanism and concurrent mechanism on agent.
Preferably, described device also includes:
Acquisition module, the corresponding lock resource of offset files is obtained for being acted on behalf of by agent, is performed using resource is locked
The mutually exclusive operation of offset value files.
A kind of sanlock optimization method and devices based on cluster file system provided by the present invention, in group document
Agent is acted on behalf of in deployment in system;Offset values required for safeguarding Distributed Lock Manager sanlock by agent, work as establishment
It is the file application offset values for needing to lock by agent when needing the file for locking;Multithreading is created on agent,
Agent is set up using multithreading to be communicated with multiple socket of sanlock.It can be seen that, acted on behalf of by agent and complete offset values
Distribution mechanism, so act on behalf of optimization using agent and fall necessary to sanlock distributed locks offset values and manage, realize excellent
Change dependence of the sanlock locks for offset values, solve the offset value problems of sanlock locks.Also, created by multithreading
Agent communicates with multiple socket of sanlock, it is ensured that heavy traffic when concurrently being operated to sanlock.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of flow chart of sanlock optimization methods based on cluster file system provided by the present invention;
The basic information that Fig. 2 is included for storage pool;
Fig. 3 operates offset page after obtaining the resource institute on leases by sanlock for agent;
Fig. 4 is the structural representation that a kind of sanlock based on cluster file system provided by the present invention optimizes device.
Specific embodiment
Core of the invention is to provide a kind of sanlock optimization method and devices based on cluster file system, to realize
Optimization sanlock locks solve the offset value problems of sanlock locks for the dependence of offset values.
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is refer to, Fig. 1 is a kind of sanlock optimization methods based on cluster file system provided by the present invention
Flow chart, the method includes:
S11:Agent is acted on behalf of in deployment in cluster file system;
S12:Offset values required for safeguarding Distributed Lock Manager sanlock by agent, when establishment needs to lock
File when, by agent come be need lock file application offset values;
S13:Multithreading is created on agent, set up agent using multithreading communicates with multiple socket of sanlock.
It can be seen that, in the method, the distribution mechanism for completing offset values is acted on behalf of by agent, so using agent agencies
Optimization fall necessary to sanlock distributed locks offset values management, realize optimization sanlock lock for offset values according to
Rely, solve the offset value problems of sanlock locks.Also, multiple socket of agent and sanlock are created by multithreading
Communication, it is ensured that heavy traffic when concurrently being operated to sanlock.
Based on the above method, further, it is described by agent come for need the file application offset values that lock it
Afterwards, also include:By offset values record on the offset value files on cluster file system.
Further, multithreading is created on agent, multiple socket of agent and sanlock is set up using multithreading
Before communication, also include:Queuing mechanism and concurrent mechanism are set on agent.
Further, it is described that multithreading is created on agent, the multiple of agent and sanlock is set up using multithreading
After socket communications, acted on behalf of by agent and obtain the corresponding lock resource of offset files, offset values are performed using resource is locked
The mutually exclusive operation of file.
Purpose based on cluster file system is shared to allow all of main frame in cluster normally to access this
Storage, so as to offset lists necessary to common maintenance sanlock.
It is detailed based on this method, the offset values required for sanlock are safeguarded by agent, create needs each time
When the file to be locked, one offset value of this document application is helped by agent, and by offset values record in collection
On a file in group's file system.
Wherein, apply for an offset value by agent, and value record is belonged in file system concurrently grasp
Make, cluster file system needs to support multinode concurrent operations, it is therefore desirable to the read-write of protection cap public documents.
Wherein, in order to ensure the concurrent reading and writing of this document, it is necessary to ensure the read-write mutual exclusion of file by sanlock locks,
And when needing to ensure by agent success when concurrent reading and writing and sanlock management multiple storage pool concurrent operations
Mutually exclusive operation.
Wherein, success when concurrent reading and writing and the multiple storage pool concurrent operations of sanlock management are ensured by agent
When mutually exclusive operation, then agent need provide queuing mechanism and concurrent mechanism, can also go out when interacting with sanlock
Existing concurrent operations, therefore agent needs to open multiple socket communication interfaces with sanlock, interact with sanlock each time
Use different socket communication interfaces.
Wherein, agent is needed to provide concurrent mechanism, and concurrent mechanism is needed to be realized by multithreading, entered using thread pool
Row treatment.
Wherein, need concurrently to perform when sanlock management multiple storage pool, safeguard that the uuid of public file is corresponding
Offset is worth needing mutually exclusive operation when file, in needing thread pool to process each storage pool respectively when multiple storage pools
File operation simultaneously need to rank the operation of each storage pool.
In this method, concurrently behaviour when optimizing sanlock locks for the dependence of offset values and managing multiple storage pools
Make, acted on behalf of by agent, offset values management necessary to sanlock distributed locks is fallen in optimization, complete dividing for offset values
With and retry mechanism, and by agent act on behalf of, complete multiple storage pools optimum management operation, optimize distributed lock
The use of sanlock simultaneously manages multiple storage pools, while can also be acted on behalf of by agent that multistage fence mechanism is performed.This method
Solve offset values problem and the multiple storage pool management operations of optimization of sanlock locks.Fig. 2 for storage pool include it is basic
Information.Fig. 3 operates offset page after obtaining the resource institute on leases by sanlock for agent.
Detailed, Sanlock is the mutual exclusion by ensureing the lock information of cluster for the file read-write in shared storage,
The viability of the main frame is judged according to more newly arriving for timestamp simultaneously, therefore text can be ensured by the performance of sanlock locks
The exclusive read/write operation of part.
Wherein, by cluster file system, it is ensured that offset values file can be accessed by every main frame.By agent generations
Reason, resource management is locked using sanlock, by obtaining the corresponding lock resource of this document, reaches the mutual exclusion behaviour of offset value files
Make.Because a calculate node can be with carry multiple storage pool, therefore multiple storage pools are possible to concurrent operations, follow needs and lead to
Cross thread pool and ensure multiple storage pool concurrent operations.
Wherein, when mutual exclusive resource is busy, retry operation, but multiple storage pools can with concurrent operations, therefore
By two-dimentional queue, it is ensured that multiple storage pool concurrent operations are normal.The operation that one process is locked for sanlock is in general simultaneously
Concurrent operations can not be reached, sanlock busy can be caused when concurrent, therefore the multiple with sanlock is created by multithreading
Socket communicates, it is ensured that heavy traffic when concurrently being operated to sanlock.
Based on this method, in specific implementation process, agent codes are write, realize as above function, on each node portion
The agent is affixed one's name to, starts agent;Deployment sanlock is locked on each main frame;By qemu-img at the beginning of each cluster spring
Upper establishment ids spaces and leases spaces, and initialized by sanlock;Wound volume is called to call agent after ordering,
The uuid of the volume is distributed by agent, the acquisition interface of agent is called when obtaining the resource lock, it is not necessary to transmit
Offset values, equally call agent interfaces when release, perform release operation;For the operation locked except inquiry is outer, unify to pass through
Agent is performed.
Fig. 4 is refer to, Fig. 4 is a kind of sanlock optimization devices based on cluster file system provided by the present invention
Structural representation, for realizing the above-mentioned sanlock optimization methods based on cluster file system, the device includes:
Deployment module 101, for disposing proxy module agent in cluster file system;
Maintenance module 102, the offset values required for for safeguarding Distributed Lock Manager sanlock by agent, when
It is the file application offset values for needing to lock by agent when creating the file for needing to lock;
Creation module 103, for creating multithreading on agent, many of agent and sanlock is set up using multithreading
Individual socket communications.
It can be seen that, in the device, the distribution mechanism for completing offset values is acted on behalf of by agent, so using agent agencies
Optimization fall necessary to sanlock distributed locks offset values management, realize optimization sanlock lock for offset values according to
Rely, solve the offset value problems of sanlock locks.Also, multiple socket of agent and sanlock are created by multithreading
Communication, it is ensured that heavy traffic when concurrently being operated to sanlock.
Based on said apparatus, specifically, the maintenance module also includes:Recording unit, for offset values record to be existed
On offset value files on cluster file system.
Further, described device also includes:Setup module, for setting queuing mechanism and concurrent mechanism on agent.
Further, described device also includes:Acquisition module, offset files correspondence is obtained for being acted on behalf of by agent
Lock resource, using lock resource perform offset value files mutually exclusive operation
A kind of sanlock optimization method and devices based on cluster file system provided by the present invention are carried out above
It is discussed in detail.Specific case used herein is set forth to principle of the invention and implementation method, above example
Illustrate that being only intended to help understands the method for the present invention and its core concept.It should be pointed out that for the common skill of the art
For art personnel, under the premise without departing from the principles of the invention, some improvement and modification can also be carried out to the present invention, these change
Enter and modify to also fall into the protection domain of the claims in the present invention.
Claims (8)
1. a kind of sanlock optimization methods based on cluster file system, it is characterised in that including:
Agent is acted on behalf of in deployment in cluster file system;
Offset values required for safeguarding Distributed Lock Manager sanlock by agent, when the file for creating needs locking
When, it is the file application offset values for needing to lock by agent;
Multithreading is created on agent, set up agent using multithreading communicates with multiple socket of sanlock.
2. the method for claim 1, it is characterised in that described is the file application for needing to lock by agent
After offset values, also include:
By offset values record on the offset value files on cluster file system.
3. method as claimed in claim 2, it is characterised in that multithreading is created on agent, is set up using multithreading
Before agent communicates with multiple socket of sanlock, also include:
Queuing mechanism and concurrent mechanism are set on agent.
4. method as claimed in claim 3, it is characterised in that described that multithreading is created on agent, is set up using multithreading
After agent communicates with multiple socket of sanlock, also include:
Acted on behalf of by agent and obtain the corresponding lock resource of offset files, using the mutual exclusion for locking resource execution offset value files
Operation.
5. a kind of sanlock based on cluster file system optimizes device, it is characterised in that for realizing such as Claims 1-4
Device described in middle any one, including:
Deployment module, for disposing proxy module agent in cluster file system;
Maintenance module, the offset values required for for safeguarding Distributed Lock Manager sanlock by agent are needed when creating
It is the file application offset values for needing to lock by agent during the file to be locked;
Creation module, for creating multithreading on agent, multiple socket of agent and sanlock is set up using multithreading
Communication.
6. device as claimed in claim 5, it is characterised in that the maintenance module also includes:
Recording unit, for the offset value files by offset values record on cluster file system.
7. device as claimed in claim 6, it is characterised in that also include:
Setup module, for setting queuing mechanism and concurrent mechanism on agent.
8. device as claimed in claim 7, it is characterised in that also include:
Acquisition module, the corresponding lock resource of offset files is obtained for being acted on behalf of by agent, and offset is performed using resource is locked
It is worth the mutually exclusive operation of file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710107902.9A CN106909384B (en) | 2017-02-27 | 2017-02-27 | Sanlock optimization method and device based on cluster file system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710107902.9A CN106909384B (en) | 2017-02-27 | 2017-02-27 | Sanlock optimization method and device based on cluster file system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106909384A true CN106909384A (en) | 2017-06-30 |
CN106909384B CN106909384B (en) | 2020-09-04 |
Family
ID=59208849
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710107902.9A Active CN106909384B (en) | 2017-02-27 | 2017-02-27 | Sanlock optimization method and device based on cluster file system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106909384B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107357664A (en) * | 2017-07-13 | 2017-11-17 | 郑州云海信息技术有限公司 | The implementation method and device of a kind of distributed lock |
CN108874551A (en) * | 2018-06-26 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of distributed type lock management method and device |
CN109002360A (en) * | 2018-08-29 | 2018-12-14 | 郑州云海信息技术有限公司 | A kind of distributed lock failure separation method, device, computer storage and equipment |
CN109375988A (en) * | 2018-11-01 | 2019-02-22 | 郑州云海信息技术有限公司 | A kind of distributed lock implementation method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8935560B2 (en) * | 2010-08-17 | 2015-01-13 | Emc Corporation | System and method of file locking in a network file system federated namespace |
US9135049B2 (en) * | 2012-10-16 | 2015-09-15 | Red Hat Israel, Ltd. | Performing thin-provisioning operations on virtual disk images using native features of the storage domain |
CN106201357A (en) * | 2016-07-18 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The construction method of a kind of storage pool and system |
CN106293934A (en) * | 2016-07-19 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of cluster system management optimization method and platform |
-
2017
- 2017-02-27 CN CN201710107902.9A patent/CN106909384B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8935560B2 (en) * | 2010-08-17 | 2015-01-13 | Emc Corporation | System and method of file locking in a network file system federated namespace |
US9135049B2 (en) * | 2012-10-16 | 2015-09-15 | Red Hat Israel, Ltd. | Performing thin-provisioning operations on virtual disk images using native features of the storage domain |
CN106201357A (en) * | 2016-07-18 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The construction method of a kind of storage pool and system |
CN106293934A (en) * | 2016-07-19 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of cluster system management optimization method and platform |
Non-Patent Citations (1)
Title |
---|
TSI0120: "sanlock及其用法", 《HTTPS://BLOG.CSDN.NET/TSI0120/ARTICLE/DETAILS/10952513》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107357664A (en) * | 2017-07-13 | 2017-11-17 | 郑州云海信息技术有限公司 | The implementation method and device of a kind of distributed lock |
CN107357664B (en) * | 2017-07-13 | 2020-09-08 | 苏州浪潮智能科技有限公司 | Method and device for realizing distributed lock |
CN108874551A (en) * | 2018-06-26 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of distributed type lock management method and device |
CN109002360A (en) * | 2018-08-29 | 2018-12-14 | 郑州云海信息技术有限公司 | A kind of distributed lock failure separation method, device, computer storage and equipment |
CN109002360B (en) * | 2018-08-29 | 2021-10-26 | 郑州云海信息技术有限公司 | Distributed lock fault isolation method and device, computer memory and equipment |
CN109375988A (en) * | 2018-11-01 | 2019-02-22 | 郑州云海信息技术有限公司 | A kind of distributed lock implementation method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106909384B (en) | 2020-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE112016003120B4 (en) | Redirect a copy on write | |
CN109493076B (en) | Kafka message unique consumption method, system, server and storage medium | |
CN106909384A (en) | A kind of sanlock optimization method and devices based on cluster file system | |
DE112012005037B4 (en) | Manage redundant immutable files using deduplications in storage clouds | |
DE69404647T2 (en) | METHOD AND DEVICE FOR MANAGING A COMPANY'S TABLE COMPUTERS | |
CN101448002B (en) | Method and device for accessing digital resources | |
US10158579B2 (en) | Resource silos at network-accessible services | |
CN102187316B (en) | Backing up and restoring security information for selected database objects | |
CN109194711B (en) | Synchronization method, client, server and medium for organization architecture | |
DE112011103875T5 (en) | Network interface for deploying / redeploying a partition in a cloud environment | |
DE202009019149U1 (en) | Asynchronous distributed garbage collection for replicated storage clusters | |
DE112013002542T5 (en) | Cloud-based application resource files | |
CN1589448A (en) | System and method for implementing journaling in a multi-node environment | |
CN105635311A (en) | Method for synchronizing resource pool information in cloud management platform | |
DE102012218269A1 (en) | Interface for managing data movement in a thin provisioning storage system | |
US7069270B1 (en) | Automated method and mechanism for converting a single instance application to a multiple instance application | |
CN106777394A (en) | A kind of cluster file system | |
CN106301886A (en) | A kind of user operation auditing method and device | |
DE112020005227T5 (en) | MEMORY HEALTH MONITORING FOR DIFFERENT DATA RECOVERY CONFIGURATIONS | |
DE112019000402T5 (en) | CHRONOLOGICALLY ORDERED OUT-OF-PLACE UPDATE KEY VALUE STORAGE SYSTEM | |
CN110659259A (en) | Database migration method, server and computer storage medium | |
US11294866B2 (en) | Lazy optimistic concurrency control | |
CN105703941A (en) | Method and device for processing configuration transaction | |
CN102945264A (en) | Method for intelligently starting distributed transaction | |
CN101141763B (en) | Method and system of performing network element configuring authority management according to granularity of network element |
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 |