Redundant server switching method and system
By employing a three-layer redundancy design and intelligent switching mechanism, the hardware utilization and switching reliability of redundant servers are improved, solving the problems of low hardware resource utilization and detection mechanism risks in existing technologies. This enables efficient and reliable server switching, ensuring the continuity of critical business operations.
Patent Information
- Application Number
- CN202511606472.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-10
AI Technical Summary
Existing redundant server switching solutions suffer from low hardware resource utilization, risks associated with a single detection mechanism, and insufficient data and load coordination, resulting in low switching reliability and efficiency, and are prone to business interruptions, especially in critical business operations.
It adopts a three-layer redundancy design, including a dual-machine hot standby architecture at the hardware layer, a shared storage unit, and dual network card redundant network links. It combines heartbeat detection and multi-dimensional performance detection, realizes master-slave switching based on a weighted voting mechanism, and ensures data consistency through a multi-layer synchronization mechanism.
It achieved a 25% increase in server cluster throughput, reduced single-point failure risk through hardware redundancy and automatic failover, shortened failover time to the second level, and achieved 99.999% business continuity, meeting the high availability requirements of critical industries such as finance and telecommunications.
Smart Images

Figure CN121501545A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer system high-availability architecture design, and particularly relates to a switching method and system of redundant servers. BACKGROUND
[0002] In a computer network system, node redundancy technology improves reliability through hardware, software and structural redundancy, but the existing scheme has the following deficiencies: low hardware resource utilization, single detection mechanism risk, and insufficient data and load coordination, which jointly restrict the reliability and efficiency of redundant server switching. First, the hardware layer redundancy design lacks dynamic adaptation capability. Traditional dual-machine hot standby, such as NEC Express5800ft series server, adopts a master-slave architecture, which is more cost-effective than cluster technology requiring more than three nodes, but the standby resources are idle for a long time, resulting in low utilization. Second, fault detection relies too much on a single mechanism. For example, the virtual routing redundancy protocol (VRRP) realizes switching by electing a master / backup router, but it is difficult to guarantee the consistency of the master-slave state, and there is a risk of split-brain. Moreover, traditional heartbeat detection is easily affected by network congestion and misjudgment. Finally, there is insufficient coordination between data synchronization and load balancing. The design of the message buffer area in the dual-machine hot standby system is limited, resulting in data loss or service interruption during switching. For example, a 30-second service interruption occurred in a financial system due to switching delay, indicating the defects of traditional schemes in key business continuity protection. SUMMARY
[0003] To solve the problems in the prior art, the present application provides a switching method and system of redundant servers to solve the technical problems of inaccurate fault detection, switching delay and poor data consistency in existing redundant server switching.
[0004] To solve the above technical problems, the present application adopts the following technical solutions.
[0005] The present application first discloses a switching method of redundant servers, which comprises the following steps: Step 1: constructing a dual-machine hot standby architecture of master-slave servers, a shared storage unit and a dual-network card redundant network link at the hardware layer, and switching power supply through a three-layer redundant power supply system; Step 2: intelligently detecting faults of the redundant servers through heartbeat detection and multi-dimensional performance detection, and realizing master-slave switching based on a weighted voting mechanism; Step 3: dynamically adjusting the weight of the redundant server nodes based on a dynamic priority mechanism, thereby balancing the load of the master-slave servers, and guaranteeing data consistency through a multi-layer synchronization mechanism.
[0006] The present application further comprises the following preferred schemes: The three-layer redundant power supply system, AC 220V to DC 12V power supply module and DC 12V battery module are redundant to each other, the power supply backboard is redundant to each other, the power supply switching chip automatically switches to the normal power input, and the power supply switching chip works in the current sharing mode when it is normal.
[0007] The dual-network card redundant network link adopts dual-network card binding and independent heartbeat link, the server dual-network card is bound in LACP mode, connected to two redundant switches, and an aggregated link is formed through the MLAG technology of the dual-switches; a special heartbeat channel is set, and static ARP binding is adopted.
[0008] The step 2 further comprises: The first sensor set detects the first type of parameter index of the master server, the second sensor set detects the second type of parameter index of the master server, the standby server is started according to the first type of parameter, and the master-standby switching is performed according to the second type of parameter after the standby server is started.
[0009] The master-standby switching based on the weighted voting mechanism further comprises: The preset weights of CPU usage, memory utilization and network delay are used as evaluation indexes, the fault level is determined through double comparison of the master-standby health value and the threshold value, including triggering local repair, master-standby switching or executing an emergency plan.
[0010] The master-standby switching process includes strategy list interaction, comprehensive judgment and priority dynamic adjustment; after the fault occurs, the master-standby server determines the necessity of switching based on the preset strategy, the new standby machine reduces the VRRP priority to complete the role conversion, the master-standby nodes monitor each other through heartbeat in normal state, and the standby server takes over the active identifier and updates the client addressing information when a fault occurs; after the master node recovers, the reverse heartbeat detection triggers the switching back, and the original master-standby architecture is restored.
[0011] The step 3 further comprises: The switching priority is obtained by accessing the resources of multiple standby servers, and the real-time priority is updated, the standby servers to be switched are screened and the switching conditions are judged, the target server is determined, the switching is performed and the data is transmitted; the switching priority is determined based on the preset priority and the real-time load state, and the load balancing algorithm adopts an adaptive load balancing mode.
[0012] The multi-layer synchronization mechanism is used to ensure data consistency, which further comprises: MySQL semi-synchronous replication is adopted, and transaction submission is confirmed by at least one standby library; real-time system replication technology is used to backup system state in real time, the target server is configured consistently with the source server during fault transfer, media metadata is stored in dual nodes; Redis Redlock distributed lock is introduced, and global transaction log is stored in combination with a shared transaction log server.
[0013] The application also discloses a switching system of the redundant server using the switching method of the redundant server. The hardware redundancy module is used for constructing a dual-computer hot backup architecture of the master server and the backup server, a shared storage unit and a dual-network card redundant network link at a hardware layer, and performing power switching through a three-layer redundant power supply system. The fault detection switching module is used for intelligently detecting faults of the redundant server through heartbeat detection and multi-dimensional performance detection, and realizing master-backup switching based on a weighted voting mechanism. The load balancing module is used for dynamically adjusting weights of the redundant server nodes based on a dynamic priority mechanism, thereby balancing loads of the master server and the backup server, and guaranteeing data consistency through a multi-layer synchronization mechanism.
[0014] Correspondingly, the application also discloses a terminal, including a processor and a storage medium. The storage medium is used for storing instructions. The processor is used for operating according to the instructions to perform steps of the switching method of the redundant server.
[0015] Correspondingly, the application also discloses a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize steps of the switching method of the redundant server.
[0016] The application has the advantages that, compared with the prior art, the application provides a switching method and system of a redundant server, sets three-layer defense mechanisms, realizes significant technical gains through multi-layer redundancy and intelligent switching of hardware, network and data, the system MTBF is improved by 3 times, hardware redundancy and automatic fault transfer reduce single-point fault risks, intelligent predictive maintenance combined with dynamic health detection reduces 60% of unplanned downtime, fault transfer time is shortened from 2-5 minutes of traditional master-backup switching to seconds or even milliseconds, dynamic load balancing distributes traffic according to real-time load, improves server cluster throughput by 25%, avoids single-point overload and optimizes resource utilization, realizes fault non-perception switching through heartbeat monitoring and virtual IP transfer mechanisms, guarantees business continuity of 99.999% in combination with MLAG fault domain isolation and hot plug components, and meets high availability requirements of financial, telecommunication and other key industries. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a hardware redundancy deployment topology diagram for showing redundant connection relationships of servers, storages and networks in the application.
[0018] Figure 2 is a fault switching state transition diagram including four states of normal, detection, switching and recovery in the application.
[0019] Figure 3 is the data synchronization timing diagram of the transaction log transmission process between the primary and backup nodes described in the application. DETAILED DESCRIPTION
[0020] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0021] The embodiments described in the present application are only embodiments of part of the present application, not all embodiments. Other embodiments obtained by those skilled in the art without creative labor based on the spirit of the present application all belong to the protection scope of the present application.
[0022] In view of the deficiencies of the prior art, the present application proposes a redundancy server switching method and system, which reduces switching delay and guarantees data consistency during fault switching process by constructing a three-layer collaborative defense mechanism of hardware, detection and load, realizes reliable switching of the server, and improves system high availability and business continuity. The system includes a hardware redundancy module, a fault detection and switching module, and a load balancing module, which are respectively responsible for hardware layer redundancy design, intelligent fault detection and switching, and dynamic load balancing. The three layers of defense work collaboratively to realize reliable switching of the redundancy server. The hardware redundancy module configures a dual-machine hot standby architecture, a shared storage unit and a three-layer redundant power supply system, the battery module of the three-layer redundant power supply system adopts a gel storage battery, and the power supply switching chip works in current sharing mode when normal, and automatically switches to the normal input power supply when faulty. The fault detection and switching module includes a multi-dimensional sensor set and a weighted voting unit, and also includes a message buffer area for buffering messages during the switching process. When the standby server is promoted to the on-duty machine, the buffer area information is processed first, and the information before the time when the last received opposite side on-duty message is discarded, so as to ensure that no message is lost during the switching process. The load balancing module includes a priority calculation unit and a data transmission unit. The load balancing module supports a double-point sending mode of operator operation information, the on-duty machine directly processes the operation information, and the standby server buffers the operation information, so that the downlink message information is not lost during the switching process.
[0023] The switching method of the redundancy server disclosed in the present application comprises the following steps: Step 1: constructing a dual-machine hot standby architecture, a shared storage unit and a dual-network card redundant network link of the primary and standby servers at the hardware layer, and switching the power supply through a three-layer redundant power supply system.
[0024] Referring to Figure 1The hardware layer redundancy design serves as the first line of defense. This includes redundancy configurations across three dimensions: server nodes, storage systems, and network links. The hardware layer redundancy design incorporates a dual-machine hot standby architecture and shared storage units, and is configured with a three-layer redundant power supply system. In this three-layer redundant power supply system, the first layer consists of a redundant AC 220V to DC 12V power supply module and a redundant DC 12V battery module; the second layer consists of redundant power backplanes (typically two or four); and the third layer consists of a computing board power switching chip that automatically switches to the normal power input, operating in current sharing mode when the power switching chip is functioning normally.
[0025] The dual-machine hot standby and shared storage architecture achieves hardware fault isolation through a dual-module full redundancy design. It is configured with two sets of CPUIO modules, each containing a CPU, memory, and PCI slots. Leveraging the lockstep technology of the GeminiEngine™ redundant chip, the modules control instruction processing synchronously, providing hot-swappable capabilities and full hardware redundancy. Redundancy is further enhanced by adding physical devices to form a cluster.
[0026] Lockstep synchronization mechanism, as a real-time fault detection technology based on hardware redundancy, forms a closed-loop control system of redundant execution, real-time comparison, and fault response. By constructing a multi-layered fault-tolerant architecture, it achieves high reliability assurance in critical computing scenarios.
[0027] Redundant execution is the underlying support of the Lockstep mechanism. It requires at least two identical processor cores (the Master Core and the Checker Core) to receive completely consistent input signals, including instruction streams, data, clock pulses, and reset signals. Physical redundancy in the computation process is achieved through parallel execution. To ensure input consistency, the hardware design must integrate input synchronization buffer logic to perform timing calibration and buffering of external input signals, avoiding input offsets caused by differences in transmission paths. During the execution phase, the Master and Checker Cores strictly follow the same code flow. The hardware redundancy covers key modules such as the CPU core, SFR / CSFR registers, SRI / SPB interfaces, interrupt routing, and memory interfaces (such as PMI / DMI), forming end-to-end computational redundancy.
[0028] Real-time comparison is the core of fault detection. A dedicated hardware comparator compares the calculation results of the master and slave cores cycle-by-cycle at key output points. The granularity of comparison can be chosen based on a trade-off between security requirements and performance costs: bus transaction level (comparing the address, data, and control signals of each bus access, most commonly used), instruction level (comparing the status of key registers after each instruction execution, with higher latency), or module output level (such as comparing ALU / FPU operation results, requiring native chip support). To avoid the impact of common-mode interference on detection accuracy, some implementations employ an anti-interference design of master core output inversion + slave core input delay: the master core output signal is inverted by a NOT operation and delayed by n cycles (usually n=2), while the slave core input signal is directly delayed by n cycles. These two signals form complementary verification at the comparator, effectively avoiding misjudgments caused by synchronization noise. Furthermore, the comparator itself must meet high reliability requirements; in some scenarios, redundant designs are used to ensure that comparator faults can be independently detected and reported.
[0029] Lockstep's core workflow is as follows: Input synchronization: The master and slave cores receive the same instructions, data and clock signals, and synchronize the input after being calibrated by buffer logic; Parallel execution: Dual cores execute the same code flow independently, with key hardware modules (registers, ALU, etc.) mirrored in real time; Result comparison: The hardware comparator compares the results of the master and slave cores cycle by cycle at the bus / register output level. If they match, execution continues. Fault response: When results are inconsistent, error handling is triggered (output suppression + interrupt reporting).
[0030] When the comparator detects an output inconsistency, the Lockstep mechanism must quickly initiate a fault response to prevent error propagation. Taking the GeminiEngine™ redundant chip as an example, its response strategy includes: error output suppression (immediately blocking the transmission of erroneous data to the external bus / peripheral) and interrupt triggering (sending a fault interrupt request to the system management unit). It also adheres to the strict synchronization error control requirements of the EN50129 standard to ensure the time determinism of fault detection and response. To build a deeper fault-tolerant system, Lockstep typically works in conjunction with ECC memory: ECC can independently detect and correct single-bit errors, while Lockstep captures multi-bit errors or core hardware faults through dual-core comparison. Together, they form a multi-layered protection network of single-bit error correction, multi-bit error detection, and hardware fault isolation, significantly improving the overall system reliability.
[0031] Common-mode failures (such as power fluctuations or electromagnetic interference causing simultaneous failures in both cores) are a major challenge of the Lockstep mechanism. In engineering practice, this risk is mitigated through multiple isolation designs: physical separation (increasing the master-slave core spacing during chip layout to reduce the probability of common-cause failures), timing skew (introducing a small phase difference of half a clock cycle to prevent synchronization noise from affecting both cores simultaneously), input path isolation (using independent signal transmission channels for master and slave cores), and power domain isolation (using independent power rails in critical scenarios, which is more costly). Currently, the mainstream solution is homogeneous Lockstep (master and slave core architectures are completely identical), achieving a balance between performance and security through the aforementioned isolation measures.
[0032] The server nodes are deployed with two primary and backup servers in a hot standby configuration. Each server is equipped with two Intel Xeon Gold processors and 128GB of memory, with performance parameter differences controlled within 10% to ensure switchover compatibility. The primary and backup servers achieve high-speed switching through dedicated hardware modules, such as the Tripp Lite 3-phase rack ATS PDU, which supports dual input power. Hybrid solid-state switching technology can complete the primary / backup power switching within 1-5 milliseconds, ensuring power continuity.
[0033] The storage system is built on a SAN architecture, configured with eight 1.9TB SAS hard drives forming a RAID10 array. Dual redundancy is achieved through a combination of disk mirroring and striping, and at least two storage servers are deployed simultaneously to prevent device-level failures. The storage media supports NAS (file-level, NFS / CIFS protocol), SAN (block-level, iSCSI / Fibre Channel protocol), or distributed storage systems (such as Ceph, GlusterFS), providing a unified data access interface to ensure seamless takeover of business data by primary and backup nodes. Logically, data isolation is achieved through LUN (Logical Unit Number) partitioning, employing a RAID1+0 combination strategy. Mirroring is followed by striping; mirroring ensures data redundancy, while striping improves read / write performance, meeting the dual requirements of critical business operations for data reliability and access efficiency.
[0034] The network layer employs dual NIC bonding and an independent heartbeat link. The server's dual NICs are bonded in LACP mode and connected to two redundant switches (such as the S7600 series), forming an aggregated link through MLAG technology on the dual switches. A dedicated 10Gbps heartbeat channel is configured, using static ARP bonding to ensure that the synchronization delay between the primary and backup nodes is ≤50μs. The physical connections between the primary and backup servers, the RAID10 storage array, the dual NICs, and the redundant switches are determined, and the redundancy paths for each component are identified.
[0035] Step 2: Perform intelligent fault detection on redundant servers through heartbeat detection and multi-dimensional performance detection, and realize master-slave switchover based on weighted voting mechanism.
[0036] Intelligent fault detection and switching serves as the second layer of defense. This intelligent fault detection and switching employs a multi-dimensional weighted voting mechanism, including a first set of sensors detecting first-type parameters of the main server, a second set of sensors detecting second-type parameters of the main server, a startup control unit activating a backup server based on the first-type parameters, and a switching control unit performing a primary / backup switch based on the second-type parameters after the backup server is activated. The multi-dimensional parameters include core process status, network communication status, and server ID. The first-type parameters include core process status, used to determine whether the main server's critical business processes are running normally; network communication status, used to monitor server network connectivity and data transmission; and the second-type parameters include server ID, used to identify and distinguish different server nodes, ensuring the accuracy of the switching target.
[0037] Workflow: When the first type of parameter is abnormal, the start control unit triggers the backup server to start; after the backup server starts successfully, the switch control unit completes the primary / backup switchover logic according to the second type of parameter.
[0038] In a preferred embodiment, the switching execution is coordinated at the network layer, storage layer, and application layer, and the time consumption of each link is strictly controlled to meet the service interruption tolerance requirements.
[0039] Network Layer: VIP Drift and Service Takeover Seamless network service failover can be achieved through Virtual IP (VIP) technology. A typical solution uses Keepalived configuration: When the primary server fails, the standby server sends a gratuitous ARP packet via the VRRP protocol to migrate the VIP from the primary server's network card to the standby server, updating the network routing table. This process must take less than 200 ms to ensure a seamless failover for the client.
[0040] Storage layer: Shared storage ownership transfer The standby machine takes over access to the shared storage LUN via the SCSI-3 Persistent Reservation protocol, while simultaneously loading the latest status data from the host machine (achieved through a memory mirroring synchronization mechanism, supporting real-time data snapshots). For high-reliability systems such as those used in vehicle-rail systems, the storage tier switchover time must be controlled within 50 ms to meet millisecond-level fault recovery requirements.
[0041] Application layer: Process restart and session recovery The standby machine starts business processes (such as database services and application middleware) and restores incomplete user sessions through session persistence technologies (such as Redis caching and database transaction logs). Process startup time needs to be optimized according to the application type. For example, the restart time of database services is usually controlled within 1-3 seconds, and the session recovery success rate needs to reach more than 99.9%.
[0042] See Figure 2 This invention integrates traditional heartbeat detection with multi-dimensional performance monitoring. It uses the GeminiEngine™ chip to detect module faults in real time, automatically isolating and removing faulty modules when anomalies occur, and continuing operation when no faulty modules are present. It integrates the EXPRESSSCOPE Engine2 backplane management controller and ESMPRO Agent software to achieve remote hardware and power monitoring; the Refresh-Drop Replication (RDR) software only copies changed data, shortening synchronization time after a fault. It sets three alarm thresholds (warning / fault / emergency) and combines CPU, memory, and network metrics to predict potential risks and trigger corresponding switching strategies.
[0043] The intelligent fault detection and switching mechanism achieves reliable status management of redundant servers through the coordinated operation of the monitoring layer, decision-making layer, and execution layer.
[0044] The monitoring layer employs multi-dimensional detection at 5-second intervals, including a combination of TCP port probing and application-layer HTTP 200 health checks. It simultaneously collects hardware metrics (such as CPU temperature and memory ECC errors) via the IPMI interface, forming a three-tiered detection system encompassing hardware, services, and business logic. This ensures that abnormal nodes are identified and removed from the service pool within seconds. A heartbeat mechanism serves as the core monitoring method. The primary and backup nodes send heartbeat signals every second through the private cluster network. If no response is received within 5 seconds, a preliminary fault is determined. This is further confirmed by application-layer query requests every 60 seconds (such as getCustomerDetails), avoiding false positives caused by network fluctuations.
[0045] The decision-making layer constructs a weighted voting mechanism based on an improved Paxos algorithm, using CPU utilization (weight 0.3), memory utilization (0.2), and network latency (0.5) as core evaluation indicators. Fault levels are determined through a dual comparison of primary / standby health values and thresholds: minor faults (affecting some services) trigger local repair; moderate faults (affecting core services) initiate primary / standby failover; and severe faults (service interruption) execute emergency plans. Simultaneously, dynamic priority management is introduced, updating the failover sequence based on the real-time resource status of the standby server and selecting target nodes according to the highest priority principle, thus improving decision-making accuracy.
[0046] The execution layer uses the VRRP protocol to migrate the virtual IP (192.168.100.1). The switching process includes three steps: policy list interaction, comprehensive evaluation, and dynamic priority adjustment. After a failure occurs, the primary and backup servers determine the necessity of switching based on preset policies. The new backup server actively lowers its VRRP priority to complete the role transition, with the entire switching time controlled within 300ms. The state transition logic follows a closed loop of "normal-failure-recovery": Under normal conditions, the primary and backup nodes monitor each other via heartbeat; during a failure, the backup server takes over the activity flag and updates the client addressing information; after the primary node recovers, it triggers a switchback through reverse heartbeat detection to restore the original primary-backup architecture.
[0047] Step 3: Dynamically adjust the weight of redundant server nodes based on the dynamic priority mechanism to balance the load of the primary and backup servers, and ensure data consistency through a multi-layer synchronization mechanism.
[0048] Dynamic load balancing serves as the third layer of defense. Dynamic load balancing involves acquiring resource priorities when accessing resources from multiple backup servers, switching between them, updating real-time priorities, filtering servers to be switched and determining switching conditions, and finally executing the switch and transmitting data after identifying the target server. The switching priority is determined based on a combination of preset priorities and real-time load status, and the load balancing algorithm employs an adaptive load balancing mode.
[0049] A traffic scheduling model is built based on a genetic algorithm, and virtual IP migration is implemented using the VRRP protocol. During the switchover process, a packet buffer mechanism is used to cache critical information. When the backup server is upgraded to the primary server, it processes the data from the switchover period to ensure session continuity. In the event of a failure, the storage device connection is automatically switched to the backup server, and the load is distributed through a multi-server cluster to prevent performance loss. After a module is replaced, both modules automatically synchronize and resume normal operation, maintaining a load-balanced state.
[0050] The encoding strategies of genetic algorithms include: Real number encoding: Directly using traffic allocation values or path weights as genes (such as using real numbers to represent road segment traffic in OD traffic optimization). Hybrid coding: combining task priority and path information (e.g., in vehicular TSN networks, chromosomes consist of time slot allocation and routing selection); Quantum coding: Introducing quantum superposition states to enhance population diversity (QIGA algorithm improves resource utilization by 27.5% in edge computing scheduling).
[0051] The fitness function design includes multi-objective optimization: integrating indicators such as latency, bandwidth utilization, and energy consumption; and integrating hard constraints (such as time window limits and link capacity limits in TSN) through penalty functions.
[0052] Improved genetic operators, adaptive crossover / mutation: Cross rate (Latency reduction of 18.4% in embedded system scheduling); The rate of change employs an exponential decay strategy:
[0053] The top 5% of the best individuals are retained and directly enter the next generation (the evolution rate of the Routing-GA algorithm reaches 24.42%); the crossover and mutation results are optimized by combining tabu search (TS) (the solution time in vehicle network scheduling is reduced by 88%).
[0054] See Figure 3 The system employs a reliable failover mechanism for redundant servers, establishing a dynamic load balancing and data consistency collaboration mechanism. This three-layer architecture ensures business continuity and data integrity. The load balancing layer utilizes an Nginx+Keepalived architecture, dynamically adjusting node weights every 10 seconds based on real-time metrics such as CPU utilization and memory usage. A priority mechanism balances the utilization of primary and backup servers, preventing single-point overload. In dual-machine hot standby Active / Active mode, all nodes share the load, improving resource utilization by 40%. If any node fails, traffic is automatically transferred to a healthy node, ensuring uninterrupted service.
[0055] Data consistency is ensured through a multi-layered synchronization mechanism: MySQL semi-synchronous replication requires at least one backup database to confirm transaction commits, ensuring transaction integrity; real-time system replication technology is used to back up the system state in real time, ensuring that the target server configuration is consistent with the source server during failover, and media metadata (such as stream start / stop times) is stored in both nodes to guarantee data continuity. To address data contention issues during failover, a Redis Redlock distributed lock is introduced, combined with a shared transaction log server to store a global transaction log, ensuring the atomicity and consistency of distributed transactions.
[0056] Experimental data verification shows that, in a scenario with 1000 concurrent users, the data synchronization latency between the primary and backup servers is stably controlled within 20ms. The storage server achieves zero-latency backup of user data through real-time synchronization technology. Combined with a backup strategy of three copies of data, two media, and one off-site backup, along with AES-256 encryption, a dual guarantee of data security and consistency is constructed.
[0057] The beneficial effects of this invention are as follows: Compared with the prior art, this invention provides a method and system for switching redundant servers, setting up a three-layer defense mechanism. Through multi-layer redundancy and intelligent switching of hardware, network, and data, significant technical gains are achieved. The system MTBF is improved by 3 times, and hardware redundancy and automatic failover reduce the risk of single point of failure. Intelligent predictive maintenance combined with dynamic health monitoring reduces unplanned downtime by 60%, and the failover time is shortened from 2-5 minutes in traditional master-slave switching to seconds or even milliseconds. Dynamic load balancing allocates traffic according to real-time load, increasing server cluster throughput by 25%, avoiding single point overload, and optimizing resource utilization. Through mechanisms such as heartbeat monitoring and virtual IP transfer, seamless failover is achieved. Combined with MLAG fault domain isolation and hot-swappable components, business continuity is guaranteed to reach 99.999%, meeting the high availability requirements of critical industries such as finance and telecommunications.
[0058] This invention can be a system, method, and / or computer program product. This invention also discloses a redundant server switching system based on the aforementioned redundant server switching method, comprising: The hardware redundancy module is used to build a dual-machine hot standby architecture for primary and backup servers, a shared storage unit, and dual network card redundant network links at the hardware layer, and to perform power switching through a three-layer redundant power supply system. The fault detection and switching module is used to intelligently detect faults in redundant servers through heartbeat detection and multi-dimensional performance detection, and realize master-slave switching based on a weighted voting mechanism. The load balancing module is used to dynamically adjust the weights of redundant server nodes based on a dynamic priority mechanism, thereby balancing the load on the primary and backup servers and ensuring data consistency through a multi-layer synchronization mechanism.
[0059] Based on the spirit of this invention, those skilled in the art will readily conceive that a computer program product can be obtained based on the aforementioned redundant server switching method. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure. That is, this application also includes a terminal comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to perform the steps according to the aforementioned redundant server switching method.
[0060] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0061] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0062] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for switching redundant servers, characterized in that, Includes the following steps: Step 1: Build a dual-machine hot standby architecture for primary and backup servers, a shared storage unit, and dual network card redundant network links at the hardware level, and perform power switching through a three-layer redundant power supply system; Step 2: Perform intelligent fault detection on redundant servers through heartbeat detection and multi-dimensional performance detection, and realize master-slave switchover based on weighted voting mechanism; Step 3: Dynamically adjust the weight of redundant server nodes based on the dynamic priority mechanism to balance the load of the primary and backup servers, and ensure data consistency through a multi-layer synchronization mechanism.
2. The method for switching redundant servers according to claim 1, characterized in that, In the three-layer redundant power supply system, the AC 220V to DC 12V power supply module and the DC 12V battery module are redundant to each other, the power backplane is redundant to each other, the computing board power switching chip automatically switches to normal power input, and the power switching chip operates in current sharing mode when it is normal.
3. The method for switching redundant servers according to claim 2, characterized in that, The dual-NIC redundant network link adopts dual-NIC bonding and independent heartbeat link. The server's dual NICs are bonded in LACP mode and connected to two redundant switches, forming an aggregated link through dual-switch MLAG technology. Set up a dedicated heartbeat channel and use static ARP binding.
4. The method for switching redundant servers according to claim 3, characterized in that, Step 2 further includes: The first set of sensors detects the first type of parameters of the main server, and the second set of sensors detects the second type of parameters of the main server. The standby server is started based on the first type of parameters, and the main server is switched to standby based on the second type of parameters after the standby server is started.
5. The method for switching redundant servers according to claim 4, characterized in that, The method for implementing primary / backup failover based on a weighted voting mechanism further includes: The system uses preset weights for CPU utilization, memory utilization, and network latency as evaluation indicators. It determines the fault level by comparing the primary and backup health values with thresholds, including triggering local repair, primary / backup switchover, or executing emergency plans. The primary / standby switchover process includes policy list interaction, comprehensive evaluation, and dynamic priority adjustment. After a failure occurs, the primary and standby servers determine the necessity of switching based on preset policies. The new standby machine lowers the VRRP priority to complete the role conversion. Under normal conditions, the primary and standby nodes monitor each other through heartbeats. In the event of a failure, the standby server takes over the activity identifier and updates the client addressing information. After the primary node recovers, a reverse heartbeat detection triggers a switchback to restore the original primary / standby architecture.
6. The method for switching redundant servers according to claim 3, characterized in that, Step 3 further includes: The system accesses resources from multiple backup servers to obtain switching priorities and updates real-time priorities. It then filters servers to be switched and determines switching conditions. After identifying the target server, it performs the switch and transmits data. The switching priorities are determined based on a combination of preset priorities and real-time load status, and the load balancing algorithm adopts an adaptive load balancing mode.
7. The method for switching redundant servers according to claim 4, characterized in that, The method of ensuring data consistency through a multi-layer synchronization mechanism further includes: MySQL semi-synchronous replication is adopted, and transaction commits are confirmed by at least one standby database; real-time system replication technology is used to back up the system status in real time, and the target server configuration is consistent with the source server during failover, and media metadata is stored in two nodes; Redis Redlock distributed lock is introduced, combined with a shared transaction log server to store global transaction logs.
8. A switching system for redundant servers, characterized in that, include: The hardware redundancy module is used to build a dual-machine hot standby architecture for primary and backup servers, a shared storage unit, and dual network card redundant network links at the hardware layer, and to perform power switching through a three-layer redundant power supply system. The fault detection and switching module is used to intelligently detect faults in redundant servers through heartbeat detection and multi-dimensional performance detection, and realize master-slave switching based on a weighted voting mechanism. The load balancing module is used to dynamically adjust the weights of redundant server nodes based on a dynamic priority mechanism, thereby balancing the load on the primary and backup servers and ensuring data consistency through a multi-layer synchronization mechanism.
9. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the switching method for redundant servers according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the switching method for redundant servers as described in any one of claims 1-7.