Main/standby switching management method, device, equipment and machine readable storage medium

文档序号:1965837 发布日期:2021-12-14 浏览:8次 中文

阅读说明:本技术 一种主备切换管理方法、装置、设备及机器可读存储介质 (Main/standby switching management method, device, equipment and machine readable storage medium ) 是由 胡倩倩 吴四茜 于 2021-08-27 设计创作,主要内容包括:本公开提供一种主备切换管理方法、装置、设备及机器可读存储介质,该方法包括:分别获取主网络设备、备网络设备的当前链路状态;根据主网络设备、备网络设备的当前链路状态分别调整主网络设备、备网络设备的优先值;根据主网络设备、备网络设备的优先值确定新的主网络设备;所述主网络设备、备网络设备被配置有初始优先值,主网络设备的初始优先值高于备网络设备的初始优先值。通过本公开的技术方案,分别分析主备网络设备的各条链路状态,从而为主备网络设备分别评估一个优先值,根据优先值判断是否需要主备切换,从而避免在链路均存在部分故障时,使用了网络状态相对更差的设备作为主网络设备。(The present disclosure provides a method, an apparatus, a device and a machine-readable storage medium for master/slave switching management, wherein the method comprises: respectively acquiring current link states of a main network device and a standby network device; respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment; determining a new main network device according to the priority values of the main network device and the standby network device; the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device. According to the technical scheme, the states of all the links of the main and standby network devices are analyzed respectively, so that a priority value is evaluated for the main and standby network devices respectively, whether main and standby switching is needed or not is judged according to the priority value, and therefore the situation that when partial faults exist in all the links, devices with relatively worse network states are used as the main network devices is avoided.)

1. A master-slave switching management method is applied to a network management device, and comprises the following steps:

respectively acquiring current link states of a main network device and a standby network device;

respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment;

determining a new main network device according to the priority values of the main network device and the standby network device;

the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

2. The method of claim 1, wherein adjusting the priority values of the master network device and the standby network device according to the current link statuses of the master network device and the standby network device respectively comprises:

and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

3. The method of claim 1, wherein determining a new primary network device based on the priority values of the primary and standby network devices comprises:

and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

4. The method of claim 1, wherein adjusting the priority values of the master network device and the standby network device according to the current link statuses of the master network device and the standby network device respectively comprises:

and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

5. A master-slave switching management device is applied to a network management device, and comprises:

the link module is used for respectively acquiring the current link states of the main network equipment and the standby network equipment;

the adjusting module is used for respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment;

the switching module is used for determining a new main network device according to the priority values of the main network device and the standby network device;

the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

6. The apparatus of claim 5, wherein the adjusting the priority values of the master network device and the standby network device according to the current link statuses of the master network device and the standby network device respectively comprises:

and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

7. The apparatus of claim 5, wherein determining a new master network device according to the priority values of the master and standby network devices comprises:

and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

8. The apparatus of claim 5, wherein adjusting the priority values of the master network device and the standby network device according to the current link statuses of the master network device and the standby network device respectively comprises:

and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

9. An electronic device, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to perform the method of any one of claims 1 to 4.

10. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1-4.

Technical Field

The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a machine-readable storage medium for master/slave switching management.

Background

RBM (Remote Backup Management) provides a technique for backing up key configuration information and service table entries between devices. The method can realize the dual-computer hot standby function by matching with the VRRP technology, so as to ensure that the standby equipment can smoothly take over the main equipment to work when the main equipment in the network fails, and ensure the uninterrupted transmission of user service data.

VRRP (Virtual Router Redundancy Protocol) adds a group of gateway routers to a backup group to form a Virtual Router, where a Virtual address can be used as a gateway address, and the VRRP can still provide a high-reliability link when one of the routers fails to ensure that services in the network are normal. However, when a plurality of backup groups exist in the VRRP networking, when the states of the VRRP upstream or downstream faults are not synchronous, the master devices in the backup groups are inconsistent, and the problem of inconsistent states of the plurality of backup groups of the VRRP can be solved by controlling the VRRP through the RBM. When VRRP backup groups are created, all VRRP backup groups on equipment are associated with the RBM, the RBM monitors and manages the states of the VRRP backup groups through the control channel, and if the state of one of the VRRP backup groups changes, the RBM can control all the VRRP backup groups to uniformly switch the states, so that the consistency of the states of all the VRRP backup groups is ensured. The RBM and the VRRP are used in combination, so that the standby equipment can smoothly take over the main equipment to work when the main equipment in the network fails, the uninterrupted transmission of user service data is ensured, and the hot standby of the two machines is realized.

With the development of the technology, the user demand and the network operation quality are continuously improved, the VRRP + LB network is generated, and when two VRRP backup groups exist in a downlink, the technical problem that the main-standby switching process is unreasonable exists in the link switching at the moment.

Disclosure of Invention

In view of this, the present disclosure provides a method and an apparatus for master/slave switching management, an electronic device, and a machine-readable storage medium, so as to solve the problem that the master/slave switching process is unreasonable.

The specific technical scheme is as follows:

the present disclosure provides a master/standby switching management method, which is applied to a network management device, and the method includes: respectively acquiring current link states of a main network device and a standby network device; respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment; determining a new main network device according to the priority values of the main network device and the standby network device; the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

As a technical solution, the adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

As one technical solution, the determining a new master network device according to priority values of the master network device and the standby network device includes: and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

As a technical solution, respectively adjusting priority values of a main network device and a standby network device according to current link states of the main network device and the standby network device includes: and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

The present disclosure also provides a device for master/standby switching management, which is applied to a network management device, and the device includes: the link module is used for respectively acquiring the current link states of the main network equipment and the standby network equipment; the adjusting module is used for respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment; the switching module is used for determining a new main network device according to the priority values of the main network device and the standby network device; the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

As a technical solution, the adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

As one technical solution, the determining a new master network device according to priority values of the master network device and the standby network device includes: and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

As a technical solution, respectively adjusting priority values of a main network device and a standby network device according to current link states of the main network device and the standby network device includes: and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

The present disclosure also provides an electronic device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to implement the foregoing active/standby switching management method.

The present disclosure also provides a machine-readable storage medium storing machine-executable instructions, which when invoked and executed by a processor, cause the processor to implement the aforementioned active-standby switching management method.

The technical scheme provided by the disclosure at least brings the following beneficial effects:

the states of all links of the main and standby network devices are analyzed respectively, so that a priority value is evaluated for the main and standby network devices respectively, whether main and standby switching is needed or not is judged according to the priority value, and therefore the situation that when partial faults exist in all the links, the devices with relatively worse network states are used as the main network devices is avoided.

Drawings

In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present disclosure or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present disclosure.

Fig. 1 is a flowchart of a main/standby switching management method according to an embodiment of the present disclosure;

fig. 2 is a structural diagram of a main/standby switching management apparatus according to an embodiment of the present disclosure;

FIG. 3 is a hardware block diagram of an electronic device in one embodiment of the disclosure;

FIG. 4 is a schematic diagram of networking in one embodiment.

Detailed Description

The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information in the embodiments of the present disclosure, such information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".

As in fig. 4, FW1 is configured as primary by default and FW2 is configured as backup by default.

When RBM configuration is not switched back by default, FW2 is standby equipment, one link (B2 or C2) Down is in a FW2 interface downlink, all downlink ports (A1, B1 and C1) in a FW1 interface uplink and downlink are Down, the link is not switched between FW2 and backup up (all links of the standby equipment FW2 are required to be switched to be main normally), but the uplink and the downlink of the FW2 equipment have available links, and the problem of unreasonable main-standby switching exists at this moment.

If one downlink of FW2 recovers UP, then FW2 is switched to be the main; then the A1 and B1 (or C1) links of the FW1 recover UP, and the FW2 is also a master; at this time, all links of the FW2 fail Down (a2, B2 and C2), and at this time, the FW1 is still standby, the FW1 is switched to be the main link until all links of the FW1 recover UP, and the main-standby switching is unreasonable.

When the RBM configuration defaults to back-off, an FW1 uplink and downlink link (A1, B1 and C1) fails, FW2 is switched to standby, then one link (B2 or C2) of the FW2 fails Down, FW2 is switched to standby again, and the switching is meaningless because FW1 is unavailable.

In summary, the switching mechanism of the RBM should be that the main device link UP is detected to perform switching, but not that the other side down performs switching; whether the configuration is switched back or not should be compared with the main and standby device links, and the switching back or not can be selected only by detecting one side.

In view of this, the present disclosure provides a method and an apparatus for master/slave switching management, an electronic device, and a machine-readable storage medium, so as to solve the problem that the master/slave switching process is unreasonable.

The specific technical scheme is as follows.

In an embodiment, the present disclosure provides a method for master/slave switching management, which is applied to a network management device, and the method includes: respectively acquiring current link states of a main network device and a standby network device; respectively adjusting the priority values of the main network equipment and the standby network equipment according to the current link states of the main network equipment and the standby network equipment; determining a new main network device according to the priority values of the main network device and the standby network device; the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

Specifically, as shown in fig. 1, the method comprises the following steps:

step S11, respectively obtaining the current link states of the main network device and the standby network device;

step S12, respectively adjusting the priority values of the main network device and the standby network device according to the current link states of the main network device and the standby network device;

step S13, determining a new master network device according to the priority values of the master network device and the standby network device.

The primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

The states of all links of the main and standby network devices are analyzed respectively, so that a priority value is evaluated for the main and standby network devices respectively, whether main and standby switching is needed or not is judged according to the priority value, and therefore the situation that when partial faults exist in all the links, the devices with relatively worse network states are used as the main network devices is avoided.

In one embodiment, the adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

In one embodiment, the determining a new master network device according to the priority values of the master network device and the standby network device includes: and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

In one embodiment, adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

In one embodiment, the default priority values 65535 and 65534 are respectively configured for the active and standby network devices, and the priority value range is 0-65535, wherein 0 represents no preemption of the primary device, and a higher priority value indicates a higher priority to elect the primary device.

FW1 interface or link failure Down, RBM controls VRRP state switching process as follows:

the FW1 interface Down senses the status Down of FW1 link, reduces the priority value of FW1, and compares the priority values of FW1 and FW2 with each other, if the priority value of FW2 is higher, the status of FW2 is controlled to be switched to the Master device, and the status of FW1 is controlled to be switched to the Backup device.

The adjustment of the priority value can be set by adding a judgment mechanism in the switching process, wherein FW1 is set as a master management device, FW2 is set as a slave management device, the initial FW1 has a priority value of 65535, the FW2 has a priority value of 65534, the link state can be monitored in combination with Track or BFD, and when FW1 has an interface failure Down, the RBM receives a message management VRRP backup group and reduces the priority value of FW 1. Adding a loop judgment process, monitoring whether all links are Down or unidirectional (all uplink links or all downlink links) are full Down, namely the FW1 flow is not communicated, and if so, configuring the priority value of corresponding equipment to be 1; otherwise, the priority value is decreased by 10 every Down link, that is, when there are n interface failures, the priority value is 65535-10 × n.

When FW1 link full Down or unidirectional full Down, the priority value is 1, if FW2 individual link fails Down, but there is no link full Down or unidirectional full Down, the priority value of FW2 is still higher than FW1, at this time, no switching is performed, and the problem of unreasonable switching can be effectively solved.

In an embodiment, the present disclosure also provides a primary/standby switching management apparatus, as shown in fig. 2, applied to a network management device, where the apparatus includes: the link module 21 is configured to obtain current link states of the primary network device and the standby network device respectively; the adjusting module 22 is configured to adjust priority values of the main network device and the standby network device according to current link states of the main network device and the standby network device, respectively; the switching module 23 is configured to determine a new primary network device according to the priority values of the primary network device and the standby network device; the primary network device and the standby network device are configured with an initial priority value, the initial priority value of the primary network device being higher than the initial priority value of the standby network device.

In one embodiment, the adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and respectively configuring different adjustment values according to the importance of different links, and adjusting the priority values of the associated main and standby network devices according to the uplink and downlink states of the links and the associated adjustment values.

In one embodiment, the determining a new master network device according to the priority values of the master network device and the standby network device includes: and if the priority value of the current standby network equipment is higher than that of the current main network equipment, configuring the current standby network equipment as new main network equipment, and performing main-standby switching according to a configuration result.

In one embodiment, adjusting the priority values of the master network device and the standby network device according to the current link states of the master network device and the standby network device respectively includes: and if the link states of the uplink group or the downlink group are all offline, setting the priority value of the associated network equipment to be the lowest.

The device embodiments are the same or similar to the corresponding method embodiments and are not described herein again.

In an embodiment, the present disclosure provides an electronic device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to implement the foregoing active/standby switching management method, and from a hardware level, a schematic diagram of a hardware architecture may be as shown in fig. 3.

In one embodiment, the present disclosure provides a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned master-slave switching management method.

Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.

The systems, devices, modules or units described in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.

For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in practicing the disclosure.

As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.

The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (which may include, but is not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The above description is only an embodiment of the present disclosure, and is not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the scope of the claims of the present disclosure.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:在包括基站的通信网络中的方法和通信网络中的网络实体

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类