Disclosure of Invention
In view of the above, an object of the present invention is to provide a session creating method, apparatus, device and storage medium, which can improve data throughput and IPSAN performance. The specific scheme is as follows:
a first aspect of the present application provides a session creation method, including:
acquiring a session request initiated by a target ISCSI client and establishing a session with a target ISCSI server;
determining a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI client;
and judging whether the first quantity and the second quantity meet preset conditions, if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request.
Optionally, before determining the first number of ISCSI clients having a session relationship with the target ISCSI server and the second number of ISCSI servers having a session relationship with the target ISCSI client, the method further includes:
and constructing a list comprising each ISCSI server and the ISCSI clients having session relations with the ISCSI servers to obtain an ISCSI server list.
Optionally, after constructing a list including each ISCSI service end and the ISCSI client having a session relationship with each ISCSI service end to obtain an ISCSI service end list, the method further includes:
and acquiring an adding instruction of adding the ISCSI server or the ISCSI client having a session relation with the ISCSI server in the ISCSI server list, and updating the ISCSI server list according to the adding instruction.
Optionally, the determining a first number of ISCSI clients having a session relationship with the target ISCSI server includes:
finding out a first number of the ISCSI clients having session relation with the target ISCSI server from the ISCSI server list.
Optionally, the determining whether the first number and the second number meet a preset condition, and if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request includes:
determining whether the first number is not greater than a first threshold and the second number is not greater than a second threshold; wherein, the first threshold is the maximum number of sessions that can be established by the target ISCSI service end, and the second threshold is the maximum number of sessions that can be established by the target ISCSI client;
if yes, establishing a session relation between the target ISCSI client and the target ISCSI server according to the session request, and if not, not responding to the session request.
Optionally, after the session relationship is established between the target ISCSI client and the target ISCSI server according to the session request, the method further includes:
updating the number of the ISCSI clients having session relation with the target ISCSI server and the number of the ISCSI servers having session relation with the target ISCSI client.
Optionally, the session creating method further includes:
when the target ISCSI server fails, establishing a session relation between the target ISCSI client and a backup server corresponding to the target ISCSI server according to the session request through a failover operation mode;
and when the target ISCSI server side is in failure relief, performing failure recovery operation.
A second aspect of the present application provides a session creation apparatus, including:
the request acquisition module is used for acquiring a session request which is initiated by a target ISCSI client and establishes a session with a target ISCSI server;
a number determination module, configured to determine a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI client;
and the judging module is used for judging whether the first quantity and the second quantity meet preset conditions, and if so, establishing a session relation between the target ISCSI client and the target ISCSI server according to the session request.
A third aspect of the application provides an electronic device comprising a processor and a memory; wherein the memory is used for storing a computer program which is loaded and executed by the processor to implement the aforementioned session creation method.
A fourth aspect of the present application provides a computer-readable storage medium having stored therein computer-executable instructions that, when loaded and executed by a processor, implement the aforementioned session creation method.
In the application, a session request which is initiated by a target ISCSI client and establishes a session with a target ISCSI server is obtained; then determining a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI clients; and finally, judging whether the first quantity and the second quantity meet preset conditions, if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request. Therefore, after the session request is obtained, the session number of the target ISCSI server and the session number of the target ISCSI client are further determined, and when the session numbers of the target ISCSI server and the target ISCSI client meet preset conditions, a session is established between the target ISCSI client and the target ISCSI server, so that data throughput and IPSAN performance are improved.
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.
In the current big data era, massive data occupies a large amount of storage space. In order to ensure stable operation of upper-layer applications such as big data analysis and artificial intelligence, higher requirements are put forward on a data storage system, and particularly with the improvement of configuration of a host and storage hardware, how to improve the performance of the IPSAN is a technical problem to be solved urgently by technical personnel in the field. Based on this, the present application provides a session creation scheme, which can further determine the number of sessions of the target ISCSI service end and the number of sessions of the target ISCSI client after acquiring the session request, and create a session between the target ISCSI client and the target ISCSI service end when the numbers of sessions of the target ISCSI client and the target ISCSI client satisfy a preset condition, so as to improve data throughput and IPSAN performance.
Fig. 1 is a flowchart of a session creation method according to an embodiment of the present application. Referring to fig. 1, the session creation method includes:
s11: and acquiring a session request initiated by the target ISCSI client for establishing a session with the target ISCSI server.
In this embodiment, a session request initiated by a target ISCSI client to establish a session with a target ISCSI server is first obtained. The ISCSI service end (target), i.e. a server for storing the storage resources of the hard disk, can provide the available storage resources for the user, and the ISCSI client (initiator) is software used by the user to access the storage resources of the remote service end. The ISCSI service end can also be called a storage device, and the ISCSI client is correspondingly called a host system. The present embodiment improves ISCSI performance by increasing the number of sessions between the host and the storage. The target ISCSI client and the target ISCSI server are an ISCSI server and an ISCSI client which are about to establish a session. And one target ISCSI client corresponds to one unique IQN, and a session relation is established between the target ISCSI client and the target ISCSI server based on the IQN.
S12: determining a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI client.
In this embodiment, after the session request is acquired, a first number of ISCSI clients having a session relationship with the target ISCSI client and a second number of ISCSI clients having a session relationship with the target ISCSI client are determined. Before that, a list including each ISCSI server and the ISCSI clients having session relationships with each ISCSI server is constructed to obtain an ISCSI server list. Further, after the session request is obtained, the first number of ISCSI clients having a session relationship with the target ISCSI server is found from the ISCSI server list. The second number of ISCSI service sides having a session relationship with the target ISCSI client may be determined by the number of sessions established by the corresponding IQN. Since the ISCSI service list is dynamically changed according to the number of sessions it establishes, it needs to have update capability. Specifically, an adding instruction for adding the ISCSI service end or the ISCSI client having a session relationship with the ISCSI service end in the ISCSI service end list is obtained, and the ISCSI service end list is updated according to the adding instruction. In this example, taking the MCS storage system as an example, as shown in fig. 2, when a host or an IQN is added, the storage PLIF module adds the host or the IQN to a host list, and sends the list to the ietd daemon. When the host initiates a login request, the IETD accepts the login request of the host, and searches the total login number of the host in which iqn is located in the host list, i.e. the first number in the above embodiment. Wherein, the PLIF module (Platform Interface) is an Interface module of the MCS storage system, and provides an Interface between a component and a driver.
S13: and judging whether the first quantity and the second quantity meet preset conditions, if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request.
In this embodiment, after the first number and the second number are determined, it is determined whether the first number and the second number satisfy a preset condition, and if so, a session relationship is established between the target ISCSI client and the target ISCSI server according to the session request. Specifically, whether the first number is not larger than a first threshold value and whether the second number is not larger than a second threshold value is judged; the first threshold is the maximum number of sessions that the target ISCSI service end can establish, and the second threshold is the maximum number of sessions that the target ISCSI client can establish. If yes, establishing a session relation between the target ISCSI client and the target ISCSI server according to the session request, and if not, not responding to the session request. Considering that the performance of the hardware (CPU, memory, etc.) of the host device is more and more excellent, the hardware resources are fully utilized to exert the performance, and considering the requirements of using and storing other host hardware and the limitation of the resources at the back end of storage, reasonable limitation is required. Data throughput can be improved by increasing the number of sessions between the host and the storage, and the rapidity of data transmission is ensured to improve the IPSAN performance. Of course, the above is implemented under the condition that the maximum number of hosts and the maximum number of sessions allowed for storage are not changed, that is, the first threshold value is kept unchanged, and the second threshold value is expanded to increase the number of hosts and storage sessions to improve the performance of the IPSAN.
In this embodiment, in the MCS storage system, each ISCSI service end has at most 8 IQNs, and each IQN can establish at most 4 sessions. In this mode, the maximum number of sessions allowed for each ISCSI server is 32. The present embodiment will store the maximum number of connection sessions allowed to extend from 4 to 16 per IQN. The maximum number of sessions allowed by each ISCSI server is 32, and the rest specification parameters are also unchanged. Generally, each server corresponds to one IQN, and nowadays, the hardware configuration of a server host is higher and higher, and the performance of the server cannot be fully developed by 4 sessions. Data transfer rates between hosts and storage are increased by increasing the number of storage single server connections. The throughput of a single server and storage can be greatly improved by expanding the number of the servers to 16. When the user uses the system, if the maximum throughput of a single host needs to be exerted, a plurality of sessions can be established; if a plurality of hosts are required to be connected and stored, each host can reduce the number of connection sessions, so that more hosts can be logged in. That is, the maximum number of sessions that the target ISCSI service side can establish is 32, and the maximum number of sessions that the target ISCSI client side can establish is 16. If the host login number is less than 32 and the IQN login number is less than 16, the login is completed and the corresponding IQN login number is correspondingly increased, and if the host login number is greater than 32 or the IQN login number is greater than 16, the login of the IQN of the host is rejected. The IPSAN performance is improved by increasing the number of the host and the storage session, and meanwhile, the specification parameters of the IPSAN can be changed into configurable parameters, so that a user can configure according to the requirement of the user.
In this embodiment, in order to improve the fault tolerance in the session creation process, when a node fails, the session request may fail over (failover) to a normal node, so as to ensure that the normal node does not fail. The node can recover to the original session request after failure recovery (failback). Specifically, when the target ISCSI service end fails, a session relationship is established between the target ISCSI client and a backup service end corresponding to the target ISCSI service end according to the session request through a failover operation mode; and when the target ISCSI server side is in failure relief, performing failure recovery operation. It is understood that if the dual-control storage system fails over, the storage node of fail will register in the node of normal. In this embodiment, statistics of login of the fail node is also added to the ietd daemon module, and if the total login data of the normal node and the fail node is greater than 32, login behind the fail node is stopped. And the fail node will recover to the original login number at the time of failback.
Therefore, the embodiment of the application firstly acquires a session request which is initiated by a target ISCSI client and establishes a session with a target ISCSI server; then determining a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI clients; and finally, judging whether the first quantity and the second quantity meet preset conditions, if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request. After the session request is acquired, the session number of the target ISCSI client and the session number of the target ISCSI server are further determined, and when the session numbers of the target ISCSI client and the target ISCSI client meet preset conditions, a session is established between the target ISCSI client and the target ISCSI server, so that data throughput and IPSAN performance are improved.
Referring to fig. 3, an embodiment of the present application further discloses a session creating apparatus, which includes:
a request obtaining module 11, configured to obtain a session request initiated by a target ISCSI client to establish a session with a target ISCSI server;
a number determining module 12, configured to determine a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI clients having a session relationship with the target ISCSI client;
a determining module 13, configured to determine whether the first number and the second number meet a preset condition, and if so, establish a session relationship between the target ISCSI client and the target ISCSI server according to the session request.
Therefore, the embodiment of the application firstly acquires a session request which is initiated by a target ISCSI client and establishes a session with a target ISCSI server; then determining a first number of ISCSI clients having a session relationship with the target ISCSI server and a second number of ISCSI servers having a session relationship with the target ISCSI clients; and finally, judging whether the first quantity and the second quantity meet preset conditions, if so, establishing a session relationship between the target ISCSI client and the target ISCSI server according to the session request. After the session request is acquired, the session number of the target ISCSI client and the session number of the target ISCSI server are further determined, and when the session numbers of the target ISCSI client and the target ISCSI client meet preset conditions, a session is established between the target ISCSI client and the target ISCSI server, so that data throughput and IPSAN performance are improved.
In some specific embodiments, the session creating apparatus further includes:
the ISCSI server comprises a building module, a receiving module and a processing module, wherein the building module is used for building a list containing each ISCSI server and the ISCSI clients having session relations with the ISCSI servers so as to obtain an ISCSI server list;
an updating module, configured to acquire an addition instruction for adding the ISCSI service end in the ISCSI service end list or for obtaining an addition instruction for the ISCSI client having a session relationship with the ISCSI service end, and update the ISCSI service end list according to the addition instruction;
accordingly, the number determining module 12 is specifically configured to find the first number of ISCSI clients having a session relationship with the target ISCSI server from the ISCSI server list.
In some embodiments, the determining module 13 is specifically configured to determine whether the first number is not greater than a first threshold and whether the second number is not greater than a second threshold; wherein, the first threshold is the maximum number of sessions that can be established by the target ISCSI service end, and the second threshold is the maximum number of sessions that can be established by the target ISCSI client; if yes, establishing a session relation between the target ISCSI client and the target ISCSI server according to the session request, and if not, not responding to the session request.
Further, the embodiment of the application also provides electronic equipment. FIG. 4 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 4 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the session creation method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, data 223, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the electronic device 20, so as to realize the operation and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows Server, Netware, Unix, Linux, and the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the session creation method by the electronic device 20 disclosed in any of the foregoing embodiments. Data 223 may include session requests, etc. collected by electronic device 20.
Further, an embodiment of the present application further discloses a storage medium, in which a computer program is stored, and when the computer program is loaded and executed by a processor, the steps of the session creation method disclosed in any of the foregoing embodiments are implemented.
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 above-mentioned detailed descriptions of the session creation method, apparatus, device and storage medium provided by the present invention, and the specific examples are applied herein to explain the principle and the implementation of the present invention, and the descriptions of the above-mentioned embodiments are 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.