Dynamic allocation method, system and equipment of communication link and storage medium
Through dynamic allocation of communication links and load balancing adjustments, the problems of low utilization rate and poor stability of communication links in the prior art are solved, and efficient and stable communication link allocation is achieved.
Patent Information
- Application Number
- CN202411999261.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the prior art, the allocation method of communication links leads to low utilization of communication links, and a single remote replication exception will affect the stability of the entire link.
By dynamically allocating the communication link, dynamically allocating the communication link number according to the main and secondary end numbers of the remote replication relationship and consistency group, and load balancing adjustments are performed within the group to ensure load balancing of the communication link.
It improves the utilization rate of the communication link, reduces the impact of a single remote replication exception on the entire link, and ensures the stability and efficiency of the communication link.
Smart Images

Figure CN119766751A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, system, device and storage medium for dynamically allocating communication links. Background Art
[0002] For remote replication relationships within or between clusters and remote replication consistency groups, the primary and secondary ends need to rely on communication links for information transmission. The number and quality of the communication links used determine the speed and stability of remote replication data synchronization. The current communication link allocation method is as follows: For remote replication within a cluster, the stream_id of the transmission link used is 0. For remote replication between clusters, the stream_id of the transmission link is 16×other_cluster. The parameter other_cluster represents the sorting ID of the remote replication peer cluster in the local cluster partnership. For example, when each cluster supports a partnership with up to 3 clusters, the value of the parameter other_cluster is 1, 2, or 3. It can be seen that the remote replication relationships within the cluster are transmitted through stream 0, and the remote replication relationships between clusters are transmitted through streams 16, 32, and 48 respectively. As a result, for the remote replication relationships within the cluster and the remote replication relationships between clusters, the allocated communication links are fixed and the utilization rate is only 1 / 16. When a single remote replication exception affects the disconnection of the entire link, all remote replication services of the communication link will be affected.
[0003] In addition, for remote replication consistency groups within a cluster or between clusters, the current allocation method also cannot achieve effective utilization of communication links.
[0004] In summary, how to effectively improve the utilization rate of communication links is a technical problem that those skilled in the art urgently need to solve. Summary of the invention
[0005] The object of the present invention is to provide a method, system, device and storage medium for dynamically allocating communication links, so as to effectively improve the utilization rate of communication links.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a method for dynamically allocating a communication link, comprising:
[0008] When establishing a remote replication relationship within a cluster or between clusters, allocating a communication link for the remote replication relationship;
[0009] When establishing a remote replication consistency group within a cluster or between clusters, allocating a communication link for the remote replication consistency group;
[0010] Divide all the communication links into N groups, and for each group of the communication links, determine the load status of each communication link in the group; N is a positive integer not less than 2;
[0011] For each group of the communication links, according to the principle of load balancing, the remote replication relationship and / or remote replication consistency group of one or more of the communication links in the group are moved to other communication links in the group.
[0012] On the other hand, when establishing a remote replication relationship within a cluster or between clusters, allocating a communication link for the remote replication relationship includes:
[0013] When establishing a remote replication relationship within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication relationship are equal to (ID 主 +ID 辅 )% X + X × Z, allocating a communication link for the remote replication relationship;
[0014] Among them, ID 主 Indicates the logical storage unit number of the primary end in the remote replication relationship; ID 辅 It represents the logical storage unit number of the secondary end in the remote replication relationship; X is a preset positive integer, % X represents the modulo X, and Z represents the sorting number of the opposite cluster in the partnership of the local cluster, and for the remote replication relationship within the cluster, the value of Z is zero.
[0015] On the other hand, when establishing a remote replication consistency group within a cluster or between clusters, allocating a communication link for the remote replication consistency group includes:
[0016] When establishing a remote replication consistency group within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication consistency group are equal to (G 主 +G 辅 )% X + X×Z, allocating a communication link to the remote replication consistency group;
[0017] Among them, G 主 It represents the remote replication consistency group number of the primary end in the remote replication consistency group; G 辅 It represents the remote replication consistency group number of the secondary end in the remote replication consistency group; X is a preset positive integer, %X represents the modulo of X, and Z represents the sorting number of the opposite cluster in the partnership of the local cluster, and for the remote replication consistency group within the cluster, the value of Z is zero.
[0018] On the other hand, it also includes:
[0019] The communication link number assigned by the secondary end of the remote replication consistency group is recorded to the primary end of the remote replication consistency group, and the communication link number assigned by the primary end of the remote replication consistency group is recorded to the secondary end of the remote replication consistency group.
[0020] On the other hand, it also includes:
[0021] The connection status of each of the communication links is monitored, and when the connection status of any of the communication links is detected to be abnormal, an abnormality handling operation is performed.
[0022] On the other hand, for each group of the communication links, according to the principle of load balancing, the remote replication relationship and / or remote replication consistency group of one or more of the communication links in the group is moved to other communication links in the group, including:
[0023] For each group of the communication links, determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+a)%Y-th communication link in the group;
[0024] If it is greater than K times the current average load of the (i+a)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+a)%Yth communication link; wherein a is a positive integer, Y is the total number of communication links in the group, % Y represents the modulo of Y, and K is a preset value greater than 1; the load of the communication link includes the remote replication relationship and remote replication consistency group of the communication link;
[0025] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+b)%Y-th communication link in the group;
[0026] If it is greater than K times the current average load of the (i+b)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+b)%Yth communication link; where b is a positive integer and b≠a;
[0027] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+c)%Y-th communication link in the group;
[0028] If it is greater than K times the current average load of the (i+c)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+c)%Yth communication link; where c is a positive integer and b≠a≠c;
[0029] After i changes from 0 to Y-1 in sequence, the load balancing of the communication links in this group is completed.
[0030] On the other hand, part of the load of the i-th communication link is moved to the (i+a)%Y-th communication link, including:
[0031] Move 1 / M of the load on the i-th communication link to the (i+a)%Y-th communication link, where M is a positive integer greater than 1.
[0032] In a second aspect, the present invention provides a system for dynamically allocating communication links, comprising:
[0033] A first communication link allocation module, configured to allocate a communication link to a remote replication relationship within a cluster or between clusters when the remote replication relationship is established;
[0034] A second communication link allocation module, configured to allocate a communication link to a remote replication consistency group when establishing a remote replication consistency group within a cluster or between clusters;
[0035] A load state determination module, used to divide all the communication links into N groups, and for each group of the communication links, determine the load state of each of the communication links in the group; N is a positive integer not less than 2;
[0036] The communication link adjustment module is used to move the remote replication relationship and / or remote replication consistency group of one or more of the communication links in each group of the communication links to other communication links in the group according to the load balancing principle.
[0037] In a third aspect, the present invention provides a device for dynamically allocating communication links, comprising:
[0038] Memory for storing computer programs;
[0039] A processor is used to execute the computer program to implement the steps of the method for dynamically allocating communication links as described above.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for dynamic allocation of communication links as described above are implemented.
[0041] By applying the technical solution provided in the embodiment of the present invention, communication links can be dynamically allocated to improve the utilization rate of communication links. Specifically, when a remote replication relationship is established within a cluster or between clusters, communication links can be allocated to the remote replication relationship from all communication links of the cluster to ensure the implementation of the remote replication relationship. When a remote replication consistency group is established within a cluster or between clusters, communication links can also be allocated to the remote replication consistency group from all communication links of the cluster to ensure the implementation of the remote replication consistency group. And after the allocation is completed, the communication links can be further dynamically adjusted in the present application scheme. Specifically, considering that if the communication links are dynamically adjusted on a global scale, the implementation will be more complicated, all the communication links will be divided into N groups in the present application scheme, and N is a positive integer not less than 2, so that the communication links can be dynamically adjusted within the group to ensure the convenience and reliability of the implementation of the scheme. For each group of communication links, it is necessary to determine the load status of each communication link in the group, and then according to the principle of load balancing, move the remote replication relationship and / or remote replication consistency group of one or more communication links in the group to other communication links in the group. That is, by adjusting the remote replication relationship and / or remote replication consistency group in the group, dynamic adjustment of the communication links is achieved, and load balancing is guaranteed, thereby effectively improving the utilization rate of the communication links.
[0042] In summary, the present application solution can effectively improve the utilization rate of the communication link and ensure the convenience and reliability of the implementation of the solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a method for dynamically allocating communication links provided by a specific embodiment of the present invention;
[0045] Figure 2 A schematic diagram of the structure of a dynamic allocation system for communication links provided by a specific embodiment of the present invention;
[0046] Figure 3 A schematic diagram of the structure of a dynamic allocation device for communication links provided in a specific embodiment of the present invention;
[0047] Figure 4 The present invention is a schematic diagram of the structure of a computer-readable storage medium. DETAILED DESCRIPTION
[0048] The core of the present invention is to provide a method for dynamically allocating communication links, which can effectively improve the utilization rate of communication links and ensure the convenience and reliability of solution implementation.
[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] Please refer to Figure 1 , Figure 1 The present invention is a flowchart of a method for dynamically allocating communication links provided in a specific embodiment of the present invention. The method for dynamically allocating communication links may include the following steps:
[0051] Step S101: when establishing a remote replication relationship within a cluster or between clusters, a communication link is allocated to the remote replication relationship from all communication links of the cluster.
[0052] Specifically, the present application scheme can be applied to each cluster. When establishing a remote replication relationship within a cluster or between clusters, it is necessary to allocate a communication link for the master end and the slave end of the remote replication relationship. The communication link IDs of the master end and the slave end are usually the same. The specific communication link allocation method can be set according to actual needs, for example, the original default communication link allocation method can be used.
[0053] Still taking the example that each cluster supports establishing partnerships with up to three clusters, for example, cluster A has established a remote replication relationship within the cluster, and communication links can be allocated to the remote replication relationship from all communication links of cluster A, specifically, communication links are allocated to the primary and secondary ends of the remote replication relationship, and as described above, generally speaking, the communication link IDs of the primary and secondary ends are usually the same. Since the default communication link allocation method is adopted, in this example, the communication link number allocated to the remote replication relationship is 0, that is, the communication links allocated to the primary and secondary ends are stream_id = 0. Stream refers to the communication link for transmitting information. In the present application, it is specifically the communication link used for data transmission between the remote replication primary and secondary ends. Stream_id is also the communication link ID, or the communication link number. When a remote replication relationship between clusters is established, when the communication link is allocated to the primary and secondary ends of the remote replication relationship, the allocation method can be expressed as stream_id = 16×other_cluster. The parameter other_cluster represents the sorting ID of the remote replication peer cluster in the local cluster partnership. Since in this example, each cluster supports a maximum of three clusters to establish partnerships, the value of the parameter other_cluster is 1, 2, or 3. For example, after cluster A and cluster B establish a partnership, a remote replication relationship is established between cluster A and cluster B. According to the above formula, the communication link stream_id=16×1=16 is allocated to the primary and secondary ends of the remote replication relationship. That is to say, for the primary end of the remote replication relationship (cluster A), the communication link allocated for the remote replication relationship is stream16 of cluster A. Similarly, for the secondary end of the remote replication relationship (cluster B), the communication link allocated for the remote replication relationship is stream16 of cluster B. Similarly, if cluster A establishes a partnership with cluster C and a remote replication relationship is established between cluster A and cluster C, the communication link allocated for the primary and secondary ends of the remote replication relationship between cluster A and cluster C is stream_id=16×2=32. For another example, cluster A has established a partnership with cluster D, and a remote replication relationship has been established between cluster A and cluster D. Then, the communication link allocated for the remote replication relationship between cluster A and cluster D is stream_id=16×3=48.
[0054] In a specific implementation of the present invention, step S101 may include:
[0055] When establishing a remote replication relationship within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication relationship from all the communication links in the cluster are all = (ID 主 +ID 辅)% X + X × Z to allocate communication links for remote replication relationships;
[0056] Among them, ID 主 Indicates the logical storage unit number of the primary end in a remote replication relationship; ID 辅 It represents the logical storage unit number of the secondary end in the remote replication relationship; X is a preset positive integer, % X represents the modulo of X, and Z represents the sorting number of the peer cluster in the partnership of the local cluster. For the remote replication relationship within the cluster, the value of Z is zero.
[0057] It can be seen from the above description that in the above example, the remote replication relationship within the cluster is transmitted through stream 0, and the remote replication between clusters is transmitted through streams 16, 32, and 48 respectively. In this way, for the remote replication relationship, the communication link is fixed and the utilization rate is only 1 / 16. When a single remote replication anomaly affects the disconnection of the entire link, it will affect all remote replication services of the communication link. Although the communication link can be dynamically allocated in the steps later in this application, if different remote replication relationships can be distributed to different communication links more evenly to a certain extent when executing step S101, the movement amount in subsequent operations can be effectively reduced, which is conducive to improving the execution efficiency of subsequent steps. Therefore, in this implementation, when executing step S101, the remote replication relationship within the cluster or between clusters can be distributed to different communication links more evenly.
[0058] Specifically, this implementation method takes into account that, whether it is a remote replication relationship within a cluster or between clusters, for different remote replication relationships, the logical storage unit numbers of the primary and secondary ends involved are usually different and random. Therefore, in this implementation method, when establishing a remote replication relationship within a cluster or between clusters, whether it is for the primary end or the secondary end of the remote replication relationship, the communication link number allocated is in accordance with (ID 主 +ID 辅 )% X +X×Z, that is, whether it is the primary end or the secondary end, stream_id is = (ID 主 +ID 辅 )% X +X×Z.
[0059] In this formula, ID 主 and ID 辅 They respectively represent the logical storage unit number of the primary end and the logical storage unit number of the secondary end in the remote replication relationship. 主 and ID 辅After the sum, it is necessary to take the modulus of X. For example, when the value of X is 16, it is taken the modulus of 16, and the result obtained will be an integer value between 0 and 15. X being 16 is also a commonly used implementation scheme at present. In other specific implementation schemes, based on different cluster parameter configurations, X can be other values, which does not affect the implementation of the present invention.
[0060] Still taking X=16, and each cluster supports a maximum of 3 clusters to establish partnerships as an example. In this implementation, when establishing a remote replication relationship within cluster A, Z=0. At this time, the stream_id of the communication link allocated to the primary and secondary ends of the remote replication relationship is (ID 主 +ID 辅 )% X, it can be seen that for the remote replication relationship within cluster A, stream 0 of cluster A is no longer fixedly allocated, but streams 0 to 15 of cluster A may be allocated. For example, after cluster A and cluster B establish a partnership, a remote replication relationship is established between cluster A and cluster B. In this implementation method, the communication link stream_id = (ID 主 +ID 辅 )% 16 +16×1. That is, for the remote replication relationship between cluster A and cluster B, streams 16 to 31 of cluster A may all be allocated.
[0061] For example, cluster A has established a partnership with cluster C, and a remote replication relationship has been established between cluster A and cluster C. In this implementation, the communication link stream_id is assigned to the primary and secondary ends of the remote replication relationship. 主 +ID 辅 )% 16 +16×2. That is, for the remote replication relationship between cluster A and cluster C, streams 32 to 47 of cluster A may all be allocated.
[0062] Step S102: when establishing a remote replication consistency group within a cluster or between clusters, a communication link is allocated to the remote replication consistency group from all communication links of the cluster.
[0063] A remote replication consistency group is a method for managing multiple remote replication relationships in a unified manner and operating multiple remote replications simultaneously. In a remote replication consistency group, LUNs (Logical Units) of different remote replications can be located in different controllers, but they must use the same replication mode. In addition, when adding a remote replication relationship to a remote replication consistency group, the configuration attributes (synchronization rate, recovery policy, etc.) must be the same as those of the remote replication consistency group.
[0064] When establishing a remote replication consistency group within a cluster or between clusters, it is necessary to allocate communication links to the remote replication consistency group from all communication links in the cluster. Specifically, it is necessary to allocate communication links to the primary and secondary ends of the remote replication consistency group. The communication link IDs allocated to the primary and secondary ends are usually the same. The specific communication link allocation method can be set according to actual needs. For example, the original default communication link allocation method can be used. Still taking the example that each cluster supports establishing partnerships with up to three clusters, when establishing a remote replication consistency group within a cluster, the remote replication consistency group is allocated stream_id=consist_group %16 of the primary and secondary communication links. The parameter consist_group refers to the ID of the remote replication consistency group. For the remote replication consistency group between clusters, the remote replication consistency group is allocated stream_id=consist_group %16+16×other_cluster of the primary and secondary communication links. It can be seen that when the number of remote replication consistency groups is low, the communication links cannot be effectively utilized.
[0065] Since in this example, each cluster supports a partnership with up to three clusters, the value of the parameter other_cluster is 1, 2, or 3. For example, after cluster A and cluster B establish a partnership, a remote replication consistency group is established between cluster A and cluster B. The communication link stream_id=consist_group %16+16×1 is allocated to the primary and secondary ends of the remote replication consistency group. In other words, for the remote replication consistency group between cluster A and cluster B, streams 16 to 31 of cluster A may all be allocated. For another example, if cluster A establishes a partnership with cluster C and a remote replication consistency group is established between cluster A and cluster C, the communication link stream_id=consist_group %16+16×2 is allocated to the primary and secondary ends of the remote replication consistency group between cluster A and cluster C. In other words, for the remote replication consistency group between cluster A and cluster C, streams 31 to 47 of cluster A may all be allocated. For example, cluster A has established a partnership with cluster D, and a remote replication consistency group is established between cluster A and cluster D. Then, the stream_id of the communication link is allocated to the remote replication consistency group between cluster A and cluster D = consist_group %16+16×3. In other words, for the remote replication consistency group between cluster A and cluster D, streams 48 to 63 of cluster A may all be allocated.
[0066] However, it should be noted that, when the above solution is adopted, if the number of remote replication consistency groups is low, only a small number of communication links will be allocated. If there is no subsequent operation to move the load, it is also not conducive to the effective use of communication links.
[0067] In a specific implementation of the present invention, step S102 may specifically include:
[0068] When establishing a remote replication consistency group within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication consistency group are equal to (G 主 +G 辅 )% X + X × Z to allocate communication links for remote replication consistency groups;
[0069] Among them, G 主 Indicates the remote replication consistency group number of the primary end in the remote replication consistency group; G 辅 It represents the remote replication consistency group number of the secondary end in the remote replication consistency group; X is a preset positive integer, % X represents the modulo of X, and Z represents the sorting number of the peer cluster in the partnership of the local cluster. For the remote replication consistency group within the cluster, the value of Z is zero.
[0070] When using the default method to allocate communication links for remote replication consistency groups, in some special scenarios, the stream_id of the primary and secondary ends may be inconsistent. Specifically, for example, cluster A and cluster B establish a partnership, and a remote replication consistency group within the cluster is established in cluster A, called rc_grp_A. Then, a remote replication consistency group between cluster A and cluster B is created, called rc_grp_AB, and then an inter-cluster remote replication rc_rel_AB with A as the primary end is established and added to the consistency group rc_grp_AB. Since there are two remote replication consistency groups on the primary end (cluster A), according to the above implementation method, for this remote replication consistency group between cluster A and cluster B, for cluster A, consist_group=1, and other_cluster=1, therefore, for this remote replication consistency group between cluster A and cluster B, the stream_id of the primary end (cluster A) = consist_group % 16 + 16×1=1%16+16×1=1+16=17. Since there is only one remote replication consistency group in the secondary end (cluster B), for the remote replication consistency group between cluster A and cluster B, for cluster B, consist_group=0, other_cluster=1, so the stream_id of the secondary end (cluster B)= consist_group % 16 + 16×1=0%16+16×1=0+16=16. The primary and secondary ends allocate different stream_ids to themselves, which does not affect the continued operation of the remote replication consistency group, but there is a certain degree of risk of link processing disorder.
[0071] In this implementation, the situation where the stream_ids allocated by the master and slave ends are different due to the above-mentioned special scenarios can be avoided.
[0072] Specifically, in this implementation, when establishing a remote replication consistency group within a cluster or between clusters, both the primary and secondary ends will follow stream_id=(G 主 +G 辅 )% X +X×Z method to allocate their respective communication links.
[0073] Still taking X=16, and each cluster supports a maximum of 3 clusters to establish partnerships as an example. In this implementation, when establishing a remote replication consistency group within cluster A, Z=0. At this time, the stream_id of the communication link allocated to the primary and secondary ends of the remote replication consistency group is (G 主 +G 辅 )% 16. G 主 and G 辅The following table shows the remote replication consistency group numbers of the primary and secondary ends in the remote replication consistency group. It can be seen that since the stream_id of the communication link allocated by the primary and secondary ends is equal to (G 主 +G 辅 )% 16, so for the remote replication consistency group within the cluster, the stream_ids assigned to the primary and secondary ends will not be different.
[0074] Take the above special scenario as an example, for example, cluster A and cluster B establish a partnership, and a remote replication consistency group is established in cluster A, called rc_grp_A. Then, a remote replication consistency group is created between cluster A and cluster B, called rc_grp_AB, and then an inter-cluster remote replication rc_rel_AB with A as the master end is established and added to the consistency group rc_grp_AB. For this remote replication consistency group between cluster A and cluster B, in this implementation method, the stream_id of the communication link allocated by the master and slave ends is both = (G 主 +G 辅 )% 16+16×1. In this example, G 主, is equal to 1, G 辅 It is equal to 0. It can be seen that since the stream_id of the communication link allocated by the master and slave ends is equal to (G 主 +G 辅 )% X +X×Z. Therefore, for the remote replication consistency group between clusters, the above-mentioned special scenarios will not cause the different stream_ids allocated on the primary and secondary ends.
[0075] In addition, when the default method is used to allocate communication links for remote replication consistency groups, in some special scenarios, the stream_id of the primary and secondary ends may be inconsistent. Specifically, for example, cluster A establishes a partnership with cluster B, and cluster B establishes a partnership with cluster C. Then, with cluster B as the primary end, a remote replication relationship rc_rel_BC is established between cluster B and cluster C. At this time, for the primary end (cluster B) of the remote replication relationship rc_rel_BC, other_cluster=2, so stream id=16×other_cluster= 16×2 = 32, and for the secondary end of the remote replication relationship rc_rel_BC, other_cluster=1 (cluster C), so stream id=16×other_cluster= 16×1=16.
[0076] When the stream_ids allocated by the master and slave ends are different, one way to handle this is to add additional judgment logic to the IO processing flow of the slave end to determine whether to use the stream_id of the master end or the stream_id of the slave end for IO processing.
[0077] In a specific embodiment of the present invention, it may also include:
[0078] The communication link number assigned to the secondary end of the remote replication consistency group is recorded to the primary end of the remote replication consistency group, and the communication link number assigned to the primary end of the remote replication consistency group is recorded to the secondary end of the remote replication consistency group.
[0079] This implementation method takes into account that, in the case where the stream_ids assigned by the primary and secondary ends are different, the communication link number assigned by the secondary end of the remote replication consistency group can be recorded to the primary end of the remote replication consistency group. That is to say, for the remote replication consistency group, the primary end can not only determine the stream_id of the primary end itself, but also know the stream_id of the secondary end. Similarly, the communication link number assigned by the primary end of the remote replication consistency group will be recorded to the secondary end of the remote replication consistency group. That is to say, the secondary end can not only determine the stream_id of the secondary end itself, but also know the stream_id of the primary end. At this time, both the primary and secondary ends can determine whether the remote replication consistency group has a different stream_id. In addition, the situation where the stream_ids assigned by the primary and secondary ends are different usually has an impact on the error handling logic. In this implementation method, since for the remote replication consistency group, both the primary and secondary ends can determine the stream_id of the other end, the corresponding operation can be completed based on the stream_id of the other end in the error handling logic to effectively ensure the correct execution of the error handling logic.
[0080] Furthermore, in a specific implementation, after allocating a communication link for a remote replication relationship, the communication link number allocated to the secondary end of the remote replication relationship can also be recorded to the primary end of the remote replication consistency group, and the communication link number allocated to the primary end of the remote replication relationship can be recorded to the secondary end of the remote replication consistency group. This avoids the situation where the stream_ids allocated to the primary and secondary ends are different due to inconsistent logical storage unit numbers between the primary and secondary ends, and inconsistent sorting numbers of the opposite end cluster in the partnership of the local end cluster, which affects the execution of the error handling logic and the occurrence of link errors. In other words, for a remote replication relationship, even if the stream_ids allocated to the primary and secondary ends are different, in this implementation, since both the primary and secondary ends can determine the stream_id of the opposite end, the correct execution of the error handling logic can be effectively guaranteed, reducing the risk of link handling errors.
[0081] Step S103: Divide all communication links of the cluster into N groups, and for each group of communication links, determine the load status of each communication link in the group; N is a positive integer not less than 2.
[0082] Considering that the implementation will be more complicated if dynamic adjustment of communication links is performed on a global scale, in the present application, for all communication links of a cluster, all these communication links will be divided into N groups, where N is a positive integer not less than 2, so that dynamic adjustment of communication links can be performed within the group to ensure the convenience and reliability of the implementation of the solution. The specific grouping method can be set and adjusted according to actual needs. Generally speaking, considering that the cluster has different partners, the communication links used within the cluster can usually be regarded as one group, and the communication links used between the cluster and different partners can be regarded as corresponding groups. For example, in the above example, each cluster supports a maximum of 3 clusters to establish partnerships, and X=16, then all communication links can be divided into 4 groups, that is, N=4. Each group includes 16 communication links, of which the communication links occupied by intra-cluster communication are streams 0 to 15, and the inter-cluster communication occupies streams 16 to 31, streams 32 to 47, and streams 48 to 63 respectively.
[0083] For each group of communication links, it is necessary to determine the load status of each communication link in the group. The load status can be measured by multiple load parameters such as real-time load and / or average load. For example, in a specific scenario, considering that the load status will change continuously, but the fluctuation is usually not particularly large, the average load of the communication link in the most recent first time period is usually regarded as the load status of the communication link. The first time period can be set as needed. The load of the communication link includes the remote replication relationship and remote replication consistency group using the communication link. In other words, the load of the communication link refers to the total number of remote replication relationships and remote replication consistency groups using the communication link. The average load of the communication link is the load average value of the communication link in the most recent first time period.
[0084] Step S104: for each group of communication links, according to the load balancing principle, the remote replication relationship and / or remote replication consistency group of one or more communication links in the group is moved to other communication links in the group.
[0085] For each group of communication links, since the load status of each communication link in the group is determined, the remote replication relationship and / or remote replication consistency group of one or more communication links in the group can be moved to other communication links in the group according to the principle of load balancing.
[0086] The load of a communication link refers to the total number of remote replication relationships and remote replication consistency groups using the communication link. The specific movement method can be set and adjusted according to actual needs so that after the movement is completed, the communication links in the group achieve the purpose of load balancing.
[0087] In a specific implementation of the present invention, for each group of communication links, according to the principle of load balancing, the remote replication relationship and / or remote replication consistency group of one or more communication links in the group is moved to other communication links in the group, including:
[0088] For each group of communication links, determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+a)%Y-th communication link in the group;
[0089] If it is greater than K times the current average load of the (i+a)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+a)%Yth communication link; where a is a positive integer, Y is the total number of communication links in the group, % Y represents the modulo of Y, and K is a preset value greater than 1; the load of the communication link includes the remote replication relationship and remote replication consistency group of the communication link;
[0090] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+b)%Y-th communication link in the group;
[0091] If it is greater than K times the current average load of the (i+b)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+b)%Yth communication link; where b is a positive integer and b≠a;
[0092] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+c)%Y-th communication link in the group;
[0093] If it is greater than K times the current average load of the (i+c)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+c)%Yth communication link; where c is a positive integer and b≠a≠c;
[0094] After i changes from 0 to Y-1 in sequence, the load balancing of the communication links in this group is completed.
[0095] This implementation takes into account that since a group includes a large number of communication links, in order to effectively achieve load balancing, a loop traversal method can be used to achieve load balancing as much as possible and improve the utilization rate of the communication links.
[0096] For example, in one scenario, a user creates 1,000 active-active volumes in batches. Each active-active volume includes a primary volume, an auxiliary volume, a primary change volume, and an auxiliary change volume. And each active-active volume establishes a remote replication relationship within the cluster. If the communication link numbers assigned to the primary and secondary ends of the remote replication relationship are both = (ID 主 +ID 辅 )% X + X×Z, because the active-active primary LUN_ID (that is, ID 主 ) can be expressed as 4×n, and the LUN_ID (also known as ID 辅 ) can be expressed as 4×n+1, so it can be seen that the obtained stream_id of the primary and secondary ends will only be stream1, stream5, stream9, and stream13, resulting in a link utilization rate of only 1 / 4. Although it is 3 times higher than the default allocation algorithm (fixed to stream0 so that the link utilization rate is 1 / 16), the 16 communication links in the cluster are not fully utilized. The present application solution can further improve the utilization rate of the communication links through the operation of step S104.
[0097] Y is the total number of communication links in the group, which is usually the same as the value of X. For example, taking Y=16 as an example, i takes values from 0 to 15.
[0098] Take i=0 as an example. First, it is necessary to determine whether the current average load of the 0th communication link in the group is greater than K times the current average load of the (i+a)%Yth communication link in the group. In the case of Y=16, a can be 8, for example, and K can be 2, for example.
[0099] In this example, (0+8)%16=8. If the current average load of the 0th communication link in the group is greater than twice the current average load of the 8th communication link in the group, it means that the current average load of the 0th communication link is much higher than that of the 8th communication link. Therefore, part of the load of the 0th communication link needs to be moved to the 8th communication link.
[0100] When part of the load of the ith communication link is moved to the (i+a)%Yth communication link, there may be multiple specific operation modes. For example, in a specific implementation, it may include: moving 1 / M of the load of the ith communication link to the (i+a)%Yth communication link, where M is a positive integer greater than 1. In this implementation, a certain proportion of the load of the ith communication link, that is, 1 / M of the load, is moved to the (i+a)%Yth communication link, for example, M=4. Specifically, the first 1 / 4 of the load of the ith communication link may be moved to the (i+a)%Yth communication link.
[0101] After moving part of the load of the ith communication link to the (i+a)%Yth communication link, subsequent judgment can be continued. Of course, if the current average load of the ith communication link in the group is not greater than K times the current average load of the (i+a)%Yth communication link in the group, subsequent judgment can be directly performed.
[0102] In this example, i=0, K=2, and b is 4. Then it is necessary to determine whether the current average load of the 0th communication link in the group is greater than twice the current average load of the (0+4)%Yth communication link in the group. Since Y=16, (0+4)%Y=4.
[0103] If the current average load of the 0th communication link in the group is greater than twice the current average load of the 4th communication link in the group, it means that the current average load of the 0th communication link is much higher than that of the 4th communication link. Therefore, part of the load of the 0th communication link needs to be moved to the 4th communication link. After moving part of the load of the ith communication link to the (i+b)%Yth communication link, subsequent judgment can be continued. Of course, if the current average load of the ith communication link in the group is not greater than K times the current average load of the (i+b)%Yth communication link in the group, subsequent judgment can be made directly.
[0104] For example, if c is 2, it is necessary to continue to determine whether the current average load of the 0th communication link in the group is greater than twice the current average load of the 2nd communication link in the group. If so, it means that the current average load of the 0th communication link is much higher than that of the 2nd communication link. Therefore, part of the load of the 0th communication link needs to be moved to the 2nd communication link. Execute, and the traversal process for the 0th communication link ends.
[0105] It can be seen that when i is 0, the load of the 0th communication link can be effectively migrated to other communication links with lower average loads in the group through a maximum of 3 load migrations. After i is changed from 0 to Y-1, the load balancing of all communication links in the group is completed once.
[0106] In this implementation, load balancing is achieved as much as possible through loop traversal, thereby improving the utilization rate of the communication link. In addition, during the loop traversal process, for the i-th communication link, it is not necessary to compare its average load with the average load of the remaining communication links in the group one by one, thus effectively ensuring the traversal efficiency. In addition, after load balancing is performed according to this implementation, since the load situation usually does not fluctuate greatly in a short period of time, load balancing can be performed again after a period of time to avoid excessive adjustment of the communication link.
[0107] In a specific embodiment of the present invention, it may also include:
[0108] The connection status of each communication link is monitored, and when the connection status of any communication link is detected to be abnormal, an abnormality handling operation is performed.
[0109] In this implementation, the connection status of each communication link can be monitored. If the connection status of any communication link is detected to be abnormal, a preset exception handling operation can be performed. For example, the load of the communication link, that is, all remote replication relationships and remote replication consistency groups of the communication link, can be moved to other normal communication links. For another example, the communication link can be reconnected and abnormal recovery can be attempted through preset means, and the exception handling operation can be set according to actual needs.
[0110] By applying the technical solution provided in the embodiment of the present invention, communication links can be dynamically allocated to improve the utilization rate of communication links. Specifically, when a remote replication relationship is established within a cluster or between clusters, communication links can be allocated to the remote replication relationship from all communication links of the cluster to ensure the implementation of the remote replication relationship. When a remote replication consistency group is established within a cluster or between clusters, communication links can also be allocated to the remote replication consistency group from all communication links of the cluster to ensure the implementation of the remote replication consistency group. And after the allocation is completed, the communication links can be further dynamically adjusted in the present application scheme. Specifically, considering that if the communication links are dynamically adjusted on a global scale, the implementation will be more complicated, all the communication links will be divided into N groups in the present application scheme, and N is a positive integer not less than 2, so that the communication links can be dynamically adjusted within the group to ensure the convenience and reliability of the implementation of the scheme. For each group of communication links, it is necessary to determine the load status of each communication link in the group, and then according to the principle of load balancing, move the remote replication relationship and / or remote replication consistency group of one or more communication links in the group to other communication links in the group. That is, by adjusting the remote replication relationship and / or remote replication consistency group in the group, dynamic adjustment of the communication links is achieved, and load balancing is guaranteed, thereby effectively improving the utilization rate of the communication links.
[0111] In summary, the present application solution can effectively improve the utilization rate of the communication link and ensure the convenience and reliability of the implementation of the solution.
[0112] Corresponding to the above method embodiment, an embodiment of the present invention further provides a dynamic allocation system for communication links, which can be referred to in correspondence with the above.
[0113] See also Figure 2 FIG. 1 is a schematic diagram of a structure of a dynamic allocation system for communication links in the present invention, comprising:
[0114] A first communication link allocation module 201 is used to allocate a communication link to the remote replication relationship from all communication links of the cluster when establishing a remote replication relationship within a cluster or between clusters;
[0115] A second communication link allocation module 202, configured to allocate a communication link to the remote replication consistency group from all communication links of the cluster when establishing a remote replication consistency group within a cluster or between clusters;
[0116] The load state determination module 203 is used to divide all communication links of the cluster into N groups, and for each group of communication links, determine the load state of each communication link in the group; N is a positive integer not less than 2;
[0117] The communication link adjustment module 204 is used to move the remote replication relationship and / or remote replication consistency group of one or more communication links in each group of communication links to other communication links in the group according to the load balancing principle.
[0118] In a specific implementation of the present invention, the first communication link allocation module 201 is specifically used for:
[0119] When establishing a remote replication relationship within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication relationship from all the communication links in the cluster are all = (ID 主 +ID 辅 )% X + X × Z to allocate communication links for remote replication relationships;
[0120] Among them, ID 主 Indicates the logical storage unit number of the primary end in a remote replication relationship; ID 辅 It represents the logical storage unit number of the secondary end in the remote replication relationship; X is a preset positive integer, % X represents the modulo of X, and Z represents the sorting number of the peer cluster in the partnership of the local cluster. For the remote replication relationship within the cluster, the value of Z is zero.
[0121] In a specific implementation of the present invention, the second communication link allocation module 202 is specifically used to:
[0122] When establishing a remote replication consistency group within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication consistency group are equal to (G 主 +G 辅 )% X + X × Z to allocate communication links for remote replication consistency groups;
[0123] Among them, G 主 Indicates the remote replication consistency group number of the primary end in the remote replication consistency group; G 辅 It represents the remote replication consistency group number of the secondary end in the remote replication consistency group; X is a preset positive integer, % X represents the modulo of X, and Z represents the sorting number of the peer cluster in the partnership of the local cluster. For the remote replication consistency group within the cluster, the value of Z is zero.
[0124] In a specific implementation of the present invention, a peer communication link number obtaining module is further included, which is used to:
[0125] The communication link number assigned to the secondary end of the remote replication consistency group is recorded to the primary end of the remote replication consistency group, and the communication link number assigned to the primary end of the remote replication consistency group is recorded to the secondary end of the remote replication consistency group.
[0126] In a specific embodiment of the present invention, a communication link connection status monitoring module is also included, which is used to:
[0127] The connection status of each communication link is monitored, and when the connection status of any communication link is detected to be abnormal, an abnormality handling operation is performed.
[0128] In a specific implementation of the present invention, the communication link adjustment module 204 is specifically used to:
[0129] For each group of communication links, determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+a)%Y-th communication link in the group;
[0130] If it is greater than K times the current average load of the (i+a)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+a)%Yth communication link; where a is a positive integer, Y is the total number of communication links in the group, % Y represents the modulo of Y, and K is a preset value greater than 1; the load of the communication link includes the remote replication relationship and remote replication consistency group of the communication link;
[0131] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+b)%Y-th communication link in the group;
[0132] If it is greater than K times the current average load of the (i+b)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+b)%Yth communication link; where b is a positive integer and b≠a;
[0133] Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+c)%Y-th communication link in the group;
[0134] If it is greater than K times the current average load of the (i+c)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+c)%Yth communication link; where c is a positive integer and b≠a≠c;
[0135] After i changes from 0 to Y-1 in sequence, the load balancing of the communication links in this group is completed.
[0136] In a specific implementation of the present invention, moving part of the load of the i-th communication link to the (i+a)%Y-th communication link comprises:
[0137] Move 1 / M of the load on the i-th communication link to the (i+a)%Y-th communication link, where M is a positive integer greater than 1.
[0138] Corresponding to the above method and system embodiments, the embodiments of the present invention further provide a dynamic allocation device for communication links, a computer-readable storage medium, and a computer program product, which can be referred to in correspondence with the above.
[0139] See also Figure 3 As shown, the device may include:
[0140] Memory 301, used for storing computer programs;
[0141] The processor 302 is configured to execute a computer program to implement the steps of the method for dynamically allocating communication links in any of the above embodiments.
[0142] The computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the method for dynamically allocating communication links in any of the above embodiments are implemented.
[0143] See also Figure 4 The computer readable storage medium 40 stores a computer program 41, and when the computer program 41 is executed by the processor, the steps of the dynamic allocation method of the communication link in any of the above embodiments are implemented. The computer readable storage medium 50 mentioned here includes RAM (Random Access Memory), memory, ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), register, hard disk, removable disk, or any other form of storage medium known in the technical field.
[0144] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0145] Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention, and the description of the above embodiments is only used to help understand the technical solution and its core idea of the present invention. It should be pointed out that for ordinary technicians in the technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A method for dynamically allocating communication links, characterized in that: include: When establishing a remote replication relationship within a cluster or between clusters, allocating a communication link to the remote replication relationship from all communication links of the cluster; When establishing a remote replication consistency group within a cluster or between clusters, allocating a communication link to the remote replication consistency group from all communication links of the cluster; Dividing all communication links of the cluster into N groups, and for each group of communication links, determining a load state of each communication link in the group; N is a positive integer not less than 2; For each group of the communication links, according to the principle of load balancing, the remote replication relationship and / or remote replication consistency group of one or more of the communication links in the group are moved to other communication links in the group.
2. The method for dynamically allocating communication links according to claim 1, characterized in that: When establishing a remote replication relationship within a cluster or between clusters, allocating a communication link to the remote replication relationship from all communication links of the cluster includes: When establishing a remote replication relationship within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication relationship from all the communication links in the cluster are equal to (ID 主 +ID 辅 )% X + X × Z, allocating a communication link for the remote replication relationship; Among them, ID 主 Indicates the logical storage unit number of the primary end in the remote replication relationship; ID 辅 It represents the logical storage unit number of the secondary end in the remote replication relationship; X is a preset positive integer, % X represents the modulo X, and Z represents the sorting number of the opposite cluster in the partnership of the local cluster, and for the remote replication relationship within the cluster, the value of Z is zero.
3. The method for dynamically allocating communication links according to claim 1, characterized in that: When establishing a remote replication consistency group within a cluster or between clusters, allocating a communication link to the remote replication consistency group from all communication links of the cluster includes: When establishing a remote replication consistency group within a cluster or between clusters, the communication link numbers assigned to the primary and secondary ends of the remote replication consistency group from all communication links in the cluster are equal to (G 主 +G 辅 )% X + X×Z, allocating a communication link to the remote replication consistency group; Among them, G 主 It represents the remote replication consistency group number of the primary end in the remote replication consistency group; G 辅 It represents the remote replication consistency group number of the secondary end in the remote replication consistency group; X is a preset positive integer, % X represents the modulo X, and Z represents the sorting number of the peer cluster in the partnership of the local cluster, and for the remote replication consistency group within the cluster, the value of Z is zero.
4. The method for dynamically allocating communication links according to claim 3, characterized in that: Also includes: The communication link number assigned by the secondary end of the remote replication consistency group is recorded to the primary end of the remote replication consistency group, and the communication link number assigned by the primary end of the remote replication consistency group is recorded to the secondary end of the remote replication consistency group.
5. The method for dynamically allocating communication links according to claim 1, characterized in that: Also includes: The connection status of each of the communication links is monitored, and when the connection status of any of the communication links is detected to be abnormal, an abnormality handling operation is performed.
6. The method for dynamically allocating communication links according to any one of claims 1 to 5, characterized in that: For each group of the communication links, according to the principle of load balancing, the remote replication relationship and / or remote replication consistency group of one or more of the communication links in the group is moved to other communication links in the group, including: For each group of the communication links, determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+a)%Y-th communication link in the group; If it is greater than K times the current average load of the (i+a)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+a)%Yth communication link; wherein a is a positive integer, Y is the total number of communication links in the group, % Y represents the modulo of Y, and K is a preset value greater than 1; the load of the communication link includes the remote replication relationship and remote replication consistency group of the communication link; Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+b)%Y-th communication link in the group; If it is greater than K times the current average load of the (i+b)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+b)%Yth communication link; where b is a positive integer and b≠a; Determine whether the current average load of the i-th communication link in the group is greater than K times the current average load of the (i+c)%Y-th communication link in the group; If it is greater than K times the current average load of the (i+c)%Yth communication link in the group, part of the load of the i-th communication link is moved to the (i+c)%Yth communication link; where c is a positive integer and b≠a≠c; After i changes from 0 to Y-1 in sequence, the load balancing of the communication links in this group is completed.
7. The method for dynamically allocating communication links according to claim 6, characterized in that: Moving part of the load of the i-th communication link to the (i+a)%Y-th communication link includes: Move 1 / M of the load on the i-th communication link to the (i+a)%Y-th communication link, where M is a positive integer greater than 1.
8. A dynamic allocation system for communication links, characterized in that: include: A first communication link allocation module, configured to allocate a communication link to a remote replication relationship within a cluster or between clusters when the remote replication relationship is established; A second communication link allocation module, configured to allocate a communication link to a remote replication consistency group when establishing a remote replication consistency group within a cluster or between clusters; A load state determination module, used for dividing all the communication links into N groups, and for each group of the communication links, determining a load state of each of the communication links in the group; N is a positive integer not less than 2; The communication link adjustment module is used to move the remote replication relationship and / or remote replication consistency group of one or more of the communication links in each group of the communication links to other communication links in the group according to the load balancing principle.
9. A device for dynamically allocating communication links, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method for dynamically allocating communication links according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for dynamically allocating communication links according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
High-availability load balancing method and system and computer readable storage medium
CA3131098A1
Dynamic load balancing for layer-2 link aggregation
CN101682442A
Multi-cluster server dynamic allocation method and multi-cluster server dynamic allocation system
CN109451056A
Test method, test device and test equipment for remote replication consistency group
CN111159024A
Multi-cluster dynamic expansion method and system based on EMQ X
CN114615277A