CN114827123A - Method, device, equipment and medium for setting iSCSI service - Google Patents

Method, device, equipment and medium for setting iSCSI service Download PDF

Info

Publication number
CN114827123A
CN114827123A CN202210182701.6A CN202210182701A CN114827123A CN 114827123 A CN114827123 A CN 114827123A CN 202210182701 A CN202210182701 A CN 202210182701A CN 114827123 A CN114827123 A CN 114827123A
Authority
CN
China
Prior art keywords
nodes
target
node
storage
storage cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210182701.6A
Other languages
Chinese (zh)
Other versions
CN114827123B (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 CN202210182701.6A priority Critical patent/CN114827123B/en
Publication of CN114827123A publication Critical patent/CN114827123A/en
Application granted granted Critical
Publication of CN114827123B publication Critical patent/CN114827123B/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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method for setting iSCSI service, which comprises the following steps: binding the target volume with an initiator, and writing the target volume into a storage cluster; acquiring attribute information of all active nodes in a storage cluster, and sequencing lun numbers corresponding to the active nodes according to the attribute information to obtain a target list; based on the principle of uniform distribution of the number of luns, distributing storage nodes to be set by a user on active nodes of all rack cabinets according to a target list to obtain screening nodes; when an initiator logs in a screening node, mapping a target volume to a lun of a target corresponding to the screening node; and selecting a target node in the storage cluster, and configuring the virtual IP iqn which is the same as the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node. By the method, high availability of the iSCSI service in the storage cluster can be ensured.

Description

Method, device, equipment and medium for setting iSCSI service
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, equipment and a medium for setting iSCSI service.
Background
iSCSI (Internet Small Computer System Interface) is a new storage technology that combines the existing SCSI Interface with ethernet technology to allow a server to exchange data with a storage device using an IP (Internet Protocol) network. iSCSI services are based on a client/server model, whose primary function is to perform extensive data encapsulation and reliable transport between a host system initiator and a storage device target on a TCP/IP network. However, in the prior art, there is no way to guarantee a high availability of iSCSI services in a storage cluster, and a solution to this problem is urgently needed by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method, an apparatus, a device and a medium for setting an iSCSI service, so as to ensure high availability of the iSCSI service in a storage cluster. The specific scheme is as follows:
a method for setting iSCSI services, comprising:
binding a target volume with iqn of an initiator to obtain a target binding relationship, and writing the target binding relationship into a storage cluster; the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
acquiring attribute information of all active nodes in the storage cluster to obtain target information, and sequencing luns corresponding to the active nodes in the storage cluster according to the target information to obtain a target list;
based on the principle of uniform distribution of the number of luns, distributing storage nodes to be set by a user on active nodes of all rack cabinets of the storage cluster according to the target list to obtain screening nodes;
when the initiator logs in the screening node, mapping the target volume to the lun of the target corresponding to the screening node;
selecting a target node from the storage cluster, and configuring a virtual IP (Internet protocol) iqn which is the same as the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node.
Preferably, the process of obtaining attribute information of all active nodes in the storage cluster to obtain target information includes:
and acquiring attribute information of all active nodes in the storage cluster by using an MON service to obtain the target information.
Preferably, the process of acquiring attribute information of all active nodes in the storage cluster by using the MON service includes:
and acquiring the IP of the rack cabinet where all active nodes in the storage cluster are located and lun information corresponding to all active nodes by utilizing the MON service.
Preferably, the process of sorting the lun numbers of all active nodes in the storage cluster according to the destination information to obtain a destination list includes:
and performing ascending arrangement on the lun numbers of all active nodes in the storage cluster according to the target information to obtain the target list.
Preferably, the step of distributing the storage nodes to be set by the user on the active nodes of all rack cabinets of the storage cluster according to the target list based on the principle of evenly distributing the lun number to obtain the screening nodes includes:
judging whether the number of the storage nodes to be set by the user is in a direct proportional relation with the number of all rack cabinets in the storage cluster;
and if so, uniformly distributing the storage nodes to be set by the user on active nodes of all rack cabinets of the storage cluster according to the target list to obtain the screening nodes.
Preferably, after the process of determining whether the number of the storage nodes to be set by the user is in a direct proportional relationship with the number of all rack cabinets in the storage cluster, the method further includes:
if not, judging whether the number of the storage nodes to be set by the user is smaller than the number of all rack cabinets in the storage cluster;
if yes, selecting at most one active node on each rack cabinet, and screening the active nodes with the number equal to that of the storage nodes to be set by the user in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain the screening nodes.
Preferably, after the process of determining whether the number of the storage nodes to be set by the user is less than the number of all rack cabinets in the storage cluster, the method further includes:
if not, dividing the storage nodes to be set by the user into a first node set and a second node set; the number of the storage nodes in the first node set is in a direct proportion relation with the number of all rack cabinets in the storage cluster; the second node set is a set formed by the storage nodes to be set by the user except the other storage nodes except the first node set;
uniformly distributing storage nodes in the first node set on active nodes of all rack cabinets of the storage cluster according to the target list to obtain first screening child nodes;
selecting at most one active node on each rack cabinet, and screening the active nodes with the same number as the storage nodes in the second node set in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain second screening sub-nodes;
and obtaining the screening node according to the first screening child node and the second screening child node.
Correspondingly, the invention also discloses a device for setting the iSCSI service, which comprises:
the relationship writing module is used for binding the target volume with iqn of the initiator to obtain a target binding relationship, and writing the target binding relationship into the storage cluster; the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
the quantity ordering module is used for acquiring attribute information of all active nodes in the storage cluster to obtain target information, and ordering the lun quantity corresponding to the active nodes in the storage cluster according to the target information to obtain a target list;
the node screening module is used for distributing storage nodes to be set by a user on active nodes of all rack cabinets of the storage cluster according to the target list based on the principle of uniform distribution of lun quantity to obtain screening nodes;
the volume mapping module is used for mapping the target volume to the lun of the target corresponding to the screening node when the initiator logs in the screening node;
and the fault migration module is used for selecting a target node from the storage cluster and configuring the virtual IP and iqn which are the same as those of the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node.
Correspondingly, the invention also discloses a device for setting the iSCSI service, which comprises:
a memory for storing a computer program;
a processor for implementing the steps of a method for setting up iSCSI services as disclosed in the foregoing when executing said computer program.
Accordingly, the present invention also discloses a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the steps of a method for setting up iSCSI services as disclosed in the foregoing.
Compared with the prior art, the method provided by the invention can realize automatic mounting of the volume, can ensure that the volume is relatively uniformly distributed on different rack cabinets and storage nodes, and can drift to other storage nodes to continuously access the target volume through the virtual IP when the node logged by the initiator fails, so that the high availability of the iSCSI service in the storage cluster can be ensured. Correspondingly, the setting device, the equipment and the medium of the iSCSI service also have the beneficial effects.
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 flowchart illustrating a method for setting up iSCSI services according to an embodiment of the present invention;
fig. 2 is a schematic diagram when the same virtual IP and iqn are set for the screening node and the target node;
fig. 3 is a flowchart illustrating a process of allocating storage nodes to be set by a user to active nodes of a storage cluster according to an embodiment of the present invention;
FIG. 4 is a block diagram of a configuration device for iSCSI services provided by an embodiment of the present invention;
fig. 5 is a block diagram of a configuration device for an iSCSI service 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.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for setting an iSCSI service according to an embodiment of the present invention, where the method includes:
step S11: binding the target volume with iqn of initiator to obtain a target binding relationship, and writing the target binding relationship into a storage cluster;
the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
step S12: acquiring attribute information of all active nodes in a storage cluster to obtain target information, and sequencing luns corresponding to the active nodes in the storage cluster according to the target information to obtain a target list;
step S13: based on the principle of uniform distribution of the number of luns, distributing storage nodes to be set by a user on active nodes of all rack cabinets of a storage cluster according to a target list to obtain screening nodes;
step S14: when the initiator logs in the screening node, mapping the target volume to the lun of the target corresponding to the screening node;
step S15: and selecting a target node in the storage cluster, and configuring the virtual IP iqn which is the same as that of the screening node for the target node, so that the initiator accesses the target volume by using the target node when the screening node fails.
In this embodiment, a method for setting an iSCSI service is provided, by which high availability of the iSCSI service in a storage cluster can be ensured. In the setting method, firstly, a target volume is bound with iqn of an initiator to obtain a target binding relationship between the target volume and the initiator; wherein iqn refers to the name of each iSCSI network. And then writing the target binding relationship between the target volume and the initiator into the storage cluster. The storage cluster is composed of a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes. In addition, in practical applications, tgt of initiator will create 8 targets by default.
When the target binding relationship is written into the storage cluster, the attribute information of all active nodes in the storage cluster is obtained to obtain target information, and the Number of luns (Logical Unit numbers) corresponding to all active nodes in the storage cluster is sequenced according to the target information to obtain a target list. The target list not only stores the lun number corresponding to all active nodes in the storage cluster, but also stores the rack cabinet corresponding to each active node.
And then, based on the principle of uniform distribution of the lun number, distributing the storage nodes to be set by the user on the active nodes of all rack cabinets of the storage cluster according to the target list, thereby obtaining the screening nodes. The storage nodes to be set by the user can be relatively uniformly distributed on the storage nodes of the rack cabinet of the storage cluster through the setting mode, and the storage nodes to be set by the user are not centralized on the storage node of one rack cabinet of the storage cluster, so that the service performance of the storage cluster can be relatively improved when the user accesses the storage cluster in a large scale.
When the initiator logs in the screening node, the initiator can directly map the target volume to the lun of the target corresponding to the screening node, so that the automatic logging of the volume is realized. In addition, in this embodiment, in order to avoid a situation that the initiator cannot access the target volume when the screening node fails, the target node is also arbitrarily selected from the storage cluster, and the virtual IP and iqn that are the same as those of the screening node are configured for the target node. Referring to fig. 2, fig. 2 is a schematic diagram illustrating the screening node and the target node being provided with the same virtual IP and iqn. Obviously, in this setting, even if the screening node fails, the initiator may access the target volume using the target node, thereby further ensuring high availability of the iSCSI service in the storage cluster.
Compared with the prior art, the method provided by the embodiment can realize automatic mounting of the volume, and can enable the volume to be distributed to different rack cabinets and storage nodes relatively uniformly, and when the node logged in by the initiator fails, the node can drift to other storage nodes through the virtual IP to continuously access the target volume, so that the high availability of the iSCSI service in the storage cluster can be ensured.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: the process of obtaining attribute information of all active nodes in a storage cluster and obtaining target information comprises the following steps:
and acquiring attribute information of all active nodes in the storage cluster by using the MON service to obtain target information.
It will be appreciated that because the MON service is a stand-alone, general-purpose resource monitor, it can be used to monitor the availability of network services, such as: the MON service can be used for monitoring the running environment condition of the system, the task execution progress and the like, so when the attribute information of all active nodes in the storage cluster is acquired by the MON service, the convenience in acquiring the attribute information of all active nodes in the storage cluster can be improved, and the efficiency in acquiring the attribute information of all active nodes in the storage cluster can also be improved.
Specifically, when the attribute information of all active nodes in the storage cluster is obtained by using the MON service, the IP of the rack cabinet where all active nodes in the storage cluster are located and lun information corresponding to all active nodes are obtained by using the MON service.
Based on the above embodiment, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: the process of sequencing the lun numbers of all active nodes in the storage cluster according to the target information to obtain a target list comprises the following steps:
and performing ascending arrangement on the lun numbers of all active nodes in the storage cluster according to the target information to obtain a target list.
In this embodiment, when the lun numbers of all active nodes in the storage cluster are sorted according to the target information, the lun numbers are sorted in an ascending order according to the lun numbers corresponding to the active nodes. That is, the node with the smaller lun number corresponding to the active node is arranged in front of the node with the larger lun number corresponding to the active node.
By the arrangement mode, when the storage nodes to be set by the user are uniformly distributed on the active nodes of all rack cabinets of the storage cluster according to the target list, the time for searching the storage nodes with a small lun number from the storage cluster can be relatively reduced, and therefore, the efficiency of distributing the storage nodes to be set by the user on all rack cabinets of the storage cluster can be relatively improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a process of allocating storage nodes to be set by a user to active nodes of a storage cluster according to an embodiment of the present invention. As a preferred embodiment, the above steps: based on the principle of lun quantity uniform distribution, the storage nodes to be set by the user to be required are distributed on the active nodes of all rack cabinets of the storage cluster according to the target list, and the process of screening the nodes is obtained, and comprises the following steps:
step S01: judging whether the number of storage nodes to be set by a user is in a direct proportional relation with the number of all rack cabinets in the storage cluster;
step S02: and if so, uniformly distributing the storage nodes to be set by the user on the active nodes of all rack cabinets of the storage cluster according to the target list to obtain the screening nodes.
In this embodiment, a process of uniformly distributing storage nodes to be set by a user on all rack cabinets of a storage cluster is described in detail. Specifically, in the process of setting the storage nodes to be set by the user, firstly, whether the number of the storage nodes to be set by the user is in a direct proportional relationship with the number of all rack cabinets in the storage cluster is judged, and if the number of the storage nodes to be set by the user is in a direct proportional relationship with the number of all rack cabinets in the storage cluster, the storage nodes to be set by the user are uniformly distributed on active nodes of all rack cabinets in the storage cluster according to the target list.
Such as: if 12 storage nodes to be set by a user exist and the number of all rack cabinets in the storage cluster is 4, in this case, only 3 storage nodes need to be allocated to each rack cabinet. And when the 3 storage nodes are allocated on each rack cabinet, the 3 storage nodes are allocated according to the sequence of the lun number corresponding to the active node from low to high. Assuming that the number of luns corresponding to the active node A, B, C, D on a certain rack enclosure is 16, 8, 2, and 1, respectively, 3 storage nodes to be set by the user need to be allocated on the active node D, C, B of the rack enclosure, and the remaining storage nodes to be set by the user can be allocated on the active nodes of other rack enclosures according to the same method.
As a preferred embodiment, the step S01: after the process of judging whether the number of the storage nodes to be set by the user is in a direct proportional relationship with the number of all rack cabinets in the storage cluster, the method further comprises the following steps:
step S03: if not, judging whether the number of the storage nodes to be set by the user is smaller than the number of all rack cabinets in the storage cluster or not;
step S04: if so, selecting at most one active node on each rack cabinet, and screening the active nodes with the number equal to that of the storage nodes to be set by the user in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain the screened nodes.
If the number of the storage nodes to be set by the user is not in a direct proportional relation with the number of all rack cabinets in the storage cluster, whether the number of the storage nodes to be set by the user is smaller than the number of all rack cabinets in the storage cluster needs to be judged. If the number of the storage nodes to be set by the user is smaller than the number of all rack cabinets in the storage cluster, at this time, only one active node can be selected at most on each rack cabinet, and active nodes with the number equal to that of the storage nodes to be set by the user are screened in the storage cluster according to the sorting sequence of the active nodes in the target list for distribution.
Suppose the number of storage nodes to be set by a user is 3, and the number of all rack cabinets in the storage cluster is 4, wherein the number of luns corresponding to active nodes on the rack cabinet a is 16, the number of luns corresponding to active nodes on the rack cabinet B is 8, the number of luns corresponding to active nodes on the rack cabinet C is 2, and the number of luns corresponding to active nodes on the rack cabinet D is 1. At this time, according to the arrangement sequence of the active nodes in the target list, the storage nodes to be set by the user are allocated on the rack cabinet D, rack cabinet C and the rack cabinet B in the storage cluster.
As a preferred embodiment, the step S03: : after the process of judging whether the number of the storage nodes to be set by the user is less than the number of all rack cabinets in the storage cluster, the method further comprises the following steps:
step S05: if not, dividing the storage nodes to be set by the user into a first node set and a second node set;
the number of the storage nodes in the first node set is in a direct proportion relation with the number of all rack cabinets in the storage cluster; the second node set is a set formed by the storage nodes to be set by the user except the other storage nodes except the first node set;
step S06: uniformly distributing storage nodes in the first node set on active nodes of all rack cabinets of the storage cluster according to the target list to obtain first screening child nodes;
step S07: at most one active node is selected from each rack cabinet, and active nodes with the same number as the storage nodes in the second node set are screened in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain second screening child nodes;
step S08: and obtaining the screening node according to the first screening child node and the second screening child node.
If the number of the storage nodes to be set by the user is larger than the number of all rack cabinets in the storage cluster, the storage nodes to be set by the user need to be divided into a first node set and a second node set; the number of the storage nodes in the first node set is in a direct proportion relation with the number of all rack cabinets in the storage cluster, and the second node set is a set formed by the storage nodes to be set by a user except the first node set.
Then, uniformly distributing the storage nodes in the first node set on active nodes of all rack cabinets of the storage cluster according to the target list to obtain first screening child nodes; and then, selecting at most one active node on each rack cabinet, and screening the active nodes with the number equal to that of the storage nodes in the second node set in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain a second screening child node.
Assuming that 11 storage nodes to be set by a user exist and the number of all rack cabinets in the storage cluster is 4, the 11 storage nodes to be set by the user need to be divided into a first node set and a second node set in advance, wherein the first node set contains 8 storage nodes to be set by the user, and the second node set contains 3 storage nodes to be set by the user. Then, according to the target list, 8 storage nodes in the first node set are uniformly distributed on active nodes of 4 rack cabinets in the storage cluster, so as to obtain a first screening child node, which may be specifically referred to in step S02; then, according to the arrangement order of the active nodes in the target list, allocating 3 storage nodes in the second node set on 3 rack cabinets in the storage cluster, which may specifically refer to step S04, and is not described in detail here.
Obviously, by the technical scheme provided by the embodiment, the storage nodes to be set by the user can be relatively and uniformly distributed on all rack cabinets of the storage cluster, so that the high availability of the iSCSI service in the storage cluster is ensured.
Referring to fig. 4, fig. 4 is a block diagram of a setting device for iSCSI services according to an embodiment of the present invention, where the setting device includes:
the relationship writing module 21 is configured to bind the target volume with iqn of the initiator to obtain a target binding relationship, and write the target binding relationship into the storage cluster; the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
the quantity sorting module 22 is configured to obtain attribute information of all active nodes in the storage cluster, obtain target information, and sort luns corresponding to the active nodes in the storage cluster according to the target information, so as to obtain a target list;
the node screening module 23 is configured to, based on a principle that the lun number is uniformly distributed, distribute, according to the target list, storage nodes to be set by the user on active nodes of all rack cabinets of the storage cluster to obtain screening nodes;
the volume mapping module 24 is configured to map the target volume to the lun of the target corresponding to the screening node when the initiator logs in the screening node;
the failure migration module 25 is configured to select a target node in the storage cluster, and configure a virtual IP and iqn that are the same as those of the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node.
The setting device of the iSCSI service provided by the embodiment of the invention has the beneficial effects of the setting method of the iSCSI service disclosed by the embodiment.
Referring to fig. 5, fig. 5 is a block diagram of a setting device for iSCSI services according to an embodiment of the present invention, where the setting device includes:
a memory 31 for storing a computer program;
a processor 32 for implementing the steps of a method for setting up iSCSI services as disclosed in the foregoing when executing a computer program.
The setting equipment of the iSCSI service provided by the embodiment of the invention has the beneficial effects of the setting method of the iSCSI service disclosed by the embodiment.
Accordingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the setting method for iSCSI services as disclosed in the foregoing.
The computer-readable storage medium provided by the embodiment of the invention has the beneficial effects of the method for setting the iSCSI service disclosed by the embodiment.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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.
The method, the device, the equipment and the medium for setting the iSCSI service provided by the present invention are described in detail above, and a specific example is applied in the present document to illustrate the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for setting iSCSI services, comprising:
binding a target volume with iqn of an initiator to obtain a target binding relationship, and writing the target binding relationship into a storage cluster; the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
acquiring attribute information of all active nodes in the storage cluster to obtain target information, and sequencing luns corresponding to the active nodes in the storage cluster according to the target information to obtain a target list;
based on the principle of uniform distribution of the number of luns, distributing storage nodes to be set by a user on active nodes of all rack cabinets of the storage cluster according to the target list to obtain screening nodes;
when the initiator logs in the screening node, mapping the target volume to the lun of the target corresponding to the screening node;
selecting a target node from the storage cluster, and configuring a virtual IP (Internet protocol) iqn which is the same as the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node.
2. The setting method according to claim 1, wherein the process of obtaining attribute information of all active nodes in the storage cluster to obtain target information includes:
and acquiring attribute information of all active nodes in the storage cluster by using an MON service to obtain the target information.
3. The provisioning method of claim 2, wherein said obtaining attribute information for all active nodes in said storage cluster using an MON service comprises:
and acquiring the IP of the rack cabinet where all active nodes in the storage cluster are located and lun information corresponding to all active nodes by utilizing the MON service.
4. The setting method according to any one of claims 1 to 3, wherein the process of sorting the lun numbers of all active nodes in the storage cluster according to the target information to obtain a target list includes:
and performing ascending arrangement on the lun numbers of all active nodes in the storage cluster according to the target information to obtain the target list.
5. The setting method according to claim 4, wherein the step of distributing the storage nodes to be set by the user on active nodes of all rack cabinets of the storage cluster according to the target list based on a principle of evenly distributing the lun number to obtain the screening nodes comprises:
judging whether the number of the storage nodes to be set by the user is in a direct proportional relation with the number of all rack cabinets in the storage cluster;
and if so, uniformly distributing the storage nodes to be set by the user on active nodes of all rack cabinets of the storage cluster according to the target list to obtain the screening nodes.
6. The setting method according to claim 5, wherein after the step of determining whether the number of the storage nodes to be set by the user is in a direct proportional relationship with the number of all rack enclosures in the storage cluster, the method further comprises:
if not, judging whether the number of the storage nodes to be set by the user is smaller than the number of all rack cabinets in the storage cluster;
if yes, selecting at most one active node on each rack cabinet, and screening the active nodes with the number equal to that of the storage nodes to be set by the user in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain the screening nodes.
7. The setting method according to claim 6, wherein after the process of determining whether the number of the storage nodes to be set by the user is smaller than the number of all rack enclosures in the storage cluster, the method further comprises:
if not, dividing the storage nodes to be set by the user into a first node set and a second node set; the number of the storage nodes in the first node set is in a direct proportion relation with the number of all rack cabinets in the storage cluster; the second node set is a set formed by the storage nodes to be set by the user except the other storage nodes except the first node set;
uniformly distributing storage nodes in the first node set on active nodes of all rack cabinets of the storage cluster according to the target list to obtain first screening child nodes;
selecting at most one active node on each rack cabinet, and screening the active nodes with the same number as the storage nodes in the second node set in the storage cluster according to the arrangement sequence of the active nodes in the target list to obtain second screening sub-nodes;
and obtaining the screening node according to the first screening child node and the second screening child node.
8. An iSCSI service provisioning apparatus, comprising:
the relationship writing module is used for binding the target volume with iqn of the initiator to obtain a target binding relationship, and writing the target binding relationship into the storage cluster; the storage cluster comprises a plurality of rack cabinets, and each rack cabinet is provided with a plurality of storage nodes;
the quantity ordering module is used for acquiring attribute information of all active nodes in the storage cluster to obtain target information, and ordering the lun quantity corresponding to the active nodes in the storage cluster according to the target information to obtain a target list;
the node screening module is used for distributing storage nodes to be set by a user on active nodes of all rack cabinets of the storage cluster according to the target list based on the principle of uniform distribution of lun quantity to obtain screening nodes;
the volume mapping module is used for mapping the target volume to the lun of the target corresponding to the screening node when the initiator logs in the screening node;
and the fault migration module is used for selecting a target node from the storage cluster and configuring the virtual IP and iqn which are the same as those of the screening node for the target node, so that when the screening node fails, the initiator accesses the target volume by using the target node.
9. A provisioning apparatus for iSCSI services, comprising:
a memory for storing a computer program;
a processor adapted to perform the steps of a method of setting up an iSCSI service as claimed in any one of claims 1 to 7 when said computer program is executed.
10. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of a method of setting up an iSCSI service as claimed in any one of claims 1 to 7.
CN202210182701.6A 2022-02-25 2022-02-25 Method, device, equipment and medium for setting iSCSI service Active CN114827123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210182701.6A CN114827123B (en) 2022-02-25 2022-02-25 Method, device, equipment and medium for setting iSCSI service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210182701.6A CN114827123B (en) 2022-02-25 2022-02-25 Method, device, equipment and medium for setting iSCSI service

Publications (2)

Publication Number Publication Date
CN114827123A true CN114827123A (en) 2022-07-29
CN114827123B CN114827123B (en) 2023-06-20

Family

ID=82529326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210182701.6A Active CN114827123B (en) 2022-02-25 2022-02-25 Method, device, equipment and medium for setting iSCSI service

Country Status (1)

Country Link
CN (1) CN114827123B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10171309B1 (en) * 2016-12-23 2019-01-01 EMC IP Holding Company LLC Topology service
CN110908723A (en) * 2019-11-29 2020-03-24 新华三大数据技术有限公司 Main/standby switching method and device of operating system and related equipment
CN113806086A (en) * 2021-09-10 2021-12-17 济南浪潮数据技术有限公司 Openstack storage method, device and medium using iSCSI multipath balance docking

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10171309B1 (en) * 2016-12-23 2019-01-01 EMC IP Holding Company LLC Topology service
CN110908723A (en) * 2019-11-29 2020-03-24 新华三大数据技术有限公司 Main/standby switching method and device of operating system and related equipment
CN113806086A (en) * 2021-09-10 2021-12-17 济南浪潮数据技术有限公司 Openstack storage method, device and medium using iSCSI multipath balance docking

Also Published As

Publication number Publication date
CN114827123B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
US8104038B1 (en) Matching descriptions of resources with workload requirements
US7171459B2 (en) Method and apparatus for handling policies in an enterprise
US9971823B2 (en) Dynamic replica failure detection and healing
US20200364608A1 (en) Communicating in a federated learning environment
US7016972B2 (en) Method and system for providing and viewing performance analysis of resource groups
US7444395B2 (en) Method and apparatus for event handling in an enterprise
US8185905B2 (en) Resource allocation in computing systems according to permissible flexibilities in the recommended resource requirements
CN113641311B (en) Method and system for dynamically allocating container storage resources based on local disk
US20020178262A1 (en) System and method for dynamic load balancing
CN101171567A (en) Autonomic storage provisioning to enhance storage virtualization infrastructure availability
JP2002091804A (en) Method and system for managing assignment of space on storage device and program storage medium
US20210405902A1 (en) Rule-based provisioning for heterogeneous distributed systems
CN104937584A (en) Providing optimized quality of service to prioritized virtual machines and applications based on quality of shared resources
JP2007538326A (en) Method, system, and program for maintaining a fileset namespace accessible to clients over a network
CN101699825A (en) Network file system access method, device and system
US10616134B1 (en) Prioritizing resource hosts for resource placement
EP3432132B1 (en) Data storage method and device
CN113687795A (en) Method and system for realizing isolation allocation of storage volumes of stateful application
CN112005219A (en) Workload management with data access awareness in a compute cluster
WO2023196042A1 (en) Data flow control in distributed computing systems
CN114020405A (en) Virtual machine scheduling method, device, equipment and medium
US10592469B1 (en) Converting files between thinly and thickly provisioned states
US11726684B1 (en) Cluster rebalance using user defined rules
WO2021248972A1 (en) Default gateway management method, gateway manager, server, and storage medium
CN109005071B (en) Decision deployment method and scheduling equipment

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