CN112003892B - Tgt iSCSI-target configuration global management method - Google Patents

Tgt iSCSI-target configuration global management method Download PDF

Info

Publication number
CN112003892B
CN112003892B CN202010695810.9A CN202010695810A CN112003892B CN 112003892 B CN112003892 B CN 112003892B CN 202010695810 A CN202010695810 A CN 202010695810A CN 112003892 B CN112003892 B CN 112003892B
Authority
CN
China
Prior art keywords
target
information
configuration file
memory
matched
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
CN202010695810.9A
Other languages
Chinese (zh)
Other versions
CN112003892A (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 CN202010695810.9A priority Critical patent/CN112003892B/en
Publication of CN112003892A publication Critical patent/CN112003892A/en
Application granted granted Critical
Publication of CN112003892B publication Critical patent/CN112003892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The invention discloses a tgt iSCSI-target configuration global management method, which comprises S100, creating a storage pool of shared target configuration information in a cluster, and creating a target configuration file in the storage pool; s200, when a cluster node configures a new target, checking the target configuration file and the memory of the cluster node, deleting the searched matched failure target, and writing new target configuration information into the target configuration file; s300, when the cluster node accesses the target, checking the target configuration file and the memory, and creating connection according to target information in the target configuration file; s400, when the cluster node deletes the target, the target configuration file and the memory are checked, and the searched matched target is deleted. The invention makes the iSCSI-target configuration information of tgt persistent to the distributed cluster, and does not need to consume extra bandwidth and operate to synchronize the configuration information between nodes; the related target operation checks the configuration file and the cluster memory, eliminates the interference of invalid target related information, and ensures that the cluster normally provides service for the client.

Description

Tgt iSCSI-target configuration global management method
Technical Field
The invention relates to the field, in particular to a tgt iSCSI-target configuration global management method.
Background
iSCSI is a SCSI implementation that maps off-site storage resources to local logical storage devices over a TCP/IP network. Unlike NFS, which provides users with access to remote storage in units of files, it provides users with an interface to access remote storage resources in blocks, i.e., users can see iSCSI mapped disks locally/dev/down. The iSCSI-target is a device for receiving iSCSI commands, and refers to a host where remote storage resources are located, such as a storage server; and initiator side refers to the node that is linked to the iSCSI-target side and will access the remote storage resource. And tgt is an iSCSI-target management tool realized in a user mode, can convert block equipment into a SCSI LUN, and provides an iSCSI transmission mode to access the SCSI LUN.
Any node of the distributed storage system can provide storage services through the tgt pair, and the tgt service needs to deploy configuration files on all storage nodes. The target configuration information of the current tgt is stored in each node in a text form, that is, the memories and hard disks of all nodes maintain a file containing all the target configuration information. target configuration information is stored on a hard disk of each node in distributed storage, the hard disk and a memory of each node maintain a complete set of target configuration information, in order to ensure the consistency of the target information, the operation (creation/deletion) of a certain target needs to be repeated on all nodes, no matter whether the nodes are the nodes connected with the iscsi client or not, when the number of the targets is increased, each node occupies a large amount of memory and hard disks; when the target is created/deleted, if some nodes in the cluster have network faults, the problem of inconsistent target information among the nodes can be caused, and extra operation and network bandwidth are needed for synchronizing the target information of each node. The design of the distributed storage system can ensure that when one or more nodes fail, the storage cluster can still provide external services, if the target configuration information of tgt is changed (the creation and deletion of the target occur) during the node failure, when the node is recovered, the node is inconsistent with the target configuration information of the node without failure, so that the node can no longer provide the target services.
Disclosure of Invention
The invention provides a tgt iSCSI-target configuration global management method, which aims to solve the problem that the existing target configuration information is stored on a hard disk of each node in distributed storage, the hard disk and a memory of each node maintain a complete set of target configuration information, and in order to ensure the consistency of the target information, the operation (creation/deletion) of a certain target needs to be repeated on all nodes, no matter whether the nodes are the nodes connected with an iSCSI client or not, when the number of the targets is increased, each node occupies a large number of memories and hard disks; when the target is created/deleted, if some nodes in the cluster have network faults, the problem of inconsistent target information among the nodes can be caused, and the problem of synchronizing the target information of each node by additional operation and network bandwidth is needed.
To achieve the above object, the present invention provides a method for managing the iSCSI-target configuration globalization of tgt, which comprises
S100, creating a storage pool of shared target configuration information in the cluster, and creating a target configuration file in the storage pool;
s200, when a cluster node configures a new target, checking the target configuration file and the memory of the cluster node, deleting the searched matched failure target, and writing new target configuration information into the target configuration file;
s300, when the cluster node accesses the target, checking the target configuration file and the memory, and creating connection according to target information in the target configuration file;
s400, when the cluster node deletes the target, the target configuration file and the memory are checked, the searched matched target is deleted, and the target is deleted.
Preferably, when a create target command is received by a node of the cluster,
s201, checking whether matched target information exists in the target configuration file or not according to target information to be configured in a target creating command;
s202, the target configuration file has matched target information, and interaction is returned;
s203, the matched target information does not exist in the target configuration file, and whether the matched target information exists in a memory is checked;
s204, the information of the target exists in the memory, the target information in the memory is deleted, and the information is written into the target configuration file according to a target creating command; and the information of the target does not exist in the memory, and the information is written into the target configuration file according to a target creating command.
Preferably, checking whether the matched target information exists in the target configuration file or in the memory according to the target information to be configured in the command for creating the target includes: extracting tid or name information of the target to be configured in the command for creating the target; retrieving matched target information in the target configuration file or the memory through tid or name; correspondingly, in S203, an interaction including the hint tid or name existing information is returned.
Preferably, when a node of the cluster receives an access target command,
s301, checking whether matched target information exists in the target configuration file or not according to target information to be accessed in the target accessing command;
s302, the target configuration file has matched target information, the matched target information is extracted from the target configuration file and loaded to a memory, so that connection is established and success is returned;
and S303, returning a prompt that the target is not configured to check whether the matched target information exists in the memory or not if the matched target information does not exist in the target configuration file, and deleting the matched target information in the memory if the matched target information exists in the memory.
Preferably, checking whether the information of the matched target exists in the target configuration file or in the memory according to the target information to be accessed in the target accessing command includes: extracting tid or name information of the target in the target access command; retrieving matched target information in the target configuration file or the memory through tid or name; and correspondingly, returning a prompt that the target is not configured through tid or name.
Preferably, when the node receives the delete target command,
s401, checking whether the target configuration file has matched target information or not according to target information to be deleted in a target deleting command;
s402, the target configuration file has matched target information, the target information in the target configuration file is deleted, whether the matched target information exists in the memory is checked, if yes, the matched target information in the memory is deleted, and a deletion success prompt is returned;
and S403, the target configuration file has no corresponding target information, whether the matched target information exists in the memory is checked, if yes, the matched target information in the memory is deleted, and a deletion success prompt is returned.
Preferably, checking whether the target configuration file or the memory has target information according to the target information to be deleted in the command for deleting the target includes: extracting tid or name information of the target in the command of deleting the target; retrieving the matched target information in the target configuration file or the memory through tid or name; and correspondingly, returning a prompt of successful deletion through tid or name.
Preferably, the target configuration file is iscsi _ target _ config, and target configuration information is stored in an omap manner, where the target configuration information includes tid, name, lun, acl, and iqn, where tid is a keyword, and name, lun, acl, and iqn are attribute values.
The tgt iSCSI-target configuration global management method provided by the application has the following beneficial effects:
the invention provides a tgt iSCSI-target configuration global management method, which runs on a Linux platform, creates a cluster storage pool and creates a target configuration file in the cluster storage pool to store the configuration information of the iSCSI-target, thereby persisting the tgt iSCSI-target configuration information to a distributed cluster, and nodes of the cluster are connected with the storage pool to call the configuration information in the target configuration file, thereby ensuring the consistency of the configuration information of each node in the cluster without consuming extra bandwidth and operating to synchronize the configuration information between the nodes; the related target operation checks the configuration file and the cluster memory, eliminates the interference of invalid target related information, and ensures that the cluster normally provides service for the client.
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 some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a management method for the iSCSI-target configuration globalization of tgts in an embodiment of the present invention;
FIG. 2 is a diagram illustrating steps in an embodiment of the present invention for creating an iSCSI-target;
FIG. 3 is a diagram illustrating steps for accessing an iSCSI-target in an embodiment of the present invention;
FIG. 4 illustrates steps for deleting an iSCSI-target in an embodiment of the invention;
FIG. 5 is a block diagram of a global configuration to which the iSCSI-target configuration global management method for tgt according to an embodiment of the present invention is applied.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1-5, the present invention provides a method for managing the iSCSI-target configuration globalization of tgt, comprising:
s100, creating a storage pool of shared target configuration information in the cluster, and creating a target configuration file in the storage pool; in the specific implementation process, a storage pool creation command is sent to a cluster through a cluster management tool, the command contains data storage and data distribution rules of the storage pool, the storage pool is named, the cluster creates the storage pool after receiving the command, a target configuration file named iscsi _ target _ config is created in the storage pool by the target management tool, the target configuration file stores target configuration information in an omap mode, the target configuration information comprises tid, name, lun, acl and iqn, wherein tid is a keyword, and name, lun, acl and iqn are attribute values.
S200, when a cluster node configures a new target, tgt checks the target configuration file and the memory of the cluster node, deletes the searched matched failure target, and writes new target configuration information into the target configuration file;
in a specific implementation process, referring to fig. 2, when a node of a cluster receives a create target command sent by a target management tool (tgtadm), the following steps are performed:
s201, extracting tid or name information of the target to be configured in the command for creating the target through tgt; retrieving the matched target information in the target configuration file through tid or name;
s202, if the matched target information exists in the target configuration file, returning to prompt the existing interaction of the tid or the name; in the specific implementation process, a calling interface of the matched target parameter can be returned, the calling interface acquires the specific parameter of the matched target node by calling a function, and the user judges whether to create the relationship between the target and the existing target according to the specific parameter.
S203, the target configuration file does not have the matched target information, and the tid or name information of the target to be configured in the target command is extracted and created through tgt; retrieving matched target information in the memory through tid or name;
s204, if the information of the target exists in the memory, the configuration is performed once and the memory is deleted, but the node does not update the memory, so that the target information in the memory is deleted to avoid confusion, and the information is written into the target configuration file according to a target creating command; and if the information of the target does not exist in the memory, directly writing the information into the target configuration file according to a command for creating the target.
S300, when the cluster node accesses the target, checking the target configuration file and the memory, and creating connection according to the target configuration file or target information in the memory;
in a specific implementation process, referring to fig. 3, when a node of a cluster receives an access target command sent by a client, the following steps are performed:
s301, tgt extracting the tid or name information of the target to be accessed in the target accessing command; retrieving the matched target information in the target configuration file through tid or name;
s302, if the target configuration file has the matched target information, tgt extracts the matched target information from the target configuration file and loads the matched target information into a memory, so that the connection between the node and the client is established, and success is returned;
s303, if the target configuration file does not have the matched target information, tgt extracts the tid or name information of the target to be accessed in the target accessing command; retrieving matched target information in the memory through tid or name; and if the matched target information exists in the memory, deleting the matched target information in the memory, avoiding the influence of invalid target information on the service provision of the node, and returning a prompt that the target is not configured through tid or name.
S400, when deleting the target, the cluster node checks the target configuration file and the memory and deletes the searched matched target.
In a specific implementation process, referring to fig. 4, when a node of a cluster receives a target deletion command sent by a target management tool, the following steps are performed:
s401, tgt extracting the tid or name information of the target to be deleted in the command of deleting the target; retrieving the matched target information in the target configuration file through tid or name;
s402, if the target configuration file has the matched target information, tgt deletes the target information in the target configuration file, and tgt extracts the tid or name information of the target to be deleted in the target deleting command; retrieving the matched target information in the target configuration file through tid or name; if the target exists, the information of the matched target in the memory is deleted, and a prompt of successful deletion is returned through the tid or the name.
And S403, the target configuration file has no corresponding information of the target, whether the matched target information exists in the memory is checked, if yes, the matched target information in the memory is deleted, and a prompt of successful deletion is returned through tid or name.
The invention provides a management method for the iSCSI-target configuration of a target management tool, which runs on a Linux platform, establishes a cluster storage pool and establishes a target configuration file in the cluster storage pool to store the configuration information of the iSCSI-target, thereby persisting the iSCSI-target configuration information of the target management tool to a distributed cluster, and the nodes of the cluster are connected with the storage pool to call the configuration information in the target configuration file, thereby ensuring the consistency of the configuration information of each node in the cluster without consuming extra bandwidth and operating to synchronize the configuration information between the nodes; the related target operation checks the configuration file and the cluster memory, eliminates the interference of invalid target related information, and ensures that the cluster normally provides service for the client.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
In addition, iSCSI is a short for Internet Small Computer System Interface, meaning Internet-based Small Computer System Interface; iSCSI-target refers to a target (server) in the iSCSI system; LUN is short for Logical Unit Number, meaning Number of Logical Unit, block device with Number; tgt means Linux SCSI target frame is iSCSI-target management tool implemented in Linux user mode.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A tgt iSCSI-target configuration global management method is characterized by comprising
S100, creating a storage pool of shared target configuration information in the cluster, and creating a target configuration file in the storage pool;
s200, when a cluster node configures a new target, S201, according to target information to be configured in a target creating command, checking whether matched target information exists in a target configuration file; s202, the target configuration file has matched target information, and interaction is returned; s203, the matched target information does not exist in the target configuration file, and whether the matched target information exists in a memory is checked; s204, the information of the target exists in the memory, the target information in the memory is deleted, and the information is written into the target configuration file according to a target creating command; the information of the target does not exist in the memory, and the information is written into the target configuration file according to a target creating command;
s300, when the cluster node accesses the target, checking the target configuration file and the memory, creating connection according to target information in the target configuration file, and deleting the matched target information in the memory when the target information is not configured in the target configuration file;
s400, when deleting the target, the cluster node checks the target configuration file and the memory, deletes the searched matched target, and deletes the target.
2. The method for managing tgt iSCSI-target configuration globalization as recited in claim 1, wherein the step of checking whether there is matching target information in the target configuration file or in the memory according to the target information to be configured in the command for creating target comprises: extracting tid or name information of the target to be configured in the command for creating the target; retrieving the matched target information in the target configuration file or the memory through tid or name; correspondingly, in S203, an interaction including the prompt tid or name existing information is returned.
3. The method for managing tgt iSCSI-target configuration globalization as recited in claim 1, wherein when a cluster node accesses a target, checking the target configuration file and a memory, creating a connection according to target information in the target configuration file, and deleting matching target information in the memory when target information is not configured in the target configuration file comprises:
s301, checking whether matched target information exists in the target configuration file or not according to target information to be accessed in the target accessing command;
s302, the target configuration file has matched target information, the matched target information is extracted from the target configuration file, and the matched target information is loaded to a memory, so that connection is established, and success is returned;
and S303, if the target configuration file does not have the matched target information, returning a prompt that the target is not configured, checking whether the matched target information exists in the memory, and if so, deleting the matched target information in the memory.
4. The method for managing tgt iSCSI-target configuration globalization as recited in claim 1, wherein the step of checking whether there is matching target information in the target configuration file or in the memory according to the target information to be accessed in the target command comprises: extracting tid or name information of the target in the target access command; retrieving the matched target information in the target configuration file or the memory through tid or name; and correspondingly, returning a prompt that the target is not configured through tid or name.
5. The method for managing the iSCSI-target configuration globalization of tgt according to claim 1, wherein when a cluster node deletes a target, it checks said target configuration file and memory, deletes the retrieved matching target, and the deleting comprises: s401, checking whether the target configuration file has matched target information or not according to target information to be deleted in a target deleting command; s402, the target configuration file has matched target information, the target information in the target configuration file is deleted, whether the matched target information exists in the memory is checked, if yes, the matched target information in the memory is deleted, and a deletion success prompt is returned; and S403, the target configuration file has no corresponding target information, whether the matched target information exists in the memory is checked, if yes, the matched target information in the memory is deleted, and a deletion success prompt is returned.
6. The method for managing tgt iSCSI-target configuration globalization as recited in claim 1, wherein the step of checking whether the target information exists in the target configuration file or in the memory according to the target information to be deleted in the command to delete target comprises: extracting tid or name information of the target in the command of deleting the target; retrieving the matched target information in the target configuration file or the memory through tid or name; and correspondingly, returning a prompt of successful deletion through tid or name.
7. The method for managing the iSCSI-target configuration globalization of tgt of claim 1, wherein the target configuration file is iSCSI _ target _ config, and target configuration information is stored in an omap manner and includes tid, name, lun, acl, and iqn, where tid is a keyword, and name, lun, acl, and iqn are attribute values.
CN202010695810.9A 2020-07-19 2020-07-19 Tgt iSCSI-target configuration global management method Active CN112003892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010695810.9A CN112003892B (en) 2020-07-19 2020-07-19 Tgt iSCSI-target configuration global management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010695810.9A CN112003892B (en) 2020-07-19 2020-07-19 Tgt iSCSI-target configuration global management method

Publications (2)

Publication Number Publication Date
CN112003892A CN112003892A (en) 2020-11-27
CN112003892B true CN112003892B (en) 2022-12-13

Family

ID=73468051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010695810.9A Active CN112003892B (en) 2020-07-19 2020-07-19 Tgt iSCSI-target configuration global management method

Country Status (1)

Country Link
CN (1) CN112003892B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110247937A (en) * 2018-03-07 2019-09-17 中移(苏州)软件技术有限公司 The management of elastic storage systems share files, access method and relevant device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110247937A (en) * 2018-03-07 2019-09-17 中移(苏州)软件技术有限公司 The management of elastic storage systems share files, access method and relevant device

Also Published As

Publication number Publication date
CN112003892A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
JP4508554B2 (en) Method and apparatus for managing replicated volumes
US7574443B2 (en) Scalable clustered storage system
US8190573B2 (en) File storage service system, file management device, file management method, ID denotative NAS server and file reading method
US8190570B2 (en) Preserving virtual filesystem information across high availability takeover
US8176008B2 (en) Apparatus and method for replicating data in file system
CN107741852B (en) Service deployment method based on cluster software
US20080177948A1 (en) Method and apparatus for managing placement of data in a tiered storage system
CN112698921B (en) Logic code operation method, device, computer equipment and storage medium
CN102938784A (en) Method and system used for data storage and used in distributed storage system
CN111290826A (en) Distributed file system, computer system, and medium
CN113806300B (en) Data storage method, system, device, equipment and storage medium
CN112910880B (en) Virtual room creating method, system, device, equipment and medium
US11580148B2 (en) Document storage and management
CN106294842A (en) A kind of data interactive method, platform and distributed file system
CN111399760A (en) NAS cluster metadata processing method and device, NAS gateway and medium
US20050091266A1 (en) Data file system, data access server and data access program storage medium
CN112003892B (en) Tgt iSCSI-target configuration global management method
CN109558082B (en) Distributed file system
CN115510016A (en) Client response method, device and medium based on directory fragmentation
US20220067065A1 (en) Providing instant and distributed access to a source blob via copy-on-read blobs and link blobs
CN115238006A (en) Retrieval data synchronization method, device, equipment and computer storage medium
CN115344550A (en) Method, device and medium for cloning directories of distributed file system
CN109343928B (en) Virtual memory file redirection method and system for virtual machine in virtualization cluster
JP2004252934A (en) Method and system for managing replication volume
CN111782834A (en) Image retrieval method, device, equipment and computer readable storage 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
GR01 Patent grant
GR01 Patent grant