CN110703996B - Method, system and device for managing cluster handle based on tgt and readable storage medium - Google Patents

Method, system and device for managing cluster handle based on tgt and readable storage medium Download PDF

Info

Publication number
CN110703996B
CN110703996B CN201910931393.0A CN201910931393A CN110703996B CN 110703996 B CN110703996 B CN 110703996B CN 201910931393 A CN201910931393 A CN 201910931393A CN 110703996 B CN110703996 B CN 110703996B
Authority
CN
China
Prior art keywords
cluster
storage pool
volume
reference count
handle
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
CN201910931393.0A
Other languages
Chinese (zh)
Other versions
CN110703996A (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 CN201910931393.0A priority Critical patent/CN110703996B/en
Publication of CN110703996A publication Critical patent/CN110703996A/en
Application granted granted Critical
Publication of CN110703996B publication Critical patent/CN110703996B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Abstract

The application discloses a cluster handle management method, a system and a device based on tgt and a computer readable storage medium, comprising: when the cluster handle structure of the storage cluster is created, adding one to the cluster reference count in the cluster handle structure; when the storage pool structural body of the storage pool corresponding to the LUN creation information is created, adding one to the storage pool reference count in the storage pool structural body; when the volume structure body of the volume corresponding to the LUN creation information is created, adding one to the volume reference count in the volume structure body; according to the method, the structure body is additionally provided with the corresponding reference counting for recording the number of the LUNs corresponding to the storage cluster, the storage pool and the volume, the number of the LUNs is counted by using the reference counting, the LUNs are managed by using the handle information and the context information, and all the LUNs can be managed by only establishing one cluster handle structure body by one tgt thread, so that the load capacity of the cluster is improved, and the consumption of computing resources is reduced.

Description

Method, system and device for managing cluster handle based on tgt and readable storage medium
Technical Field
The present invention relates to the field of distributed storage clusters, and in particular, to a tgt-based cluster handle management method, system, apparatus, and computer-readable storage medium.
Background
iSCSI (Internet Small Computer System Interface) mainly uses TCP/IP technology to make the storage device (RBD) end pass through iSCSI target function to make server end capable of providing disk, and then pass through iSCSI initiator function to make client end capable of mounting iSCSI target, so that it can use iSCSI protocol to apply disk.
That is, the iSCSI architecture mainly divides the storage device and the used host into two parts, which are:
iSCSI target: the system is a storage device end and is used for storing a disk or RAID equipment, and a Linux host can be simulated into an iSCSI target at present so as to provide a disk used by other hosts;
iSCSI initiator: that is, a client capable of using a target, typically a server, i.e., a server that wants to connect to an iSCSI target, must install the relevant functions of the iSCSI initiator before it can use the disk provided by the iSCSI target.
The client can establish connection with the Tgt through the above ways to access the underlying librbd, so as to realize the operation of block storage, one target can be mapped with a plurality of block devices, meanwhile, one Tgt can create a plurality of targets, the client can connect one or more targets on the Tgt to access respectively, the Tgt can create LUNs to provide block services for the client, and one LUN corresponds to one block storage volume.
The traditional mapping step is that one LUN corresponds to one cluster handle, one storage pool context and one volume context, which is convenient for separate management of information related to each LUN, but in a large-scale distributed block storage scenario, the number of volumes is counted in tens of thousands, and if one cluster handle is opened for each volume, a large amount of cluster resources are undoubtedly occupied, the load of a cluster is increased, and paralysis may be caused in a severe case.
For this reason, a cluster handle management method with a small resource occupation is required.
Disclosure of Invention
In view of this, the present invention provides a tgt-based cluster handle management method, system, device and computer readable storage medium, which reduces resource occupancy rate and improves resource utilization efficiency. The specific scheme is as follows:
a tgt-based cluster handle management method, comprising:
receiving LUN creation information;
based on iSCSI, connecting a storage cluster, and judging whether a cluster handle structure body of the storage cluster is established or not; the cluster handle structure body comprises cluster reference count and handle information of the storage cluster;
if so, adding one to the cluster reference count in the cluster handle structure;
judging whether a storage pool structure body of a storage pool corresponding to the LUN creation information is created or not by using the handle information in the cluster handle structure body; the storage pool structure body comprises a storage pool reference count and storage pool context information;
if so, adding one to the storage pool reference count in the storage pool fabric;
determining whether a volume structure of a volume corresponding to the LUN creation information is created by using the storage pool context information in the storage pool structure; the volume structure includes a volume reference count and volume context information;
if so, then the volume reference count in the volume structure is incremented by one.
Optionally, the step of determining whether the cluster handle structure of the storage cluster exists includes:
judging whether a first creation sign of the cluster handle structure body of the storage cluster exists or not; the cluster handle structure comprises a cluster reference count, the handle information and the first creation flag;
the step of determining whether a storage pool structure of the storage pool corresponding to the LUN creation information exists includes:
determining whether a second creation flag of the storage pool structure of the storage pool corresponding to the LUN creation information exists; the storage pool fabric comprises a storage pool reference count, storage pool context information, and the second creation flag;
the determining whether a volume structure of a volume corresponding to the LUN creation information exists includes:
determining whether a third creation flag of the volume structure of the volume corresponding to the LUN creation information exists; the volume structure includes a volume reference count, volume context information, and the third create flag.
Optionally, the storage pool structure is a map that stores storage pool names as keys and storage pool context information as keys in advance;
the volume structure is a map which stores storage pool names plus volume names as keys in advance, and the volume context information is the keys.
Optionally, the method further includes:
receiving LUN release information corresponding to the LUN creation information;
subtracting one from the volume reference count, and judging whether the volume reference count is 0;
if not, subtracting one from the storage pool reference count and the cluster reference count;
if so, deleting the volume structure body, subtracting one from the reference count of the storage pool, and judging whether the reference count of the storage pool is 0;
if not, subtracting one from the cluster reference count;
if so, deleting the storage pool structure, subtracting one from the cluster reference count, and judging whether the cluster reference count is 0;
and if so, deleting the cluster handle structure body.
The invention also discloses a cluster handle management system based on tgt, which comprises:
the creation information receiving module is used for receiving LUN creation information;
the cluster structure body judging module is used for connecting the storage cluster based on iSCSI and judging whether a cluster handle structure body of the storage cluster is established; the cluster handle structure body comprises cluster reference counts and handle information of the storage cluster;
the cluster counting module is used for adding one to the cluster reference count in the cluster handle structure body if the cluster structure body judging module judges that the cluster handle structure body is established;
a storage pool structure determining module, configured to determine, by using the handle information in the cluster handle structure, whether a storage pool structure of a storage pool corresponding to the LUN creation information has been created; the storage pool fabric comprises a storage pool reference count and storage pool context information;
the storage pool counting module is used for adding one to the storage pool reference count in the storage pool structure body if the storage pool structure body judging module judges that the storage pool structure body is established;
a volume structure body judging module, configured to judge, by using the storage pool context information in the storage pool structure body, whether a volume structure body of a volume corresponding to the LUN creation information is created; the volume structure includes a volume reference count and volume context information;
and the volume counting module is used for adding one to the volume reference count in the volume structure if the volume structure judging module judges that the volume structure is established.
Optionally, the cluster structure determining module is specifically configured to determine whether a first creation flag of the cluster handle structure of the storage cluster exists; the cluster handle structure comprises a cluster reference count, the handle information and the first creation flag;
the storage pool structure determining module is specifically configured to determine whether a second creation flag of the storage pool structure of the storage pool corresponding to the LUN creation information exists; the storage pool fabric comprises a storage pool reference count, storage pool context information, and the second creation flag;
the volume structure determination module is specifically configured to determine whether a third creation flag of the volume structure of the volume corresponding to the LUN creation information exists; the volume structure includes a volume reference count, volume context information, and the third create flag.
Optionally, the storage pool structure is a map that stores storage pool names as keys and storage pool context information as keys in advance;
the volume structure is a map which stores storage pool names plus volume names as keys in advance, and the volume context information is the keys.
Optionally, the method further includes:
a release information receiving module, configured to receive LUN release information corresponding to the LUN creation information;
the volume release judging module is used for subtracting one from the volume reference count and judging whether the volume reference count is 0 or not;
a first counting module, configured to subtract one from the storage pool reference count and the cluster reference count if the volume release determination module determines that the volume reference count is not 0;
a storage pool release judging module, configured to delete the volume structure if the volume reference count is determined to be 0 by the volume release judging module, and subtract one from the storage pool reference count to determine whether the storage pool reference count is 0;
a second counting module, configured to decrement the cluster reference count by one if the storage pool release determination module determines that the storage pool reference count is not 0;
a cluster release determination module, configured to delete the storage pool structure if the storage pool release determination module determines that the storage pool reference count is 0, and subtract one from the cluster reference count to determine whether the cluster reference count is 0;
and the cluster structure body deleting module is used for deleting the cluster handle structure body if the cluster releasing judging module judges that the cluster reference count is 0.
The invention also discloses a cluster handle management device based on tgt, which comprises:
a memory for storing a computer program;
a processor for executing the computer program to implement the tgt-based cluster handle management method as described above.
The present invention also discloses a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the tgt-based cluster handle management method as described above.
In the invention, the cluster handle management method based on tgt comprises the following steps: receiving LUN creation information; based on iSCSI, connecting the storage cluster, and judging whether a cluster handle structure body of the storage cluster is established; the cluster handle structure body comprises cluster reference counting and handle information of a storage cluster; if the cluster handle structure is created, adding one to the cluster reference count in the cluster handle structure; judging whether a storage pool structure body of the storage pool corresponding to the LUN creation information is created or not by utilizing the handle information in the cluster handle structure body; the storage pool structure comprises a storage pool reference count and storage pool context information; if so, adding one to the storage pool reference count in the storage pool fabric; judging whether a volume structure body of a volume corresponding to the LUN creation information is created or not by using the storage pool context information in the storage pool structure body; the volume structure includes a volume reference count and volume context information; if it has been created, the volume reference count in the volume structure is incremented by one.
The invention does not set up a corresponding cluster handle structure body, a storage pool structure body and a volume structure body for each LUN any more, but adds a corresponding reference count in the structure body for recording the number of the LUNs corresponding to the storage cluster, the storage pool and the volume, uses the reference count to count the number of the LUNs, and uses the handle information and the context information to manage the LUNs, one tgt thread can manage all the LUNs only by setting up one cluster handle structure body, thereby improving the load capacity of the cluster and reducing the consumption of computing resources.
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 schematic flow chart of a cluster handle management method based on tgt according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart of another tgt-based cluster handle management method according to an embodiment of the present invention;
FIG. 3 is a schematic flowchart of another tgt-based cluster handle management method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another tgt-based cluster handle management system according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The embodiment of the invention discloses a cluster handle management method based on tgt, which is shown in figure 1 and comprises the following steps:
s11: LUN creation information is received.
Specifically, when the LUN needs to be created, LUN creation information input by a user through an input device and an interface is received, and the LUN creation steps described below are performed based on the LUN creation information.
S12: based on iSCSI, connecting the storage cluster and judging whether a cluster handle structure body of the storage cluster is established.
Specifically, iSCSI may be preconfigured to set a use environment for tgt applications, and after receiving LUN creation information, connection needs to be established with the storage cluster to obtain a cluster handle structure of the storage cluster generated in advance, and establish a reference relationship between a tgt thread and the cluster handle structure.
It will be appreciated that each time a LUN is created, it may not be the first time a LUN is created, so it is necessary to determine whether a cluster handle structure that has already been established with the tgt thread reference relationship to avoid repeatedly creating the cluster handle structure.
The cluster handle structure body comprises a cluster reference count and handle information of a storage cluster, wherein the cluster reference count is used for recording the number of LUNs established under the storage cluster, and the handle information of the storage cluster is used for indexing a storage pool under the storage cluster and enabling a user to operate the storage pool under the cluster.
S13: if it has been created, the reference count in the cluster handle structure is incremented by one.
Specifically, if the cluster handle structure body is already established, it is not necessary to newly establish a cluster handle structure body, so that the repeated establishment occupies too many resources, and the reference count in the cluster handle structure body can be directly increased by one to mark that a new LUN is created this time.
It can be understood that, if the LUN creation is performed for the first time, as in the prior art, a cluster handle structure is newly created for use.
S14: and judging whether the storage pool structure body of the storage pool corresponding to the LUN creation information is created or not by using the handle information in the cluster handle structure body.
Specifically, since one storage cluster only has one cluster handle structure, and the storage device side is also only connected with one storage cluster, the storage device side needs to know where the LUN is created only by knowing the LUN creation information, and can acquire the cluster handle structure of the storage cluster, and the storage cluster corresponds to a plurality of storage pools, and the storage device side needs to know the location where the LUN is created, therefore, whether the storage pool structure of the storage pool recorded in the LUN creation information is already created is judged by using the storage pool and the handle information recorded in the LUN creation information, so as to avoid that the system resources are occupied by repeatedly creating the same storage pool structure.
The storage pool structure body comprises a storage pool reference count and storage pool context information, wherein the storage pool reference count is used for recording the number of LUNs established in the storage pool, and the storage pool context information is used for allowing a user to perform operations such as new creation and indexing on the volumes in the storage pool.
S15: if so, the reference count in the storage pool fabric is incremented by one.
Specifically, if there is no need to rebuild the storage pool structure, one may be added to the reference count in the storage pool structure to record that the LUN is newly built in the storage pool this time.
Specifically, if there is no storage pool structure, a storage pool structure is newly created under the tgt thread, and it can be understood that the structure, tgt, created under the tgt thread can be invoked and managed.
S16: whether a volume structure of a volume corresponding to the LUN creation information is created is determined by using the storage pool context information in the storage pool structure.
Specifically, the storage pool context information in the storage pool structure is continuously utilized to judge whether the volume structure of the volume corresponding to the LUN creation information is created, and in the same way, the volume structure is prevented from being repeatedly created, and resource waste is avoided.
The volume structure body comprises a reference count and volume context information, wherein the reference count is used for recording the number of the LUNs established under the volume, and the volume context information is used for allowing the volume to realize operations such as new LUNs and the like.
S17: if it has been created, the reference count in the volume structure is incremented by one.
Specifically, if there is an existing volume structure, the reference count in the volume structure is incremented by one, and a new volume structure does not need to be created, so that resources are saved.
Therefore, in the embodiment of the invention, the corresponding cluster handle structure body, the storage pool structure body and the volume structure body are not established for each LUN, but the corresponding reference count is added in the structure body and is used for recording the number of the corresponding LUNs under the storage cluster, the storage pool and the volume, the number of the LUNs is counted by using the reference count, the LUNs are managed by using the handle information and the context information, and all the LUNs can be managed by establishing one cluster handle structure body for one tgt thread, so that the load capacity of the cluster is improved, and the consumption of computing resources is reduced.
The embodiment of the invention discloses a specific cluster handle management method based on tgt, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. Specifically, the method comprises the following steps:
s21: receiving LUN creation information;
s22: connecting a storage cluster based on iSCSI, and judging whether a first creation sign of a cluster handle structure body of the storage cluster exists or not; the cluster handle structure body comprises a cluster reference count, handle information and a first creation mark;
s24: if so, adding one to the cluster reference count in the cluster handle structure;
s25: judging whether a second creation sign of the storage pool structure body of the storage pool corresponding to the LUN creation information exists or not by using the handle information in the cluster handle structure body; the storage pool structure body comprises a storage pool reference count, storage pool context information and a second creation flag;
s26: if yes, adding one to the storage pool reference count in the storage pool structure;
s27: determining whether a third creation flag of the volume structure of the volume corresponding to the LUN creation information exists by using the storage pool context information in the storage pool structure; the volume structure includes a volume reference count, volume context information, and a third creation flag.
S28: if so, the volume reference count in the volume structure is incremented by one.
Specifically, a creation flag is added in advance in a structure body, whether the structure body is created or not is quickly judged by detecting whether the creation flag exists or not, a first creation flag is set in a cluster handle structure body, a second creation flag is set in a storage pool structure body, a third creation flag is set in a volume structure body, whether the structure body exists or not is judged by judging whether the creation flag of each structure body exists or not, and if the creation flag does not exist, the structure body is not created.
Further, the storage pool structure is a map which is stored by respectively using the storage pool name and the storage pool context information as keys in advance, namely the storage pool name and the storage pool context information are respectively stored in the storage pool structure as different keys; the volume structure is a map that stores storage pool names plus volume names as one key and volume context information as another different key in advance.
The present embodiment further discloses a specific tgt-based cluster handle management method, which is shown in fig. 3, and specifically:
in order to further utilize computing resources most efficiently, after all LUNs in one storage cluster, storage pool and/or volume are released, the storage cluster, storage pool and/or volume without continuing to retain the cluster handle structure, storage pool structure and/or volume structure may be deleted to release computing resources and reduce the load on the storage device side, and the method may further include the following steps S31 to S37; wherein, the first and the second end of the pipe are connected with each other,
s31: and receiving LUN release information corresponding to the LUN creation information.
Specifically, the LUN release information is information for releasing a LUN, and for convenience of example, the LUN release information corresponding to the LUN creation information in the foregoing embodiments is enumerated in the embodiment of the present invention.
S32: subtracting one from the volume reference count, and judging whether the volume reference count is 0 or not;
specifically, the storage cluster, the storage pool and the volume have a dependency relationship, so that the volume reference count in the volume structure of the lowest-level volume is reduced by one, and when the reference count becomes 0, the structure is deleted, which indicates that no LUN remains, so that LUN release information can be received to indicate that the LUN still exists in the current volume, and therefore, the volume reference count can be directly reduced by one; after subtracting one, it is determined whether the volume reference count is 0.
S33: if not, the storage pool reference count and the cluster reference count are decremented by one.
Specifically, if the volume reference count is not 0, which indicates that both the storage pool and the storage cluster have subordinate LUNs, only the storage pool reference count and the cluster reference count need to be correspondingly decremented by one, and the storage pool reference count and the cluster reference count cannot be set to 0.
S34: if so, deleting the volume structure, subtracting one from the storage pool reference count, and judging whether the storage pool reference count is 0.
Specifically, if the volume reference count is 0 after subtracting one, it indicates that there is no LUN under the volume, and in order to release resources, the volume structure is deleted, and since the storage pool may include multiple volumes, the storage pool reference count is continuously subtracted by one, and it is determined whether the storage pool reference count is 0.
S35: if not, the cluster reference count is decremented by one.
It will be appreciated that if not, then it is sufficient to continue decrementing the cluster reference count by one.
S36: if yes, deleting the storage pool structure body, subtracting one from the cluster reference count, and judging whether the cluster reference count is 0.
Specifically, if the number is 0, the storage pool structure is deleted, and the last cluster reference count is decremented by one and is determined.
S37: if yes, deleting the cluster handle structure.
Specifically, if the value is not 0, the operation does not need to be continued, the release is finished, and if the value is 0, the LUN that is not used in the storage cluster is placed, the cluster handle structure can be deleted, and the computing resources of the tgt thread are released.
Correspondingly, an embodiment of the present invention further discloses a tgt-based cluster handle management system, which is shown in fig. 4 and includes:
the creation information receiving module is used for receiving LUN creation information;
the cluster structure judging module is used for connecting the storage cluster based on iSCSI and judging whether a cluster handle structure of the storage cluster is established or not; the cluster handle structure body comprises cluster reference counting and handle information of a storage cluster;
the cluster counting module is used for adding one to the cluster reference count in the cluster handle structure body if the cluster structure body judging module judges that the cluster handle structure body is established;
the storage pool structure judging module is used for judging whether the storage pool structure of the storage pool corresponding to the LUN creation information is created or not by utilizing the handle information in the cluster handle structure; the storage pool structure comprises a storage pool reference count and storage pool context information;
the storage pool counting module is used for adding one to the reference count of the storage pool in the storage pool structure body if the storage pool structure body judging module judges that the storage pool structure body is established;
a volume structure judging module, configured to judge, by using the storage pool context information in the storage pool structure, whether a volume structure of a volume corresponding to the LUN creation information has been created; the volume structure includes a volume reference count and volume context information;
and the volume counting module is used for adding one to the volume reference count in the volume structure if the volume structure judging module judges that the volume structure is established.
Specifically, the cluster structure determining module is specifically configured to determine whether a first creation flag of a cluster handle structure of a storage cluster exists; the cluster handle structure body comprises a cluster reference count, handle information and a first creation mark;
the storage pool structure body judging module is specifically used for judging whether a second creation flag of the storage pool structure body of the storage pool corresponding to the LUN creation information exists or not; the storage pool structure body comprises a storage pool reference count, storage pool context information and a second creation flag;
a volume structure determination module, configured to determine whether a third creation flag of a volume structure of a volume corresponding to the LUN creation information exists; the volume structure includes a volume reference count, volume context information, and a third creation flag.
Specifically, the storage pool structure is a map which is stored by respectively taking the storage pool name and the storage pool context information as keys in advance;
the volume structure is a map stored in advance by using the storage pool name plus the volume name and the volume context information as keys.
Specifically, the system can further comprise a release information receiving module, a volume release judging module, a first counting module, a storage pool release judging module, a second counting module, a cluster release judging module and a cluster structure deleting module; wherein the content of the first and second substances,
the release information receiving module is used for receiving LUN release information corresponding to the LUN creation information;
the volume release judging module is used for subtracting one from the volume reference count and judging whether the volume reference count is 0 or not;
the first counting module is used for subtracting one from the storage pool reference count and the cluster reference count if the volume release judging module judges that the volume reference count is not 0;
the storage pool release judging module is used for deleting the volume structure body if the volume release judging module judges that the volume reference count is 0, subtracting one from the storage pool reference count and judging whether the storage pool reference count is 0 or not;
the second counting module is used for subtracting one from the cluster reference count if the storage pool release judging module judges that the storage pool reference count is not 0;
the cluster release judging module is used for deleting the storage pool structure body if the storage pool release judging module judges that the reference count of the storage pool is 0, subtracting one from the reference count of the cluster and judging whether the reference count of the cluster is 0 or not;
and the cluster structure deleting module is used for deleting the cluster handle structure if the cluster releasing judging module judges that the cluster reference count is 0.
In addition, the embodiment of the invention also discloses a cluster handle management device based on tgt, which comprises the following steps:
a memory for storing a computer program;
a processor for executing a computer program to implement the tgt-based cluster handle management method as described above.
In addition, the embodiment of the present invention further discloses a computer readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the cluster handle management method based on tgt is implemented.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The technical content provided by the present invention is described in detail above, and the principle and the implementation of the present invention are explained in this document by applying specific examples, and the above description of the examples is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A tgt-based cluster handle management method, comprising:
receiving LUN creation information;
based on iSCSI, connecting a storage cluster, and judging whether a cluster handle structure body of the storage cluster is established or not; the cluster handle structure body comprises cluster reference count and handle information of the storage cluster;
if so, adding one to the cluster reference count in the cluster handle structure;
judging whether a storage pool structure body of a storage pool corresponding to the LUN creation information is created or not by using the handle information in the cluster handle structure body; the storage pool fabric comprises a storage pool reference count and storage pool context information;
if so, adding one to the storage pool reference count in the storage pool structure;
judging whether a volume structure of a volume corresponding to the LUN creation information is created or not by using the storage pool context information in the storage pool structure; the volume structure includes a volume reference count and volume context information;
if so, then the volume reference count in the volume structure is incremented by one.
2. The tgt-based cluster handle management method according to claim 1, wherein the determining whether the cluster handle structure of the storage cluster exists comprises:
judging whether a first creation sign of the cluster handle structure of the storage cluster exists or not; the cluster handle structure comprises a cluster reference count, the handle information and the first creation flag;
the determining whether or not there is a storage pool structure of a storage pool corresponding to the LUN creation information includes:
determining whether or not there is a second creation flag of the storage pool structural body of the storage pool corresponding to the LUN creation information; the storage pool fabric comprises a storage pool reference count, storage pool context information, and the second creation flag;
the determining whether a volume structure of a volume corresponding to the LUN creation information exists includes:
determining whether a third creation flag of the volume structure of the volume corresponding to the LUN creation information exists; the volume structure includes a volume reference count, volume context information, and the third create flag.
3. The tgt-based cluster handle management method according to claim 1, wherein the storage pool structure is a map that stores storage pool names and storage pool context information in advance respectively as keys;
the volume structure is a map which stores storage pool names and volume names as keys in advance, and the volume context information is the keys.
4. The tgt-based cluster handle management method according to any of claims 1 to 3, further comprising:
receiving LUN release information corresponding to the LUN creation information;
subtracting one from the volume reference count, and judging whether the volume reference count is 0;
if not, subtracting one from the storage pool reference count and the cluster reference count;
if so, deleting the volume structure body, subtracting one from the reference count of the storage pool, and judging whether the reference count of the storage pool is 0;
if not, subtracting one from the cluster reference count;
if yes, deleting the storage pool structure body, subtracting one from the cluster reference count, and judging whether the cluster reference count is 0;
and if so, deleting the cluster handle structure body.
5. A tgt-based cluster handle management system, comprising:
the creation information receiving module is used for receiving LUN creation information;
the cluster structure judging module is used for connecting the storage cluster based on iSCSI and judging whether a cluster handle structure of the storage cluster is established or not; the cluster handle structure body comprises cluster reference counts and handle information of the storage cluster;
the cluster counting module is used for adding one to the cluster reference count in the cluster handle structure body if the cluster structure body judging module judges that the cluster handle structure body is established;
a storage pool structure determining module, configured to determine, by using the handle information in the cluster handle structure, whether a storage pool structure of a storage pool corresponding to the LUN creation information has been created; the storage pool structure body comprises a storage pool reference count and storage pool context information;
the storage pool structure body judging module is used for judging whether the storage pool structure body is created or not according to the reference count of the storage pool in the storage pool structure body;
a volume structure determination module, configured to determine, by using the storage pool context information in the storage pool structure, whether a volume structure of a volume corresponding to the LUN creation information is created; the volume structure includes a volume reference count and volume context information;
and the volume counting module is used for adding one to the volume reference count in the volume structure if the volume structure judging module judges that the volume structure is established.
6. The tgt-based cluster handle management system according to claim 5, wherein the cluster structure determination module is specifically configured to determine whether a first creation flag of the cluster handle structure of the storage cluster exists; the cluster handle structure comprises a cluster reference count, the handle information and the first creation flag;
the storage pool structure determining module is specifically configured to determine whether a second creation flag of the storage pool structure of the storage pool corresponding to the LUN creation information exists; the storage pool fabric comprises a storage pool reference count, storage pool context information, and the second creation flag;
the volume structure determination module is specifically configured to determine whether a third creation flag of the volume structure of the volume corresponding to the LUN creation information exists; the volume structure includes a volume reference count, volume context information, and the third create flag.
7. The tgt-based cluster handle management system according to claim 5, wherein the storage pool structure is a map that stores storage pool names and storage pool context information, respectively, in advance as keys;
the volume structure is a map which stores storage pool names and volume names as keys in advance, and the volume context information is the keys.
8. The tgt-based cluster handle management system according to any of claims 5 to 7, further comprising:
a release information receiving module, configured to receive LUN release information corresponding to the LUN creation information;
the volume release judging module is used for subtracting one from the volume reference count and judging whether the volume reference count is 0 or not;
a first counting module, configured to subtract one from the storage pool reference count and the cluster reference count if the volume release determination module determines that the volume reference count is not 0;
a storage pool release judging module, configured to delete the volume structure if the volume reference count is determined to be 0 by the volume release judging module, and subtract one from the storage pool reference count to determine whether the storage pool reference count is 0;
a second counting module, configured to decrement the cluster reference count by one if the storage pool release determination module determines that the storage pool reference count is not 0;
a cluster release determination module, configured to delete the storage pool structure if the storage pool release determination module determines that the storage pool reference count is 0, and subtract one from the cluster reference count to determine whether the cluster reference count is 0;
and the cluster structure body deleting module is used for deleting the cluster handle structure body if the cluster releasing judging module judges that the cluster reference count is 0.
9. A tgt-based cluster handle management apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the tgt-based cluster handle management method of any of claims 1 to 4.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, implements the tgt-based cluster handle management method according to any one of claims 1 to 4.
CN201910931393.0A 2019-09-29 2019-09-29 Method, system and device for managing cluster handle based on tgt and readable storage medium Active CN110703996B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910931393.0A CN110703996B (en) 2019-09-29 2019-09-29 Method, system and device for managing cluster handle based on tgt and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910931393.0A CN110703996B (en) 2019-09-29 2019-09-29 Method, system and device for managing cluster handle based on tgt and readable storage medium

Publications (2)

Publication Number Publication Date
CN110703996A CN110703996A (en) 2020-01-17
CN110703996B true CN110703996B (en) 2022-07-22

Family

ID=69197247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910931393.0A Active CN110703996B (en) 2019-09-29 2019-09-29 Method, system and device for managing cluster handle based on tgt and readable storage medium

Country Status (1)

Country Link
CN (1) CN110703996B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367470B (en) * 2020-02-21 2021-09-17 苏州浪潮智能科技有限公司 Online migration method, system and device for distributed storage volume and readable storage medium
CN115599575B (en) * 2022-09-09 2024-04-16 中电信数智科技有限公司 Novel method for solving concurrent activation and deactivation of cluster logical volumes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133267A (en) * 2017-04-01 2017-09-05 北京京东尚科信息技术有限公司 Inquire about method, device, electronic equipment and the readable storage medium storing program for executing of elasticsearch clusters
CN107193504A (en) * 2017-06-02 2017-09-22 郑州云海信息技术有限公司 A kind of method and system of automation distribution and establishment application memory based on Kubernetes
CN109062748A (en) * 2018-08-10 2018-12-21 郑州云海信息技术有限公司 A kind of automatic test approach and device of mirror image volume specification function

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133267A (en) * 2017-04-01 2017-09-05 北京京东尚科信息技术有限公司 Inquire about method, device, electronic equipment and the readable storage medium storing program for executing of elasticsearch clusters
CN107193504A (en) * 2017-06-02 2017-09-22 郑州云海信息技术有限公司 A kind of method and system of automation distribution and establishment application memory based on Kubernetes
CN109062748A (en) * 2018-08-10 2018-12-21 郑州云海信息技术有限公司 A kind of automatic test approach and device of mirror image volume specification function

Also Published As

Publication number Publication date
CN110703996A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
KR101153087B1 (en) System and method for determining target failback and target priority for a distributed file system
US8452930B2 (en) Methods and apparatus for backup and restore of thin provisioning volume
CN103038788B (en) Providing multiple network resources
KR20120102664A (en) Allocating storage memory based on future use estimates
US20050257003A1 (en) Storage system managing method and computer system
CN110703996B (en) Method, system and device for managing cluster handle based on tgt and readable storage medium
CN109857723B (en) Dynamic data migration method based on expandable database cluster and related equipment
WO2018083558A1 (en) Storing and retrieving restricted datasets to and from a cloud network with non-restricted datasets
US11580148B2 (en) Document storage and management
JP7228321B2 (en) System for chronological out-of-place updating, method for chronological out-of-place updating, and computer program for chronological out-of-place updating
CN111371851B (en) Connection method, connection device, electronic equipment and storage medium
CN113806300A (en) Data storage method, system, device, equipment and storage medium
CN109032799A (en) Storage resource management method, apparatus, equipment and readable storage medium storing program for executing
CN107025223A (en) A kind of buffer management method and server towards multi-tenant
CN112527193B (en) Cloud hard disk data migration method, device, equipment and storage medium
CN109074357B (en) Dynamically managing different versions of a service
US20060041587A1 (en) Disk quota management with limits classes
CN114579061B (en) Data storage method, device, equipment and medium
CN110196683A (en) A kind of method, apparatus, terminal device and the medium of operation control
CN109063210A (en) Resource object querying method, device, equipment and the storage medium of storage system
US20180020075A1 (en) Apparatus and method for providing data based on cloud service
CN114153555A (en) Cloud platform PMEM device management method, system, device and storage medium
US9336232B1 (en) Native file access
JP6305177B2 (en) Information processing apparatus, document management system, information processing method, and program
CN117176613B (en) Data acquisition method and device

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