CN111835805B - Method and system for configuring dpvs multi-tenant - Google Patents

Method and system for configuring dpvs multi-tenant Download PDF

Info

Publication number
CN111835805B
CN111835805B CN201910319614.9A CN201910319614A CN111835805B CN 111835805 B CN111835805 B CN 111835805B CN 201910319614 A CN201910319614 A CN 201910319614A CN 111835805 B CN111835805 B CN 111835805B
Authority
CN
China
Prior art keywords
vrrp
slave
configuration file
instance
tenant
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910319614.9A
Other languages
Chinese (zh)
Other versions
CN111835805A (en
Inventor
谢清峰
范少卓
曹志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Wangsu Co Ltd
Original Assignee
Xiamen Wangsu Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Wangsu Co Ltd filed Critical Xiamen Wangsu Co Ltd
Priority to CN201910319614.9A priority Critical patent/CN111835805B/en
Publication of CN111835805A publication Critical patent/CN111835805A/en
Application granted granted Critical
Publication of CN111835805B publication Critical patent/CN111835805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers

Abstract

The invention discloses a dpvs multi-tenant configuration method and a dpvs multi-tenant configuration system, wherein the method comprises the following steps: creating a configuration file for the current equipment, wherein the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identifier of the target vrrp instance; analyzing the configuration file to obtain tenant information of the tenants contained in the target vrrp instance, and storing the tenant information into a structural body of the target vrrp instance; and configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure. According to the technical scheme provided by the application, the dpvs can create as many tenants as possible by using the limited virtual route identifiers, and the configuration files of the physical equipment are simplified.

Description

Method and system for configuring dpvs multi-tenant
Technical Field
The invention relates to the technical field of Internet, in particular to a dpvs multi-tenant configuration method and system.
Background
With the continuous development of internet technology, the data to be processed in the network is increasing. In order to improve the utilization rate of network resources and enable the network resources to have flexible expandability and manageability, a plurality of mutually isolated closed tenants can be deployed in one network device through a virtualization technology. Meanwhile, the high availability of the closed tenants can be realized through the keepalived technology.
For the current fourth-layer load balancer dpvs, if multiple tenants are isolated on the same physical device, when the keepalived module achieves high availability for each tenant, each tenant needs to correspond to an independent vrrp (Virtual Router Redundancy Protocol) instance. Since each vrrp instance often needs to have an independent virtual routing identifier, the number of virtual routing identifiers supported by the keepalived module is usually limited, and thus the number of tenants supported by dpvs is also quite limited. In addition, in the configuration file of the physical device, each vrrp instance needs to note its own detailed information, and as the vrrp instances are in one-to-one correspondence with tenants, each tenant is added with one more detailed information of an instance in the configuration file of the physical device, so that the configuration file is excessively long and inconvenient to maintain.
Disclosure of Invention
The application aims to provide a dpvs multi-tenant configuration method and a dpvs multi-tenant configuration system, which can enable dpvs to create as many tenants as possible by using limited virtual route identifiers, and simplify configuration files of physical equipment.
In order to achieve the above object, an aspect of the present application provides a dpvs multi-tenant configuration method, where the method includes: creating a configuration file for the current equipment, wherein the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance; analyzing the configuration file to obtain tenant information of the multiple tenants contained in the target vrrp instance, and storing the tenant information into a structural body of the target vrrp instance; and configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure.
In order to achieve the above object, another aspect of the present application further provides a dpvs multi-tenant configuration system, where the system includes: the device comprises a configuration file creating unit, a configuration file creating unit and a configuration file processing unit, wherein the configuration file creating unit is used for creating a configuration file for current equipment, and the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance; the configuration file analyzing unit is used for analyzing the configuration file to obtain tenant information of the multiple tenants contained in the target vrrp instance and storing the tenant information into a structural body of the target vrrp instance; and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure.
In order to achieve the above object, another aspect of the present application further provides a dpvs multi-tenant configuration method, where the method is applied to a master device and a slave device of the master device, and the method includes: respectively creating a master configuration file and a slave configuration file of the master device and the slave device, wherein the master configuration file comprises a first vrrp instance, the slave configuration file comprises a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants; respectively analyzing the master configuration file and the slave configuration file to obtain tenant information of the at least two tenants contained in the first vrrp instance and the second vrrp instance, and storing the tenant information contained in the first vrrp instance and the second vrrp instance into a structure body of a corresponding instance; configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
In order to achieve the above object, another aspect of the present application further provides a dpvs multi-tenant configuration system, where the dpvs multi-tenant configuration system is applied to a master device and a slave device of the master device, and the system includes: a configuration file creating unit, configured to create a master configuration file and a slave configuration file of the master device and the slave device, respectively, where the master configuration file includes a first vrrp instance, the slave configuration file includes a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants; a configuration file analyzing unit, configured to analyze the master configuration file and the slave configuration file, respectively, to obtain tenant information of the at least two tenants included in the first vrrp instance and the second vrrp instance, and store the tenant information included in the first vrrp instance and the second vrrp instance in a structure of a corresponding instance; and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
As can be seen from the above, according to the technical scheme provided by the present application, when a configuration file is created for a current device, for a target vrrp instance, tenant information of multiple tenants can be specified in the target vrrp instance, so that the target vrrp instance can simultaneously correspond to multiple tenants. The multiple tenants may share the virtual route identification of the target vrrp instance. After the configuration file is created, the keepalived module may parse the configuration file, so as to obtain tenant information including the tenants in the target vrrp instance. In order to enable the target vrrp instance to simultaneously support multiple tenants, the tenant information obtained through analysis may be saved in a structural body of the target vrrp instance. In this way, the dpvs system can acquire tenant information of multiple tenants contained in the target vrrp instance by analyzing the structural body of the target vrrp instance, so that the corresponding multiple dpvs tenants can be configured in the current device smoothly. Since tenant information of multiple tenants can be noted in the same target vrrp instance, redundant information in the configuration file can be reduced. In addition, as a plurality of tenants can share the same virtual route identifier, under the condition that the number of the virtual route identifiers is kept unchanged, more tenants can be supported compared with the prior art. In addition, for a scenario of the master device and the slave device, the master device needs to multicast a vrrp message to the slave device, where the vrrp message corresponds to a vrrp instance one to one. In the prior art, since one tenant corresponds to one vrrp instance, excessive vrrp messages exist between a master device and a slave device. According to the technical scheme provided by the application, as a plurality of tenants correspond to the same vrrp instance, the plurality of tenants only correspond to one vrrp message, and the number of the vrrp messages sent between the master device and the slave device is greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a dpvs multi-tenant configuration method in an embodiment of the present invention;
fig. 2 is a schematic diagram of an example of a target vrrp in an embodiment of the invention;
FIG. 3 is a diagram illustrating an example mapping relationship between a current device and a slave device according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an example mapping relationship between a current device and a plurality of slave devices according to an embodiment of the present invention;
FIG. 5 is a functional block diagram of a dpvs multi-tenant configuration system in an embodiment of the invention;
FIG. 6 is a flow chart of a dpvs multi-tenant configuration method in another embodiment of the invention;
fig. 7 is a schematic configuration flow diagram of a master device and a slave device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The application provides a dpvs multi-tenant configuration method which can be applied to each load balancing device configured with a dpvs mechanism. In practical applications, in order to ensure the stability of the load balancing system, a master device and a slave device having a load balancing function are usually deployed in the system, and when the master device is abnormal, the slave device may be switched to the master device to continue to provide corresponding services. After network isolation is realized at dpvs, a plurality of tenants isolated from each other can be deployed in each load balancing device, and different tenants can independently provide respective services. In order to manage these tenants and achieve high availability of these tenants, a keepalived module is usually introduced into the dpvs architecture. The dpvs multi-tenant configuration method provided by the application can be applied to the keepalived module. Specifically, referring to fig. 1, the method may include the following steps.
S11: creating a configuration file for the current equipment, wherein the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance.
In this embodiment, the current device may be the master device described above, or may be a slave device corresponding to the master device. The Keepalived module may create a configuration file for the current device, where the configuration file may include a plurality of portions of information. For example, a global definition block may be included in the configuration file, which may be used to specify to which mailbox address failure information should be sent when a failure occurs, and may also be used to define the identity of the load balancer. In addition, a vrrp _ sync _ group block may be further included in the configuration file, and in this block, each routing instance included in failover (failover) may be determined, and a script that needs to be executed when a failover is performed to a master device or a slave device may be specified. Furthermore, the configuration file may further include information of vrrp _ instance (vrrp instance). In the vrrp instance, a series of data such as tenant information, device state identifier, bound network card, address for sending multicast packet, priority identifier, authentication information and the like corresponding to the vrrp instance may be noted. In the prior art, only tenant information of one tenant can be contained in one vrrp instance, whereas in the present embodiment, tenant information of multiple tenants can be written in one vrrp instance. Thus, one vrrp instance can correspond to multiple tenants. Specifically, referring to fig. 2, it is assumed that a target vrrp instance corresponding to multiple tenants is included in the configuration file of the current device, in the target vrrp instance, a virtual _ route _ id (virtual _ route _ id) corresponding to the instance may be noted, and a tenant name of each tenant corresponding to the instance may be noted. For example, in fig. 2, the virtual route of the target vrrp instance is identified as 50, and the instance corresponds to four tenants with tenant names user1, user2, user3, and user 4. Of course, fig. 2 is only a simplified illustration of the information contained in the target vrrp example, and in practical applications, the target vrrp example may also contain richer information. As can be seen from the above, the multiple tenants corresponding to the target vrrp instance may share the virtual route identifier of the target vrrp instance. Therefore, under the condition that the number of the virtual routing identifiers is kept unchanged, compared with the prior art, the number of the tenants corresponding to the virtual routing identifiers can be greatly increased after the configuration file is improved.
In one embodiment, more than two vrrp instances may be included in the configuration file. In order to make the different vrrp instances not affect each other, it may be specified that, for the different vrrp instances in the same configuration file, their respective virtual routing identifications are different from each other.
S13: analyzing the configuration file to obtain tenant information of the multiple tenants contained in the target vrrp instance, and storing the tenant information into a structural body of the target vrrp instance.
In this embodiment, after the configuration file is improved to enable one vrrp instance to correspond to multiple tenants, in order to enable the current device to normally configure a dpvs tenant according to the improved configuration file, corresponding improvement needs to be performed on a code level.
Specifically, at the code level, each item of information included in the vrrp instance may be stored in a structure body corresponding to the instance. The structure may be a data structure, and the structure may be composed of various elements, and the elements constituting the structure may be members of the structure, wherein different members may implement different functions. For example, for tenant members in the structure, tenant information contained in the vrrp instance may be recorded. In the prior art, tenant members in a structure corresponding to a vrrp instance are usually of a pointer type, and tenant information of only one tenant is often written. In order to enable tenant information of multiple tenants to be written into a structure of one vrrp instance at the same time, the types of tenant members in the structure need to be improved. Specifically, a tenant member used for recording tenant information may be determined in the structural body of the target vrrp instance, and the type of the tenant member may be modified into a linked list type. In this way, the tenant member of the linked list type can store the tenant information of a plurality of different tenants.
In this embodiment, after the types of tenant members in the structure are improved in advance, the keepalived module may analyze the configuration file, so as to extract tenant information of the multiple tenants included in the target vrrp instance, and further determine the structure corresponding to the target vrrp instance in a code level, so as to store the tenant information of the multiple tenants into the tenant members with improved types in the structure.
S15: and configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure body.
In this embodiment, after configuring each item of information in the structure of the target vrrp instance, the tenant information of the multiple tenants in the structure may be transmitted to the dpvs module, so that the corresponding multiple dpvs tenants are configured in the current device through the dpvs module. Therefore, the current device can have a plurality of dpvs tenants isolated by the network, and the tenants occupy less virtual route identifiers compared with the prior art. In addition, since tenant information of multiple tenants can be noted in the same vrrp instance, and a vrrp instance does not need to be created for each tenant, redundant information in the configuration file can be reduced.
In one embodiment, if the current device is a master device and the current device has a corresponding slave device, in order to maintain consistency between contents in the master device and the slave device, a slave configuration file of the slave device may be created as follows.
Referring to fig. 3, in this embodiment, the configuration file of the current device may include a target vrrp instance, and the target vrrp instance should also have corresponding backup content in the slave device, so that when creating the slave configuration file for the slave device, a slave vrrp instance of the target vrrp instance may be established in the slave configuration file. That is, the target vrrp instance corresponding to the current device and the slave vrrp instance corresponding to the slave device should also have a master-slave relationship. In order to guarantee such a master-slave relationship, the target vrrp instance and the slave vrrp instance need to have the same virtual routing identity, and the slave vrrp instance and the target vrrp instance need to correspond to the same tenant, that is, the slave vrrp instance also corresponds to the above-mentioned multiple tenants. As shown in fig. 3, the virtual route identifier of the target vrrp instance is 50, and includes four tenants with tenant names user1, user2, user3, and user4, then in the slave vrrp instance, the virtual route identifier should also be 50, and should also include four tenants with tenant names user1, user2, user3, and user 4. Therefore, in the configuration files of the master device and the slave device, which two vrrp instances have the master-slave relationship can be judged through the virtual routing identification, and meanwhile, the vrrp instances having the master-slave relationship can be ensured to correspond to the same tenant.
It should be noted that, in practical applications, the configuration file of the master device may include multiple vrrp instances, and the slave vrrp instances corresponding to the vrrp instances are not necessarily all concentrated in the same slave device. Referring to fig. 4, the configuration file of the master device includes vrrp instance 1 and vrrp instance 2, and the master device has two slave devices (slave device 1 and slave device 2), in this case, a slave vrrp instance (vrrp instance 11) corresponding to vrrp instance 1 may be in the configuration file of slave device 1, and a slave vrrp instance (vrrp instance 21) corresponding to vrrp instance 2 may be in the configuration file of slave device 2.
In this embodiment, when creating the configuration file of the current device and the slave configuration file of the slave device, in order to distinguish the master device from the slave device, the device state identifier in the configuration file of the current device may be set as a master device identifier, and the device state identifier in the slave configuration file may be set as a slave device identifier. For example, the device status identifier may be a parameter named state, the MASTER device identifier may be MASTER, and the slave device identifier may be BACKUP, so that "state" is noted in the configuration file of the current device, and "state" is noted in the slave configuration file of the slave device.
In addition, the priority identifiers in the configuration file of the current device and the slave configuration file can be assigned with values respectively. The priority identification may be, for example, a parameter named priority, which may be assigned a value within a specified range, the size of the value may characterize the high level of priority. Usually, the priority of the master device is higher than that of the slave device, and therefore, the value corresponding to the priority identifier in the configuration file of the current device should be greater than the value corresponding to the priority identifier in the slave configuration file.
In this embodiment, after the slave configuration file is created for the slave device, the slave configuration file may be parsed according to a similar processing method for the configuration file of the current device, so as to obtain tenant information of the multiple tenants included in the slave vrrp instance, and the tenant information is stored in the structural body of the slave vrrp instance. Corresponding dpvs tenants may then be configured in the slave device based on the tenant information in the fabric of slave vrrp instances. In this way, a corresponding plurality of dpvs tenants may also be configured in the slave device.
In one embodiment, after the corresponding dpvs tenants are configured in both the master device and the slave device, the master device may provide services to the user, and the slave device may maintain synchronization with data in the master device. Specifically, the current device serves as a master device, a Virtual IP (VIP) address may be configured for the current device, and multiple dpvs tenants in the current device may use the Virtual IP address as a default IP address. That is, the plurality of dpvs tenants can each receive and transmit data through the virtual IP address. In addition, when the master device and the slave devices operate normally, the master device generally needs to multicast a message to each corresponding slave device, so that each slave device knows that the current master device is in a normal operating state. In this way, the current device may send a vrrp message to the slave device according to a specified time period. Specifically, the current device may send a respective vrrp packet for each vrrp instance. For example, assuming that the current device has 3 vrrp instances configured in total, three vrrp messages need to be sent out simultaneously when multicasting the message. In order to enable the slave device to distinguish whether the received vrrp message is a vrrp message corresponding to its slave vrrp instance, the current device needs to add a virtual route identifier of the corresponding vrrp instance in the transmitted vrrp message. Therefore, the vrrp message corresponding to the target vrrp instance at least includes the virtual route identifier of the target vrrp instance. Certainly, in practical application, the vrrp message may further include more information such as a priority identifier, authentication information, and a source IP.
In this embodiment, after receiving the vrrp message multicast by the master device, the slave device may analyze the content of each vrrp message, and determine whether the vrrp message includes a virtual routing identifier corresponding to its own slave vrrp instance. If the message contains the vrrp message, the message indicates that the currently analyzed vrrp message is sent to the message, and if the message does not contain the vrrp message, the message indicates that the currently analyzed vrrp message is sent to other slave devices.
In this embodiment, for the target vrrp example, if the slave device does not receive the vrrp packet containing the virtual routing identifier sent by the current device within a specified time, it indicates that the master device is currently abnormal, and the vrrp packet is not sent in time. At this time, in order to ensure the stability of the service, the slave device needs to be switched to a master device, and the switched master device provides the service for the plurality of dpvs tenants. Specifically, when the slave device is switched to the master device, the state of the slave vrrp instance corresponding to the slave device in the keepalived process may be switched to the master state, and a virtual IP address may be configured for the slave device. Of course, in practical application, the priority identifier in the slave configuration file may also be assigned a higher value, so that the reassigned value is higher than the corresponding values of other slave devices. For example, in practical applications, the adjusted value may be 50 higher than the value of the priority identifier of other slave devices. After the slave device is switched to the master device, the switched master device may also send the vrrp message including the virtual routing identifier to other corresponding slave devices according to the specified time period.
As can be seen from the above, for a master device, each vrrp instance needs to send one vrrp packet, and in the prior art, one tenant needs to correspond to one independent vrrp instance, which makes the number of vrrp packets sent between the master device and a slave device quite large. After the scheme of the application is improved, the number of vrrp messages sent between the master device and the slave device can be greatly reduced.
Referring to fig. 5, the present application further provides a dpvs multi-tenant configuration system, where the system includes:
the device comprises a configuration file creating unit, a configuration file creating unit and a configuration file processing unit, wherein the configuration file creating unit is used for creating a configuration file for current equipment, and the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance;
a configuration file analyzing unit, configured to analyze the configuration file to obtain tenant information of the multiple tenants included in the target vrrp instance, and store the tenant information into a structural body of the target vrrp instance;
and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure body.
It should be noted that, for specific functions implemented by each unit module in the system, reference may be made to the description in the foregoing method embodiment, and technical effects corresponding to the foregoing method embodiment may be implemented, which is not described herein again.
The application also provides a dpvs multi-tenant configuration method, which can be applied to the master device and the slave device of the master device. Referring to fig. 6 and 7, the method may include the following steps.
S21: respectively creating a master configuration file and a slave configuration file of the master device and the slave device, wherein the master configuration file comprises a first vrrp instance, the slave configuration file comprises a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants;
s23: respectively analyzing the master configuration file and the slave configuration file to obtain tenant information of the at least two tenants contained in the first vrrp instance and the second vrrp instance, and storing the tenant information contained in the first vrrp instance and the second vrrp instance into a structure body of a corresponding instance;
s25: configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
In one embodiment, after creating the master configuration file and the slave configuration file, the method further comprises:
setting the equipment state identifier in the master configuration file as a master equipment identifier, and setting the equipment state identifier in the slave configuration file as a slave equipment identifier;
assigning values to the priority identifiers in the master configuration file and the slave configuration file respectively, wherein the numerical value corresponding to the priority identifier in the master configuration file is greater than the numerical value corresponding to the priority identifier in the slave configuration file.
In one embodiment, the method further comprises:
when the main configuration file comprises at least two vrrp instances, the virtual routing identifications corresponding to the at least two vrrp instances are different from each other.
In one embodiment, the storing the tenant information included in each of the first vrrp instance and the second vrrp instance into the structure body of the corresponding instance includes:
respectively determining tenant members used for recording tenant information in the structural bodies of the first vrrp instance and the second vrrp instance, and modifying the types of the tenant members into linked list types;
and storing the analyzed tenant information of the at least two tenants into the tenant member modified into the linked list type.
In one embodiment, the method further comprises:
configuring a virtual IP address for the master device, and sending a vrrp message to the slave device through the master device according to a specified time period; the virtual IP addresses are used as default IP addresses by a plurality of dpvs leasers in the main equipment, and the vrrp message at least comprises the virtual routing identification of the first vrrp instance;
if the slave device does not receive the vrrp message which is sent by the master device and contains the virtual routing identifier within a specified time length, the slave device is switched to the master device, and the switched master device provides services for the plurality of dpvs tenants; and the switched master equipment sends the vrrp message containing the virtual routing identifier to other corresponding slave equipment according to the specified time period.
The application also provides a dpvs multi-tenant configuration system, which is applied to a master device and a slave device of the master device, and the system comprises:
a configuration file creating unit, configured to create a master configuration file and a slave configuration file of the master device and the slave device, respectively, where the master configuration file includes a first vrrp instance, the slave configuration file includes a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants;
a configuration file analyzing unit, configured to analyze the master configuration file and the slave configuration file, respectively, to obtain tenant information of the at least two tenants included in the first vrrp instance and the second vrrp instance, and store the tenant information included in the first vrrp instance and the second vrrp instance in a structure of a corresponding instance;
and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
It should be noted that, for a specific implementation manner of the foregoing embodiment, reference may be made to the relevant description of steps S11 to S15, and the technical effects corresponding to steps S11 to S15 may be achieved, which is not described herein again.
As can be seen from the above, according to the technical scheme provided by the present application, when a configuration file is created for a current device, for a target vrrp instance, tenant information of multiple tenants can be specified in the target vrrp instance, so that the target vrrp instance can simultaneously correspond to multiple tenants. The multiple tenants may share the virtual route identity of the target vrrp instance. After the configuration file is created, the keepalived module may parse the configuration file, so as to obtain tenant information including the tenants in the target vrrp instance. In order to enable the target vrrp instance to simultaneously support multiple tenants, the tenant information obtained through analysis may be saved in a structural body of the target vrrp instance. In this way, the dpvs system can acquire tenant information of multiple tenants contained in the target vrrp instance by analyzing the structural body of the target vrrp instance, so that the corresponding multiple dpvs tenants can be configured in the current device smoothly. Since tenant information of multiple tenants can be noted in the same target vrrp instance, redundant information in the configuration file can be reduced. In addition, as a plurality of tenants can share the same virtual route identifier, under the condition that the number of the virtual route identifiers is kept unchanged, more tenants can be supported compared with the prior art. In addition, for the scenarios of the master device and the slave device, the master device needs to multicast a vrrp message to the slave device, where the vrrp message corresponds to the vrrp instance one to one. In the prior art, since one tenant corresponds to one vrrp instance, excessive vrrp messages exist between a master device and a slave device. According to the technical scheme provided by the application, as a plurality of tenants correspond to the same vrrp instance, the plurality of tenants only correspond to one vrrp message, and the number of the vrrp messages sent between the master device and the slave device is greatly reduced.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (14)

1. A dpvs multi-tenant configuration method is characterized by comprising the following steps:
creating a configuration file for the current equipment, wherein the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance;
analyzing the configuration file to obtain tenant information of the multiple tenants contained in the target vrrp instance, and storing the tenant information into a structural body of the target vrrp instance; wherein saving the tenant information to the structural body of the target vrrp instance comprises: determining a tenant member used for recording tenant information in the structural body of the target vrrp instance, and modifying the type of the tenant member into a linked list type; storing the analyzed tenant information of the plurality of tenants into a tenant member modified into a linked list type;
and configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure.
2. The method of claim 1, further comprising:
if the configuration file comprises at least two vrrp instances, the virtual routing identifications corresponding to the at least two vrrp instances are different from each other.
3. The method of claim 1, wherein the current device is provided with a corresponding slave device; accordingly, the method further comprises:
creating a slave configuration file for the slave device, and establishing a slave vrrp instance of the target vrrp instance in the slave configuration file; wherein the target vrrp instance and the slave vrrp instance have the same virtual route identification, and the slave vrrp instance corresponds to the plurality of tenants.
4. The method of claim 3, wherein after creating the slave configuration file for the slave device, the method further comprises:
setting the equipment state identifier in the configuration file of the current equipment as a master equipment identifier, and setting the equipment state identifier in the slave configuration file as a slave equipment identifier;
assigning values to priority identifiers in the configuration file of the current device and the slave configuration file respectively, wherein the numerical value corresponding to the priority identifier in the configuration file of the current device is larger than the numerical value corresponding to the priority identifier in the slave configuration file.
5. The method of claim 3, wherein after creating the slave configuration file for the slave device, the method further comprises:
analyzing the slave configuration file to obtain tenant information of the multiple tenants contained in the slave vrrp instance, and storing the tenant information into a structural body of the slave vrrp instance;
configuring a corresponding plurality of dpvs tenants in the slave device based on the tenant information in the fabric of slave vrrp instances.
6. The method of claim 3, further comprising:
configuring a virtual IP address for the current equipment, and sending a vrrp message to the slave equipment through the current equipment according to a specified time period; and the virtual IP addresses are used as default IP addresses by a plurality of dpvs tenants in the current equipment, and the vrrp message at least comprises the virtual route identification of the target vrrp instance.
7. The method of claim 6, further comprising:
if the slave device does not receive the vrrp message which is sent by the current device and contains the virtual routing identifier within a specified time length, the slave device is switched to be a master device, and the switched master device provides services for the multiple dpvs tenants; and the switched master equipment sends the vrrp message containing the virtual routing identifier to other corresponding slave equipment according to the specified time period.
8. The method of claim 7, wherein switching the slave device to a master device comprises:
and switching the state of the slave vrrp instance corresponding to the slave device in the keepalive process into a master state, and configuring a virtual IP address for the slave device.
9. A dpvs multi-tenant configuration system, characterized in that the system comprises:
the device comprises a configuration file creating unit, a configuration file generating unit and a configuration file transmitting unit, wherein the configuration file creating unit is used for creating a configuration file for current equipment, and the configuration file comprises target vrrp instances corresponding to a plurality of tenants; wherein the plurality of tenants share the virtual route identification of the target vrrp instance;
a configuration file analyzing unit, configured to analyze the configuration file to obtain tenant information of the multiple tenants included in the target vrrp instance, and store the tenant information into a structural body of the target vrrp instance; wherein saving the tenant information to the structural body of the target vrrp instance comprises: determining a tenant member used for recording tenant information in the structural body of the target vrrp instance, and modifying the type of the tenant member into a linked list type; storing the analyzed tenant information of the plurality of tenants into a tenant member modified into a linked list type;
and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the current equipment based on the tenant information in the structure.
10. A dpvs multi-tenant configuration method is applied to a master device and a slave device of the master device, and the method comprises the following steps:
respectively creating a master configuration file and a slave configuration file of the master device and the slave device, wherein the master configuration file comprises a first vrrp instance, the slave configuration file comprises a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants;
analyzing the master configuration file and the slave configuration file respectively to obtain the tenant information of the at least two tenants contained in the first vrrp instance and the second vrrp instance respectively, and storing the tenant information contained in the first vrrp instance and the second vrrp instance into a structure body of a corresponding instance; wherein storing the tenant information included in each of the first vrrp instance and the second vrrp instance into a structure body of a corresponding instance comprises: respectively determining tenant members used for recording tenant information in the structural bodies of the first vrrp instance and the second vrrp instance, and modifying the types of the tenant members into linked list types; storing the analyzed tenant information of the at least two tenants into a tenant member modified into a linked list type;
configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on the tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
11. The method of claim 10, wherein after creating the master profile and the slave profile, the method further comprises:
setting the equipment state identifier in the master configuration file as a master equipment identifier, and setting the equipment state identifier in the slave configuration file as a slave equipment identifier;
assigning values to priority identifications in the master configuration file and the slave configuration file respectively, wherein the numerical value corresponding to the priority identification in the master configuration file is larger than the numerical value corresponding to the priority identification in the slave configuration file.
12. The method of claim 10, further comprising:
when the main configuration file comprises at least two vrrp instances, the virtual routing identifications corresponding to the at least two vrrp instances are different from each other.
13. The method of claim 10, further comprising:
configuring a virtual IP address for the master device, and sending a vrrp message to the slave device through the master device according to a specified time period; the virtual IP addresses are used as default IP addresses by a plurality of dpvs leasers in the main equipment, and the vrrp message at least comprises the virtual routing identification of the first vrrp instance;
if the slave device does not receive the vrrp message which is sent by the master device and contains the virtual routing identifier within a specified time length, the slave device is switched to the master device, and the switched master device provides services for the plurality of dpvs tenants; and the switched master equipment sends the vrrp message containing the virtual routing identifier to other corresponding slave equipment according to the specified time period.
14. A dpvs multi-tenant configuration system, which is applied to a master device and a slave device of the master device, and comprises:
a configuration file creating unit, configured to create a master configuration file and a slave configuration file of the master device and the slave device, respectively, where the master configuration file includes a first vrrp instance, the slave configuration file includes a second vrrp instance, and the first vrrp instance and the second vrrp instance have a master-slave relationship; wherein the first vrrp instance and the second vrrp instance in master-slave relationship both correspond to the same at least two tenants;
a configuration file analyzing unit, configured to analyze the master configuration file and the slave configuration file, respectively, to obtain tenant information of the at least two tenants included in the first vrrp instance and the second vrrp instance, and store the tenant information included in the first vrrp instance and the second vrrp instance in a structure of a corresponding instance; wherein storing the tenant information included in each of the first vrrp instance and the second vrrp instance into a structure body of a corresponding instance comprises: respectively determining tenant members used for recording tenant information in the structural bodies of the first vrrp instance and the second vrrp instance, and modifying the types of the tenant members into linked list types; storing the analyzed tenant information of the at least two tenants into a tenant member modified into a linked list type;
and the tenant configuration unit is used for configuring a plurality of corresponding dpvs tenants in the master device and the slave device respectively based on tenant information in the respective structures of the first vrrp instance and the second vrrp instance.
CN201910319614.9A 2019-04-19 2019-04-19 Method and system for configuring dpvs multi-tenant Active CN111835805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910319614.9A CN111835805B (en) 2019-04-19 2019-04-19 Method and system for configuring dpvs multi-tenant

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910319614.9A CN111835805B (en) 2019-04-19 2019-04-19 Method and system for configuring dpvs multi-tenant

Publications (2)

Publication Number Publication Date
CN111835805A CN111835805A (en) 2020-10-27
CN111835805B true CN111835805B (en) 2022-09-16

Family

ID=72911431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910319614.9A Active CN111835805B (en) 2019-04-19 2019-04-19 Method and system for configuring dpvs multi-tenant

Country Status (1)

Country Link
CN (1) CN111835805B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915580A (en) * 2016-02-23 2016-08-31 上海电机学院 Information software leasing platform and realization method thereof
CN106529331A (en) * 2016-10-31 2017-03-22 用友网络科技股份有限公司 Multi-tenant data isolation scheme applied to PaaS (Platform-as-a-Service) platform
CN108200018A (en) * 2017-12-20 2018-06-22 北京百度网讯科技有限公司 Flow forwarding method and equipment, computer equipment and readable medium in cloud computing

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476760B2 (en) * 2013-10-30 2019-11-12 Oracle International Corporation System and method for placement logic in a cloud platform environment
US9954936B2 (en) * 2015-03-02 2018-04-24 International Business Machines Corporation Migrating legacy applications to a multi-tenant computing environment
US10740112B2 (en) * 2017-09-30 2020-08-11 Oracle International Corporation Leveraging microservice containers to provide tenant isolation in a multi-tenant API gateway

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915580A (en) * 2016-02-23 2016-08-31 上海电机学院 Information software leasing platform and realization method thereof
CN106529331A (en) * 2016-10-31 2017-03-22 用友网络科技股份有限公司 Multi-tenant data isolation scheme applied to PaaS (Platform-as-a-Service) platform
CN108200018A (en) * 2017-12-20 2018-06-22 北京百度网讯科技有限公司 Flow forwarding method and equipment, computer equipment and readable medium in cloud computing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TenantCPUMan:基于负载分析的多租户动态CPU资源调整;何子龙等;《计算机应用与软件》;20161215(第12期);全文 *

Also Published As

Publication number Publication date
CN111835805A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN109618005B (en) Method for calling server and proxy server
CN110113441B (en) Computer equipment, system and method for realizing load balance
EP2993838B1 (en) Methods for setting a member identity of gateway device and corresponding management gateway devices
US9999030B2 (en) Resource provisioning method
US8842518B2 (en) System and method for supporting management network interface card port failover in a middleware machine environment
US7257817B2 (en) Virtual network with adaptive dispatcher
CN110635987B (en) Message transmission method, device, equipment and machine readable storage medium
EP2843906B1 (en) Method, apparatus, and system for data transmission
CN110474802B (en) Equipment switching method and device and service system
US10447652B2 (en) High availability bridging between layer 2 networks
US11824765B2 (en) Fast redirect of traffic when pods fail
CN112953982B (en) Service processing method, service configuration method and related device
CN111835685A (en) Method and server for monitoring running state of Nginx network isolation space
CN115086330A (en) Cross-cluster load balancing system
JP5828952B2 (en) Communication system, node, flow control network, and communication control method
CN111756780B (en) Method for synchronizing connection information and load balancing system
CN111835684B (en) Network isolation monitoring method and system for haproxy equipment
CN112583655B (en) Data transmission method and device, electronic equipment and readable storage medium
CN107483628B (en) DPDK-based one-way proxy method and system
JP5218323B2 (en) Information processing method and program related to relay device and transfer rule
CN106209634B (en) Learning method and device of address mapping relation
CN111835805B (en) Method and system for configuring dpvs multi-tenant
US20160212083A9 (en) Connection sharing across entities in a distributed messaging system
CN111385324A (en) Data communication method, device, equipment and storage medium
CN113141400B (en) Network service access method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant