A configuration recovery method, apparatus, device, and medium for a switch stacking system.
Patent Information
- Application Number
- CN202310577581.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-05-19
AI Technical Summary
[0003]现有技术方案中,一般仅备份保存堆叠系统内各个社员设备的基础堆叠配置信息,第一种是通过输出保存配置提醒、修改配置文件、重启系统内所有成员设备来实现堆叠系统的重新部署,启系统内所有成员设备的操作会影响网络通信环境中的现有业务,不适用于会产生拓扑变化的应用场景
[0017]通过本申请提出的方法能够带来如下有益效果:发生拓扑变化或者成员角色变化时,可以不重启堆叠系统,最大程度减少拓扑变化对正在运行中的堆叠系统的业务影响。发生拓扑变化或者成员角色变化时,配置的分块保存,自适应恢复,避免了配置的重复下发,减少了配置重复下发对系统稳定性的影响。在进行复杂堆叠环境部署时,分块存储、冗余保存、自适应恢复的方式能够因地制宜地恢复整个堆叠系统中所有成员设备的配置,降低了堆叠系统部署的难度和成本。
Smart Images

Figure CN116545850B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication, specifically to a configuration recovery method, apparatus, device, and medium for a switch stacking system. Background Technology
[0002] As networks continue to expand, the demand for high-concurrency, high-throughput, and easily manageable network systems is becoming increasingly significant. This has led to the development of stacking systems, which combine two or more switches for unified management. Multiple switches are interconnected as member devices, logically operating as a single switch, forming a unified device called a stacking system. This enables efficient interconnection and unified management of switched networks. During the election process, member devices in a stacking system generate corresponding active and member devices. The topology and role maintenance are then led by the active device. For switch stacking systems, besides superior performance compared to single devices, the failure of a single member device necessitates that the remaining devices ensure minimal disruption to network services. Consistent configuration and stable collaborative operation among all member devices are crucial for stable and reliable network communication.
[0003] Existing technical solutions typically only back up and save the basic stacking configuration information of each member device within the stacking system. The first approach involves redeploying the stacking system by issuing a save configuration reminder, modifying the configuration file, and restarting all member devices. However, restarting all member devices disrupts existing services in the network communication environment, making it unsuitable for application scenarios involving topology changes. Furthermore, stacking systems in network communication environments carry numerous services. When adding a small number of switching devices, existing solutions require restarting all member devices within the stacking system, resulting in poor fault tolerance and high deployment costs.
[0004] The second method involves configuring basic stacking configuration information one-to-one with neighboring member devices via a designated stacking port of the first started member device. This process is complex, time-consuming to build the stacking system, and not conducive to maintaining dynamic topology changes. Designating the first started member device as active and configuring basic stacking configuration information one-to-one with neighboring member devices results in relatively slow stacking system construction. In the face of dynamic topology changes, especially when the active device goes offline, the system processing is complex and affects network communication. Summary of the Invention
[0005] To address the aforementioned problems, this application proposes a configuration recovery method, apparatus, device, and medium for a switch stacking system, wherein the method includes:
[0006] Obtain the device identity and configuration information corresponding to each member device in the target switch stacking system; divide the configuration information according to the device identity to obtain the master device configuration file, the general configuration file, and the single device configuration file; package the master device configuration file, the general configuration file, and the single device configuration file, and send them to each member device so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; receive the stacking system topology change signal, and each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update its own configuration.
[0007] In one example, each member device loads a corresponding configuration file based on whether its own device identity has changed. Specifically, this includes: determining the target device whose device identity has changed, and determining the new device identity of the target device; determining the target configuration file type based on the new device identity; and parsing the configuration file corresponding to the target configuration file type in the target device to update the target device configuration.
[0008] In one example, the master device configuration file stores the configurations that the switch device with the device identity as the master device needs to restore and load, including at least the network management port configuration and the serial port configuration; the universal configuration file stores the configurations that each switch device needs to restore and load, including VLAN service module functions and SNMP service module functions; the single device configuration file stores the configurations that a single switch device needs to restore and load, including port-related configurations, and the single device configuration file corresponds to the name of the single switch device.
[0009] In one example, after packaging the master device configuration file, the universal configuration file, and the single device configuration file and sending them to each member device, the method further includes: receiving the stacking system configuration change signal and determining the corresponding configuration change information; replacing the configuration change information in the master device configuration file, the universal configuration file, and the single device configuration file, and sending the replaced configuration file to each member device.
[0010] In one example, sending the replaced configuration file to each member device specifically includes: using MD5 verification to verify the configuration file transmission process between the member devices.
[0011] In one example, after each member device loads the corresponding configuration file based on whether its own device identity has changed, the method further includes: recording the configuration file loading time and backing up historical configuration files to the database.
[0012] In one example, in the switch stacking system, the link connection method of each member device includes at least one of chain link and ring link.
[0013] This application also provides a configuration recovery device for a switch stacking system, comprising:
[0014] The system comprises the following modules: an information acquisition module, which acquires the device identity and configuration information of each member device in the target switch stacking system; a configuration partitioning module, which partitions the configuration information according to the device identity to obtain a master device configuration file, a general configuration file, and a single device configuration file; a configuration distribution module, which packages the master device configuration file, the general configuration file, and the single device configuration file and sends them to each member device so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; and a topology update module, which receives a topology change signal from the stacking system, and each member device loads the corresponding configuration file according to whether its own device identity has changed to update its own configuration.
[0015] This application also provides a configuration recovery device for a switch stacking system, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform: obtaining the device identity and configuration information corresponding to each member device in the target switch stacking system; dividing the configuration information according to the device identity to which the configuration information belongs, to obtain a master device configuration file, a general configuration file, and a single device configuration file; packaging the master device configuration file, the general configuration file, and the single device configuration file, and sending them to each member device, so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; receiving a stacking system topology change signal, and each member device loading the corresponding configuration file according to whether its own device identity has changed, to update its own configuration.
[0016] This application also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to: obtain the device identity and configuration information corresponding to each member device in a target switch stacking system; divide the configuration information according to the device identity to which the configuration information belongs, to obtain a master device configuration file, a general configuration file, and a single device configuration file; package the master device configuration file, the general configuration file, and the single device configuration file, and send them to each member device, so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; receive a stacking system topology change signal, and each member device loads the corresponding configuration file according to whether its own device identity has changed, to update its own configuration.
[0017] The method proposed in this application offers the following advantages: When topology changes or member role changes occur, the stacking system can be restarted without restarting, minimizing the impact of topology changes on the services of the running stacking system. When topology changes or member role changes occur, the configuration is saved in blocks and adaptively restored, avoiding duplicate configuration distribution and reducing the impact of duplicate configuration distribution on system stability. When deploying in complex stacking environments, the block storage, redundant saving, and adaptive restoration approach can restore the configuration of all member devices in the entire stacking system according to local conditions, reducing the difficulty and cost of stacking system deployment. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a flowchart illustrating a configuration recovery method for a switch stacking system according to an embodiment of this application.
[0020] Figure 2 This is a schematic diagram of a topology change in a switch stacking system according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a switch stacking system link in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the configuration recovery device for a switch stacking system according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the configuration recovery device for a switch stacking system according to an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0026] Figure 1 This is a flowchart illustrating a configuration recovery method for a switch stacking system provided in one or more embodiments of this specification. The process can be executed by a computing device in the relevant field, and certain input parameters or intermediate results in the process can be manually adjusted to help improve accuracy.
[0027] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.
[0028] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.
[0029] like Figure 1 As shown in the figure, this application embodiment provides a configuration recovery method for a switch stacking system, including:
[0030] S101: Obtain the device identity and configuration information of each member device in the target switch stacking system.
[0031] Multiple switches are enabled in stacking mode and join the stacking system. Each member device is elected to determine its role, and the devices collaborate to maintain normal network communication services. The server-switch stacking system contains the device identity and configuration information for each member device.
[0032] S102: Based on the device identity to which the configuration information belongs, the configuration information is divided to obtain a master device configuration file, a general configuration file, and a single device configuration file;
[0033] The configuration saving operation is performed, which categorizes all effective configurations on the stacking system into three types of files: master device configuration files, general configuration files, and single device configuration files, according to their respective roles.
[0034] In one embodiment, the master device configuration file indicates the configurations that only the active switch device needs to restore, such as management port configurations and serial port configurations. This is because the stacked system logically operates as a single switch, and only the serial and management ports of the active member device can be used. The universal configuration file indicates the configurations that all switch devices need to restore, such as VLAN and SNMP service module functions, which need to be deployed and applied by all member devices. The single device configuration file corresponds to a single switch device name, indicating the configurations that only member devices with that name need to restore, such as port-related configurations. The stacked system significantly expands the number of ports in the system, and these ports are strongly associated with a particular member device. When a member device goes offline, the ports on that device will also lose service.
[0035] S103: Package the main device configuration file, the universal configuration file, and the single device configuration file, and send them to each member device, so that each member device stores the main device configuration file, the universal configuration file, and the single device configuration file.
[0036] After configuring the block storage, the configuration file is transmitted to each member device in the stacked system through communication between member devices, and a backup is stored on each member device. Redundant storage ensures that each member device has a complete configuration file, reduces the dependence of a single device on the master device, and has strong adaptability to scenarios with dynamic changes in topology.
[0037] S104: Receive the stacking system topology change signal. Each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update the configuration of each member device.
[0038] When a topology change occurs, each member device adaptively loads the corresponding configuration file based on whether its role has changed, updates its own configuration, and completes configuration loading and restoration.
[0039] In one embodiment, when loading the configuration file, the target device for the device identity change is first determined, and the new device identity of the target device is determined. Then, based on the new device identity, the target configuration file type is determined. Finally, the configuration file corresponding to the target configuration file type is parsed in the target device to update the target device configuration.
[0040] like Figure 2 As shown, member device 1 has device number 1 and is the master device in the original stacking system, while member devices 2 and 3 are slave devices. After performing a configuration save operation, all existing effective configurations are segmented and encapsulated to generate a master device configuration file, a general configuration file, and single device configuration files named "member_1", "member_2", and "member_3". Following the configuration segmentation logic, the effective configurations on member device 1 are the master device configuration file, the general configuration file, and "member_1"; the effective configurations on member device 2 are the general configuration file and "member_2"; and the effective configurations on member device 3 are the general configuration file and "member_3". These configuration files are stored as backups on each member device through inter-device communication. If member device 1 temporarily goes offline due to a fault, member device 2 becomes the new master device, and the role of member device 3 remains unchanged. The newly created master device will load the "master device configuration file" and restore its configuration. Member device 3 does not need to reload its configuration because its role has not changed. After member device 1 is repaired and comes back online, it joins the stacking system as a slave device. At this time, the roles of member device 2 and member device 3 remain unchanged. Member device 1 needs to reload the universal configuration file (public configuration) and the "member_1" single device configuration file to restore its configuration.
[0041] In one embodiment, if the configuration information changes, the configuration saving operation is re-executed. Specifically, after receiving a configuration change signal from the stacked system, the corresponding configuration change information is determined, and the changed information is replaced in the master device configuration file, the universal configuration file, and the individual device configuration file. The replaced configuration file is then sent to each member device. This ensures that the configuration files saved by each member device within the system are up-to-date and consistent.
[0042] Furthermore, during the process of sending the replaced configuration file to each member device, MD5 verification is used to verify the configuration file transmission process between the member devices.
[0043] In one embodiment, after each member device loads the corresponding configuration file based on whether its own device identity has changed, the loading time of the configuration file corresponding to each member device can also be recorded, and the historical configuration files can be backed up to the database.
[0044] In one embodiment, such as Figure 3 As shown, in a switch stacking system, the link connection methods of each member device include at least one of chain links and ring links.
[0045] like Figure 4As shown in the illustration, this application also provides a configuration recovery device for a switch stacking system, comprising:
[0046] Information acquisition module 401 acquires the device identity and configuration information of each member device in the target switch stacking system;
[0047] The configuration partitioning module 402 partitions the configuration information according to the device identity to which the configuration information belongs, so as to obtain a master device configuration file, a general configuration file and a single device configuration file.
[0048] The configuration distribution module 403 packages the main device configuration file, the universal configuration file, and the single device configuration file, and sends them to each member device, so that each member device stores the main device configuration file, the universal configuration file, and the single device configuration file.
[0049] The topology update module 404 receives the stacking system topology change signal. Each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update the configuration of each member device.
[0050] like Figure 5 As shown in the illustration, this application also provides a configuration recovery device for a switch stacking system, comprising:
[0051] At least one processor; and a memory communicatively connected to said at least one processor; wherein,
[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform:
[0053] Obtain the device identity and configuration information corresponding to each member device in the target switch stacking system; divide the configuration information according to the device identity to obtain the master device configuration file, the general configuration file, and the single device configuration file; package the master device configuration file, the general configuration file, and the single device configuration file, and send them to each member device so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; receive the stacking system topology change signal, and each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update its own configuration.
[0054] This application embodiment also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0055] Obtain the device identity and configuration information corresponding to each member device in the target switch stacking system; divide the configuration information according to the device identity to obtain the master device configuration file, the general configuration file, and the single device configuration file; package the master device configuration file, the general configuration file, and the single device configuration file, and send them to each member device so that each member device stores the master device configuration file, the general configuration file, and the single device configuration file; receive the stacking system topology change signal, and each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update its own configuration.
[0056] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0057] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0058] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can 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, etc.) containing computer-usable program code.
[0059] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0060] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0061] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0062] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0063] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0064] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0065] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0066] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A configuration recovery method for a switch stacking system, characterized in that, include: Obtain the device identity and configuration information of each member device in the target switch stacking system; Based on the device identity to which the configuration information belongs, the configuration information is divided to obtain a main device configuration file, a general configuration file, and a single device configuration file. The main device configuration file, the universal configuration file, and the single device configuration file are packaged and sent to each member device, so that each member device stores the main device configuration file, the universal configuration file, and the single device configuration file. Upon receiving a topology change signal from the stacking system, each member device loads the corresponding configuration file based on whether its own device identity has changed, thereby updating its own configuration. The master device configuration file stores the configuration that the switch device, which is identified as the master device, needs to restore and load, including at least the network management port configuration and the serial port configuration. The universal configuration file stores the configurations that all switch devices need to restore and load, including VLAN service module functions and SNMP service module functions. The single device configuration file stores the configurations that a single switch device needs to restore and load, including port-related configurations. The single device configuration file corresponds to the name of the single switch device.
2. The method according to claim 1, characterized in that, Each member device loads a corresponding configuration file based on whether its own device identity has changed, specifically including: Identify the target device for the device identity change, and determine the new device identity of the target device; Based on the new device identity, determine the target configuration file type; The configuration file corresponding to the target configuration file type is parsed in the target device to update the target device configuration.
3. The method according to claim 1, characterized in that, After packaging the master device configuration file, the universal configuration file, and the single device configuration file and sending them to each member device, the method further includes: Receive the topology change signal of the stacking system and determine the corresponding configuration change information; Replace the configuration change information in the main device configuration file, the universal configuration file, and the single device configuration file, and send the replaced configuration file to each member device.
4. The method according to claim 3, characterized in that, Sending the replaced configuration file to each member device specifically includes: The configuration file transmission process between the member devices is verified using MD5 checksum.
5. The method according to claim 1, characterized in that, After each member device loads the corresponding configuration file based on whether its own device identity has changed, the method further includes: Record the configuration file loading time and back up historical configuration files to the database.
6. The method according to claim 1, characterized in that, In the switch stacking system, the link connection method of each member device includes at least one of chain link and ring link.
7. A configuration recovery device for a switch stacking system, characterized in that, include: The information acquisition module acquires the device identity and configuration information of each member device in the target switch stacking system. The configuration partitioning module partitions the configuration information according to the device identity to which the configuration information belongs, so as to obtain the main device configuration file, the general configuration file and the single device configuration file. The configuration distribution module packages the main device configuration file, the universal configuration file, and the single device configuration file, and sends them to each member device, so that each member device stores the main device configuration file, the universal configuration file, and the single device configuration file. The topology update module receives the stacking system topology change signal. Each member device loads the corresponding configuration file according to whether its own device identity has changed, so as to update the configuration of each member device. The master device configuration file stores the configuration that the switch device, which is identified as the master device, needs to restore and load, including at least the network management port configuration and the serial port configuration. The universal configuration file stores the configurations that all switch devices need to restore and load, including VLAN service module functions and SNMP service module functions. The single device configuration file stores the configurations that a single switch device needs to restore and load, including port-related configurations. The single device configuration file corresponds to the name of the single switch device.
8. A configuration recovery device for a switch stacking system, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the steps of the method as claimed in any one of claims 1-6.
9. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to perform the steps of the method as claimed in any one of claims 1-6.
Citation Information
Patent Citations
A management method and device of network equipment
CN109039754A
A rapid configuration method and system for network communication equipment
CN109861861A
Configuration file processing method and device for network equipment
CN111726249A