CN108874551A - A kind of distributed type lock management method and device - Google Patents

A kind of distributed type lock management method and device Download PDF

Info

Publication number
CN108874551A
CN108874551A CN201810669279.0A CN201810669279A CN108874551A CN 108874551 A CN108874551 A CN 108874551A CN 201810669279 A CN201810669279 A CN 201810669279A CN 108874551 A CN108874551 A CN 108874551A
Authority
CN
China
Prior art keywords
block
distributed
lock
size
distributed lock
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.)
Pending
Application number
CN201810669279.0A
Other languages
Chinese (zh)
Inventor
马怀旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810669279.0A priority Critical patent/CN108874551A/en
Publication of CN108874551A publication Critical patent/CN108874551A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (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 kind of distributed type lock management method and devices.It is related to computer cluster technology, solves the problems, such as that the wasting of resources and read or write speed are slower.This method includes:According to preset maximum node number option, the size of single distributed lock input and output I/O block is dynamically calculated;Distributed lock I/O block is distributed for each node.Technical solution provided by the invention is suitable for distributed lock configuration management, and the flexible configuration for realizing distributed lock resource uses.

Description

A kind of distributed type lock management method and device
Technical field
The present invention relates to computer cluster technology, espespecially a kind of distributed type lock management method and device.
Background technique
With the fast development of computer technology and network technology, large construction cluster uses in actual production environment, passes through Virtualization forms cloud computing, in virtualization system, it is often necessary to which coordination, way system is not either in same system Same or one group of resource is shared between different hosts, is generally required mutual exclusion to prevent mutual interference, is guaranteed consistency, therefore Distributed lock is needed to guarantee above situation.
Distributed lock implementation is substantially divided to two kinds, one is network is depended on, guarantees to obtain money by network communication The consistency in source, but for the stability dependency of network, such as DLM;Second of implementation is to rely on shared storage, is passed through Multi-party negotiation, implementation such as sanlock are guaranteed to the read-write of shared storage.The implementation of Sanlock is to rely on Disk paxos algorithm, but disk paxos algorithm depends on memory space, it is big that sanlock sets 2048 fixed blocks Small to realize disk paxos algorithm, i.e. the corresponding space of a resource is 1M, but many times actual use size is difficult The node number for reaching 2000+, causes the wasting of resources.Simultaneously as I/O block is excessive, the reaction speed of sanlock lock is influenced.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of distributed type lock management method and devices.
In order to reach the object of the invention, the present invention provides a kind of distributed type lock management methods, including:
According to preset maximum node number option, the size of single distributed lock input and output I/O block is dynamically calculated;
Distributed lock I/O block is distributed for each node.
Preferably, according to preset maximum node number option, single distributed lock input and output I/O block is dynamically calculated Size between the step of include:
According to following formula, the size of single distributed lock I/O block is calculated:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
Preferably, according to preset maximum node number option, single distributed lock input and output I/O block is dynamically calculated Size the step of before, further include:
Update the value of the maximum node number option.
Preferably, this method further includes:
Each node reads and writes corresponding distributed lock I/O block, completes locking or unlocks.
The present invention also provides a kind of distributed lock management devices, including:
Dynamic memory space configuration module, for according to preset maximum node number option, dynamically calculating single point The size of cloth lock input and output I/O block;
Space distribution module, for distributing distributed lock I/O block for each node.
Preferably, the dynamic memory space configuration module is specifically used for being calculated single distributed according to following formula Lock the size of I/O block:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
Preferably, which includes:
Parameter configuration module, for updating the value of the maximum node number option.
The present invention provides a kind of distributed type lock management method and devices to move according to preset maximum node number option State calculates the size of single distributed lock input and output I/O block, distributes distributed lock I/O block for each node.It realizes point The flexible configuration that cloth locks resource uses, and solves the problems, such as that the wasting of resources and read or write speed are slower.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is a kind of flow diagram for distributed type lock management method that one embodiment of the invention provides;
Fig. 2 is a kind of structural schematic diagram for distributed lock management device that one embodiment of the invention provides.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
The embodiment of the present invention proposes a kind of distributed type lock management method and device based on storage, by being arranged such as The maximum node number that sanlock distributed lock is supported dynamically to adjust the space size of the single resource occupation of distributed lock, Optimize memory space resource to use, while the I/O size of sanlock can be reduced, speeds sanlock lock reactor speed.
One embodiment of the invention provides a kind of distributed type lock management method, completes distributed lock using this method and configures The process used is as shown in Figure 1, include:
Step 101, the value for updating maximum node number option.
The embodiment of the present invention is illustrated for using sanlock to implement distributed lock.
In this step, by configuration file mode, the maximum node number of sanlock support can be dynamically set.
Step 102, according to preset maximum node number option, dynamically calculate single distributed lock input and output I/O The size of block.
In this step, optimization sanlock locks resource offset, directly becomes input number from the multiple of the 1M inputted originally Word, while number is converted to the resource size in memory and multiplied in number by inside, carries out the unit particle size of storage resource into one Step refinement.
Maximum node number is read from configuration file, based on offset, configures memory, according to following formula, Calculate the size of single distributed lock I/O block:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
Step 103 distributes distributed lock I/O block for each node.
In this step, as soon as distributing a distributed lock I/O block for each node, subsequent each node is obtained using distribution Distributed lock I/O block.
Preferably, the distributed lock I/O number of blocks that occupancy can not be limited when distributed lock is used in a manner of small documents.
For example, adjustment sanlock I/O mode, to issue I/O according to the maximum node number of configuration.Again it compiles The rpm packet of sanlock, normal deployment use sanlock.
By modifying sanlock I/O mode, the reading write-in of originally fixed length becomes to adjust by reading sanlock memory The block size of whole reading only reads the content of block size, mitigates I/O pressure.
Step 104, each node read and write corresponding distributed lock I/O block, complete locking or unlock.
One embodiment of the invention additionally provides a kind of distributed lock management device, and structure is as shown in Fig. 2, include:
Dynamic memory space configuration module 201, it is single for dynamically calculating according to preset maximum node number option The size of distributed lock input and output I/O block;
Space distribution module 202, for distributing distributed lock I/O block for each node.
Preferably, the dynamic memory space configuration module 201 is specifically used for calculating single point according to following formula The size of cloth lock I/O block:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
Preferably, which includes:
Parameter configuration module 203, for updating the value of the maximum node number option.
The embodiment provides a kind of distributed type lock management method and devices, according to preset maximum node number Option dynamically calculates the size of single distributed lock input and output I/O block, distributes distributed lock I/O block for each node.It is real The flexible configuration for having showed distributed lock resource uses, and solves the problems, such as that the wasting of resources and read or write speed are slower.
It is realized by the code of optimization sanlock distributed lock, increases dynamically configurable maximum node number option, That modifies offset simultaneously enters ginseng, and the carry out calculations of offset of internal dynamic optimizes the rate of distributed lock, while increasing same The number for the distribution distributed lock I/O block resource that one block space is supported.The block of I/O when reducing distributed lock each resource acquisition Size improves I/O rate, improves the speed for obtaining resource.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove Functional module/unit in setting may be implemented as software, firmware, hardware and its combination appropriate.In hardware embodiment, Division between the functional module/unit referred in the above description not necessarily corresponds to the division of physical assemblies;For example, one Physical assemblies can have multiple functions or a function or step and can be executed by several physical assemblies cooperations.Certain groups Part or all components may be implemented as by processor, such as the software that digital signal processor or microprocessor execute, or by It is embodied as hardware, or is implemented as integrated circuit, such as specific integrated circuit.Such software can be distributed in computer-readable On medium, computer-readable medium may include computer storage medium (or non-transitory medium) and communication media (or temporarily Property medium).As known to a person of ordinary skill in the art, term computer storage medium is included in for storing information (such as Computer readable instructions, data structure, program module or other data) any method or technique in the volatibility implemented and non- Volatibility, removable and nonremovable medium.Computer storage medium include but is not limited to RAM, ROM, EEPROM, flash memory or its His memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other Magnetic memory apparatus or any other medium that can be used for storing desired information and can be accessed by a computer.This Outside, known to a person of ordinary skill in the art to be, communication media generally comprises computer readable instructions, data structure, program mould Other data in the modulated data signal of block or such as carrier wave or other transmission mechanisms etc, and may include any information Delivery media.

Claims (7)

1. a kind of distributed type lock management method, which is characterized in that including:
According to preset maximum node number option, the size of single distributed lock input and output I/O block is dynamically calculated;
Distributed lock I/O block is distributed for each node.
2. distributed type lock management method according to claim 1, which is characterized in that selected according to preset maximum node number , the step of dynamically calculating between the size of single distributed lock input and output I/O block includes:
According to following formula, the size of single distributed lock I/O block is calculated:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
3. distributed type lock management method according to claim 1, which is characterized in that selected according to preset maximum node number , before the step of dynamically calculating the size of single distributed lock input and output I/O block, further include:
Update the value of the maximum node number option.
4. distributed type lock management method according to claim 1, which is characterized in that this method further includes:
Each node reads and writes corresponding distributed lock I/O block, completes locking or unlocks.
5. a kind of distributed lock management device, which is characterized in that including:
Dynamic memory space configuration module, for dynamically calculating single distribution according to preset maximum node number option Lock the size of input and output I/O block;
Space distribution module, for distributing distributed lock I/O block for each node.
6. distributed lock management device according to claim 5, which is characterized in that the dynamic memory space configuration mould Block is specifically used for calculating the size of single distributed lock I/O block according to following formula:
Lock space size/(512* (the maximum node number+2)) of the size of distributed lock I/O block=total.
7. distributed lock management device according to claim 6, which is characterized in that the device includes:
Parameter configuration module, for updating the value of the maximum node number option.
CN201810669279.0A 2018-06-26 2018-06-26 A kind of distributed type lock management method and device Pending CN108874551A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810669279.0A CN108874551A (en) 2018-06-26 2018-06-26 A kind of distributed type lock management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810669279.0A CN108874551A (en) 2018-06-26 2018-06-26 A kind of distributed type lock management method and device

Publications (1)

Publication Number Publication Date
CN108874551A true CN108874551A (en) 2018-11-23

Family

ID=64294909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810669279.0A Pending CN108874551A (en) 2018-06-26 2018-06-26 A kind of distributed type lock management method and device

Country Status (1)

Country Link
CN (1) CN108874551A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515911A (en) * 2019-08-09 2019-11-29 济南浪潮数据技术有限公司 The processing method and processing device of resource

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN106909384A (en) * 2017-02-27 2017-06-30 郑州云海信息技术有限公司 A kind of sanlock optimization method and devices based on cluster file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN106909384A (en) * 2017-02-27 2017-06-30 郑州云海信息技术有限公司 A kind of sanlock optimization method and devices based on cluster file system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
如山石: "sanlock原理介绍及应用", 《HTTPS://BLOG.CSDN.NET/MAOKEXU123/ARTICLE/DETAILS/40790939》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515911A (en) * 2019-08-09 2019-11-29 济南浪潮数据技术有限公司 The processing method and processing device of resource
CN110515911B (en) * 2019-08-09 2022-03-22 济南浪潮数据技术有限公司 Resource processing method and device

Similar Documents

Publication Publication Date Title
US10505796B2 (en) Network function virtualization
US11036737B2 (en) Partitioned bloom filter merge for massively parallel processing clustered data management
CN107463418B (en) Configuration file generation method and device for server middleware
US9747199B2 (en) Analytics based control of thin provisioning environment
US11150949B2 (en) Resource release method, resource allocation method, devices, and computer program products
CN110018878B (en) Distributed system data loading method and device
US20160205048A1 (en) Supporting multiple vswitches on a single host
US9699252B2 (en) Deployment of virtual machine disks from a shared network file system
US8909596B1 (en) Operational-transform-compatible representation of 2-dimensional page layout data
WO2017050064A1 (en) Memory management method and device for shared memory database
WO2023207361A1 (en) Memory management method, system, device and computer readable storage medium
WO2022104964A1 (en) Dynamic partition customization method and apparatus, and device
CN108874551A (en) A kind of distributed type lock management method and device
CN111309424A (en) Page restoration method and related equipment
US9690728B1 (en) Burst buffer appliance comprising multiple virtual machines
CN113127430A (en) Mirror image information processing method and device, computer readable medium and electronic equipment
CN110399201A (en) A kind of method, apparatus and cloud management platform of openstack calculate node host maintenance
CN109002332B (en) Process starting and configuring method, device and system
CN109522092A (en) A kind of cloud pipe platform receives pipe virtual machine method and apparatus
CN109144740A (en) A kind of distributed lock implementation method and device
WO2021104051A1 (en) Site coordinate planning method, apparatus, device, and storage medium
CN109324907A (en) A kind of distributed type lock management method and device
CN109165083A (en) A kind of virtual machine configuration method and apparatus
CN112506583A (en) Instance control method, device, equipment, storage medium and program product
EP4383651A1 (en) Micro-service logic network and construction method and apparatus thereof, device and readable medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20181123

RJ01 Rejection of invention patent application after publication