High-availability machine room monitoring method, device and equipment based on double machines

By monitoring the operational status of the primary device and virtual IP migration, the problem of excessively long primary/backup switchover time is solved, achieving rapid switchover and data consistency. This is suitable for high-availability data center monitoring systems based on dual machines.

CN121644761APending Publication Date: 2026-03-10EMERSON NETWORK POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, when the primary machine encounters a problem and needs to be switched to the backup machine, the primary-backup switchover time is too long, and it is also necessary to perform a primary-backup switchover when application anomalies cannot be monitored.

Method used

By monitoring the operating status of the first device, the application service is switched to the second device using virtual IP migration. When the monitoring results meet the conditions for primary/backup switching, intermediate data and stored data from the first device are sent to the second device, thereby achieving fast switching and data consistency.

Benefits of technology

It enables a quick switch from the first device to the second device when the first device fails or the application malfunctions, ensuring data consistency after the primary/backup switch, reducing switchover time and avoiding redundant scheduling of alarm notifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644761A_ABST
    Figure CN121644761A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a high-availability machine room monitoring method, device and equipment based on double machines. The method comprises the steps that the operation state of first equipment is monitored; under the condition that the monitoring result of the first device meets the main-standby switching condition, first type data in the first device is sent to a second device, a service supporting operation of a first application program is operated in the first device, and the first type data is intermediate data needed by operation of the first application program; and switching and configuring a virtual IP for externally providing an application service to the second equipment by utilizing a virtual IP drift mode, wherein the application service comprises the service of the first application program. Therefore, the problems that in the prior art, when a host has a problem and needs to be switched to a standby machine for operation, the host and standby switching time is too long, and it cannot be monitored that when an application is abnormal, the host and standby switching needs to be conducted are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of monitoring systems, and in particular to a method, apparatus and equipment for monitoring a highly available data center based on dual machines. Background Technology

[0002] In the daily operation and maintenance of data centers, the data center monitoring system plays a crucial role. Through this system, the operational data of equipment such as UPS and air conditioning are readily available. Maintenance personnel can also be notified immediately of any alarms. From the perspective of ensuring the reliable operation of critical infrastructure such as UPS and air conditioning, the high availability of the data center monitoring system itself is increasingly attracting attention.

[0003] Typical high-availability solutions for data center monitoring systems involve introducing commercial solutions like ATANG or Rose. When a primary / standby switchover is detected, the primary service is stopped first, and then the standby service is started. The switchover time is mainly consumed by the database startup time and the application startup time itself, which is generally on the order of minutes and is independent of the specific application. The failover time is too long. Summary of the Invention

[0004] This invention proposes a high-availability data center monitoring method, device, and equipment based on dual machines, which solves the problems in the prior art where the master machine has a problem and needs to switch to the standby machine, the master-slave switching time is too long, and the master-slave switching cannot be monitored when the application is abnormal.

[0005] In a first aspect, embodiments of this application provide a high-availability data center monitoring method based on dual machines, including:

[0006] Monitor the operating status of the first device;

[0007] If the monitoring results of the first device meet the conditions for primary / backup switchover, the first type of data from the first device is sent to the second device. The first device runs a service that supports the operation of the first application. The first type of data is intermediate data required for the operation of the first application.

[0008] The virtual IP address used for providing application services is switched and configured to the second device using a virtual IP migration method. The application services include those of the first application.

[0009] The method described in this application embodiment can switch the first device to the second device in a short time, such as less than 10 seconds, when the first device fails or the application malfunctions. Simultaneously, it ensures data consistency between the first and second devices after the primary / backup switch.

[0010] In some possible embodiments, the monitoring results of the first device satisfy the primary / backup switchover conditions, including at least one of the following:

[0011] The following situations may occur: network interruption or system crash of the first device:

[0012] The application service in the first device is abnormal.

[0013] Based on the embodiments of this application, two types of faults that meet the conditions for primary / standby switching are proposed, including network or system faults and application service abnormality faults. This enables primary / standby switching to be triggered even when application services are abnormal, thus overcoming the problem of application monitoring in the prior art.

[0014] In some possible embodiments, monitoring the operating status of the first device includes at least one of the following steps:

[0015] The network and system of the first device are monitored by the service software keepalived;

[0016] The watchdog service monitors the application services in the system of the first device.

[0017] The method described in this application embodiment can monitor the network and system of the first device, as well as the application services in the system, and can determine the fault of the first device in a timely manner.

[0018] In some possible embodiments, the monitoring of application services in the system of the first device by the watchdog service includes:

[0019] The watchdog service periodically monitors the process running status of application services.

[0020] When an abnormal process running state is detected, the application service is restarted via the watchdog service, and the number of abnormal restarts is counted.

[0021] When the number of abnormal restarts reaches a specified number, an application service anomaly is detected.

[0022] The method in this application embodiment monitors the application services in the system of the first device through a watchdog service. Application service anomalies may also be resolved by restarting the application. Therefore, the method limits the determination of an application service anomaly to a specified number of restarts. This eliminates application failures that can be resolved simply by restarting the application and overcomes the problem in the prior art that a primary / backup switch cannot be performed when an application service is anomaly.

[0023] In some possible embodiments, the first type of data includes Redis cached data, and the first type of data from the first device is sent to the second device, wherein:

[0024] Keepalived invokes a data migration and synchronization tool to obtain the intermediate data based on the Redis cache data in the first device, and then synchronizes the intermediate data to the second device.

[0025] The method described in this application embodiment can perform a one-way synchronization from the first device to the second device for some intermediate data that does not need to be persisted during the primary / backup switch, thereby ensuring data consistency between the first device and the second device after the primary / backup switch.

[0026] In some possible embodiments, the data migration and synchronization tool includes a filtering script, wherein obtaining the intermediate data based on the Redis cache data in the first device includes:

[0027] The intermediate data is obtained from the Redis cache data using the filtering script in the migration synchronization tool.

[0028] The method described in this application can filter out unnecessary intermediate data and retain the intermediate data specified in the first type of data, thereby achieving data consistency between the first device and the second device after the master-slave switchover of Redis cached data.

[0029] In some possible embodiments, the first device further includes a second type of data, and the method further includes:

[0030] In the event of an update to the second type of data, the updated portion of the second type of data will be synchronized to the second device;

[0031] The second type of data includes stored data that supports the operation of the second application.

[0032] The method of this application embodiment can be used to update the second type of data in real time, and update the data of the real-time update part in the first device to the second device in real time. Compared with the prior art, it can effectively reduce the time for data synchronization during primary-backup switching, and can complete the primary-backup switching in a short time.

[0033] In some possible embodiments, the second type of data includes data stored in a MySQL database, and synchronizing the updated portion of the second type of data to the second device includes:

[0034] Based on the master-master replication mode pre-configured for the MySQL database by the first device and the second device, the first device automatically synchronizes the updated data of the MySQL database to the MySQL database of the second device.

[0035] The method described in this application embodiment enables seamless data synchronization between the first and second devices without additional configuration of MySQL data synchronization after a master-slave switch, saving time spent on MySQL data synchronization.

[0036] In some possible embodiments, the second type of data includes data stored in an Influxdb database, and synchronizing the updated portion of the second type of data to the second device includes:

[0037] When the service of the third application writes updated data to the Influxdb database through the data synchronization agent component of the first device's middleware, the data synchronization agent component also writes the updated data to the Influxdb database of the second device.

[0038] The method in this application embodiment enables the data synchronization proxy component of the first device to directly control the database synchronization of the second device when the virtual IP is connected to the first device. This ensures the consistency of Influxdb data between the first and second devices after the primary / backup switch, while also saving time for Influxdb data synchronization.

[0039] In some possible embodiments, the second type of data includes data stored in a directory file, and synchronizing the updated portion of the second type of data to the second device includes:

[0040] The directory files in the first device are monitored in real time using a file monitoring tool;

[0041] After confirming that the contents of the directory file in the first device have been updated, the updated portion of the directory file is synchronized to the directory file of the second device using a data mirroring backup tool.

[0042] The method described in this application embodiment enables real-time synchronization of directory files involved in the system front-end page to the second device, ensuring the consistency of directory file data between the first device and the second device after the primary / backup switch.

[0043] In some possible embodiments, at least one of the following steps is also included:

[0044] Based on the configured maintenance and operation status logic, when the current identity is determined to be the host, the abnormal alarm notification logic in the maintenance and operation status logic is scheduled normally; when the current identity is determined to be the standby machine, the abnormal alarm notification logic in the maintenance and operation status logic is exited.

[0045] Based on the application-side monitoring function, when a virtual IP switch is detected and the current identity is a standby machine, the data specified by the application side is initialized. The data specified by the application side includes the data when the application side is restarted.

[0046] The method of this application embodiment has the following advantages: First, when the system needs to schedule services such as alarm notifications, it ensures that only the alarm notifications on the first device, which is the host device, are scheduled and executed, thus avoiding the problem of repeated scheduling of alarm notifications; Second, when performing a master-slave switchover, the second device, which is the standby device, performs initialization operations on the data specified by the application side, so that it is not necessary to restart the entire application, thus saving the master-slave switchover time.

[0047] Secondly, embodiments of this application also provide a high-availability data center monitoring device based on dual machines, the device comprising:

[0048] The monitoring module is used to monitor the operating status of the first device;

[0049] The data update module is used to send a first type of data from the first device to the second device when the monitoring result of the first device meets the conditions for primary / backup switching. The first device runs a service that supports the operation of the first application, and the first type of data is intermediate data required for the operation of the first application.

[0050] The virtual IP migration module is used to switch the configuration of the virtual IP that provides application services to the second device using the virtual IP migration method. The application services include the services of the first application.

[0051] The apparatus of this application embodiment solves the problem in the prior art that the switching time between the primary and backup devices is too long when the first device malfunctions and needs to be switched to the second device, and that it is impossible to monitor the need for switching between the primary and backup devices when the application is abnormal.

[0052] Thirdly, embodiments of this application also provide a high-availability data center monitoring device based on dual machines, comprising: a memory and a processor, wherein:

[0053] The memory is used to store programs that can be executed by the processor;

[0054] The processor is used to read the program in the memory and execute it to implement the dual-machine-based high-availability data center monitoring method as described in the first aspect above.

[0055] The device in this application embodiment is used to execute the dual-machine-based high-availability data center monitoring method described in any of the first aspects above, saving the time of master-slave switching when the first device has a problem and needs to switch to the second device, and ensuring data consistency between the first device and the second device after master-slave switching.

[0056] This application provides a high-availability data center monitoring method, apparatus, and device based on dual machines. The method monitors the operating status of a first device. When the monitoring result of the first device meets the conditions for primary / standby switchover, it sends a first type of data from the first device to a second device. The first device runs services supporting the operation of a first application, and the first type of data is intermediate data required for the operation of the first application. A virtual IP address providing application services is switched and configured to the second device using a virtual IP migration method. The application services include those of the first application. This addresses the problems in existing technologies where the primary / standby switchover time is too long when the primary device fails and a switchover is not monitored when the application malfunctions.

[0057] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0058] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods.

[0059] Figure 1 This is a schematic diagram illustrating the deployment of a high-availability data center monitoring device based on dual machines, as described in an embodiment of this application.

[0060] Figure 2 This is a flowchart illustrating a virtual IP switching method in an embodiment of this application;

[0061] Figure 3 This is a schematic diagram of the initial state interface in an embodiment of this application;

[0062] Figure 4 This is a schematic diagram of the status interface after the primary / standby switchover in an embodiment of this application;

[0063] Figure 5 This is a flowchart illustrating a virtual IP switching method in an embodiment of this application;

[0064] Figure 6 This is a schematic diagram of the initial virtual IP state in the embodiments of this application;

[0065] Figure 7 This is a schematic diagram of the virtual IP status after primary / standby switchover in an embodiment of this application;

[0066] Figure 8 This is a schematic diagram of the virtual IP status when the first device recovers to normal operation in this embodiment of the application;

[0067] Figure 9 This is a schematic diagram illustrating the principle of the data synchronization proxy influxdb-proxy component in the embodiments of this application;

[0068] Figure 10 This is a flowchart of a high-availability data center monitoring method based on dual machines, as described in an embodiment of this application.

[0069] Figure 11 This is a schematic diagram of a high-availability data center monitoring device based on dual machines, as described in an embodiment of this application.

[0070] Figure 12 This is a schematic diagram of a high-availability data center monitoring device based on dual machines, as described in an embodiment of this application. Detailed Implementation

[0071] The technical solutions in the embodiments of this application will now be described clearly and in detail with reference to the accompanying drawings. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0072] Given that related technologies suffer from excessively long failover times when switching to a standby machine due to host failures, and the inability to monitor failover when application malfunctions necessitate such failover, this application proposes a high-availability data center monitoring method, apparatus, and equipment based on dual-machine systems.

[0073] This application primarily addresses the issue of primary / standby switchover and data synchronization when a primary machine fails and needs to be switched to a standby machine. It proposes a novel solution that enables a switchover from primary to standby within 10 seconds of a primary machine failure. Simultaneously, it ensures data consistency between the primary and standby machines after the switchover. The solution involves monitoring the operational status of a first device; when the monitoring results of the first device meet the primary / standby switchover conditions, it sends a first type of data from the first device to a second device. The first device runs services supporting the operation of a first application, and this first type of data is intermediate data required for the first application's operation. A virtual IP migration method is used to switch and configure the virtual IP providing the application services to the second device, including the services of the first application. This solves the problems of excessively long primary / standby switchover times in existing technologies when a primary machine fails and the inability to monitor for primary / standby switchovers when applications malfunction.

[0074] The following describes in detail, with reference to the accompanying drawings, a method, apparatus, and equipment for monitoring a highly available data center based on dual machines, as described in the embodiments of this application.

[0075] This application provides a high-availability data center monitoring system based on a dual-machine architecture. The middleware introduced includes a relational database (MySQL), a cache (Redis), and a time-series database (InfluxDB). A deployment diagram of the system is shown below. Figure 1 As shown. Based on the dual-machine high-availability data center monitoring system provided in this application, when it is determined that the conditions for primary / standby switching are met, the system can realize virtual IP switching and database synchronization between the first and second devices, solving the problem of excessively long primary / standby switching time in the prior art. The system includes: a first device and a second device.

[0076] In this embodiment, the first and second devices operate the same dual-machine-based high-availability data center monitoring method. In the processing logic of this method, corresponding processing logic is executed according to different identities. For devices with high priority, when the virtual IP of the application is first accessed, the virtual IP of the application is accessed to the device and the application is run as the host. In contrast, devices with low priority are used as backup machines.

[0077] The primary / standby failover logic in this application is mainly executed by the first device. In the aforementioned system, the first device monitors its operational status when its current identity is determined to be a host. If the monitoring results of the first device meet the primary / standby failover conditions, it sends a first type of data from the first device to the second device. The first device runs services supporting the operation of a first application, and this first type of data is intermediate data required for the operation of the first application. A virtual IP address providing application services is switched and configured to the second device using a virtual IP migration method. These application services include those of the first application. The first device also includes a second type of data. When the second type of data is updated, the updated portion is synchronized to the second device. This second type of data includes stored data supporting the operation of the second application.

[0078] In the above system, the second device is used to determine its identity as a backup device, based on the primary / backup switch and database synchronization operation performed by the first device, to switch the virtual IP and synchronize the first type of data and the second type of data, and complete the data synchronization from the identity of the first device. After switching its identity to the host device, it runs the processing logic of the first device.

[0079] In this embodiment of the application, the first and second devices work closely together to build a high-availability data center monitoring system based on dual machines. This system can monitor the operating status of the first device and realize the direct switching of the virtual IPs of the first and second devices and the synchronization of the database when the conditions for master-slave switching are met. This solves the problem of excessively long master-slave switching time in the prior art.

[0080] The entry IP for the entire application is the virtual IP. In this embodiment, the virtual IP switching between the first and second devices is achieved through the service software keepalived. Keepalived is a tool used to achieve high availability and network failover for Linux virtual server (LVS) cluster services. It monitors the status of each service node in the cluster system. If a service node malfunctions or becomes abnormal, keepalived will detect it and remove the faulty service node from the cluster system. After the faulty node recovers, keepalived can automatically re-add the service node to the cluster. All of these tasks are completed automatically. This functionality is similar to the application liveness detection function of reverse proxies such as nginx to achieve high availability of backend services. Additionally, keepalived, combined with the VRRP protocol, can build primary / backup or load-balanced network services.

[0081] In one possible embodiment, both the first and second devices are configured in BACKUP mode. In this mode, the database service can perform backups while continuing to receive user requests. This mode offers the advantages of high availability and data consistency. The first device has a higher priority than the second device, ensuring that the virtual IP hosting the application is connected to the first device upon initial access. The first device is additionally configured with a non-preemptive option to prevent the keepalived tool from switching the virtual IP back from the second device when the first device resumes normal operation.

[0082] In one possible embodiment, Figure 1 The stateless services shown are application services that can run simultaneously on the first and second devices, while the stateful services are application services that can only run on machines with virtual IP access.

[0083] The following example illustrates the process of switching virtual IPs using the keepalived service software on the first device, with the ID of the first device being 192.168.2.231, the ID of the second device being 192.168.2.232, and the virtual IP being 192.168.2.230. Figure 2 As shown, it mainly includes:

[0084] Step 201, Initial state: Virtual IP: 192.168.2.230 is located on the first device. At this time, the interface displays as follows. Figure 3 As shown, the stateful service is running on the first device accessing the virtual IP at this time;

[0085] Step 202: The service software keepalived of the first device monitors the network and system of the first device, detects network interruption / system crash, and determines that the conditions for primary / backup switchover are met.

[0086] Step 203: The first device switches the virtual IP from the first device to the second device using the service software keepalived. After the switch, the virtual IP 192.168.2.230 is located on the second device, and the interface displays as follows. Figure 4 As shown, the stateful service is running on the second device with virtual IP access at this time.

[0087] In this embodiment, the service software keepalived can monitor the network and system of the first device. When the network of the first device goes offline or the operating system crashes, keepalived will control the virtual IP to switch between the primary and backup, thereby ensuring the high availability of the monitoring system.

[0088] In one possible embodiment, taking the ID of the first device as 192.168.2.231, the ID of the second device as 192.168.2.232, and the virtual IP as 192.168.2.230 as an example, the process of switching virtual IPs between the first device and the second device is as follows: Figure 5 As shown.

[0089] Step 501, Initial state virtual IP: 192.168.2.230 is located on the first device, such as... Figure 6 As shown;

[0090] Step 502: Monitor the application services in the first device system through the watchdog service, detect application service anomalies, and determine that the conditions for primary / backup switchover are met.

[0091] Step 503: Switch the virtual IP from the first device to the second device using the service software keepalived, such as... Figure 7 As shown;

[0092] Step 504: When the first device resumes normal operation, because it is configured in non-preemptive mode, the virtual IP still resides on the second device. Figure 8 As shown.

[0093] In this embodiment, the process running status of the application service is monitored periodically through a watchdog service; when an abnormal process running status is detected, the application service is restarted through the watchdog service, and the number of abnormal restarts is counted; when the number of abnormal restarts reaches a specified number, it is determined that the application service is abnormal and meets the conditions for primary / backup switchover.

[0094] In one possible implementation, when the number of abnormal restarts reaches 3, a master-slave switch will be performed by restarting the keepalived service on the current machine; when the application service process is detected to be running normally for 12 consecutive times, the number of abnormal restarts will be reset to zero.

[0095] The embodiments of this application can realize two-level fault switching. The detection of the first device fault (specifically, it may include downtime or network interruption) and the switching of the virtual IP are implemented by the service software keepalived. The detection of application faults and the triggering of primary-backup switching are implemented by the watchdog service. After the switching is triggered, the virtual IP switching is implemented by the service software keepalived.

[0096] In this application embodiment, to achieve data synchronization during primary / standby switchover, two main data synchronization methods are provided. One method is a data synchronization method triggered by a primary / standby switchover event. Specifically, when the monitoring result of the first device meets the primary / standby switchover conditions, a first type of data from the first device is sent to the second device. The first device runs a service that supports the operation of a first application, and the first type of data is intermediate data required for the operation of the first application. The other method is a real-time data update method. The first device also includes a second type of data. When the second type of data is updated, the updated portion of the second type of data is synchronized to the second device. The second type of data includes stored data that supports the operation of the second application.

[0097] In the embodiments of this application, the first application and the second application may be the same application or different applications, and this application does not limit them.

[0098] In this embodiment of the application, the first type of data specified above may include, but is not limited to, cached data Redis, and the second type of data specified above may include, but is not limited to, relational data MySQL, time-series data InfluxDB, and directory file data, with specific synchronization methods specified for each type of data.

[0099] 1) Synchronizing cached data with Redis

[0100] When the first device determines to switch the virtual IP providing application services to the second device, keepalived calls the data migration and synchronization tool to obtain the intermediate data based on the Redis cache data in the first device and synchronize the intermediate data to the second device.

[0101] In one possible embodiment, the data migration and synchronization tool includes a filtering script, wherein obtaining the intermediate data based on Redis cached data in the first device includes:

[0102] The intermediate data is obtained from the Redis cache data using the filtering script in the migration synchronization tool.

[0103] In this embodiment, the data in the Redis instance of the dual-machine high-availability data center monitoring system consists of intermediate data that does not require persistence. This type of data can be synchronized once from the first device to the second device during master-slave failover. This embodiment uses the data migration and synchronization tool redis-shake to synchronize the Redis data between the first and second devices. Redis-shake supports filtering the data to be synchronized using Lua scripts to filter specific intermediate data.

[0104] 2) Synchronization of MySQL database data

[0105] Based on the master-master replication mode pre-configured for the MySQL database by the first device and the second device, the first device automatically synchronizes the updated data of the MySQL database to the MySQL database of the second device.

[0106] In this embodiment, both the first and second devices have binlog replication enabled for their MySQL relational databases. Unlike the typical MySQL master-slave mode, the first and second devices are configured with master-master replication. During system installation, MySQL configurations are completed, including GTID configuration, MySQL server identifier configuration, and master-master replication configuration. Once the system installation is complete and the application starts normally, master-master replication takes effect. At this point, if an application on the first device writes a record to table A in the first device's database, this record will be automatically synchronized to table A in the second device's database. Although MySQL reads and writes are performed through virtual IPs, and only the MySQL instance with the virtual IP can perform data reads and writes at any given time, the advantage of master-master replication is that no additional MySQL data synchronization configuration is required after a master-slave switch. The MySQL data between the first and second devices can still be seamlessly synchronized after a master-slave switch without additional intervention.

[0107] 3) Synchronization of time-series data in the InfluxDB library

[0108] When the service of the third application writes updated data to the Influxdb database through the data synchronization agent component of the first device's middleware, the data synchronization agent component also writes the updated data to the Influxdb database of the second device.

[0109] In this embodiment, the third application can be the same as or different from the first and second applications; this application does not limit this. Both the first and second devices incorporate a data synchronization proxy component, influxdb-proxy. The third application's read and write operations on the time-series database Influxdb are performed through this proxy. Specifically, the third application accesses influxdb-proxy through the current virtual IP. Both the first and second devices have their own influxdb-proxy components. When a virtual IP connects to the first device, the first device's proxy can directly control the database synchronization of the second device. Similarly, when a virtual IP connects to the second device, the second device's proxy can directly synchronize the database of the first device. A schematic diagram illustrating this principle is shown below. Figure 9As shown.

[0110] In one possible implementation, all read and write operations to the time-series database InfluxDB by devices accessing the virtual IP are performed through an intermediate layer called influxdb-proxy. When writing data, influxdb-proxy automatically synchronizes the data to both the primary and backup InfluxDB database instances. Influxdb-proxy maintains a file cache of data to be written; if a write operation fails on one InfluxDB instance, it retryes the write based on the cached data until successful. When reading data, a load balancing algorithm selects one InfluxDB instance from the primary and secondary devices for data retrieval.

[0111] 4) Synchronization of directory file data

[0112] In this embodiment, the first device monitors the directory file in real time using a file monitoring tool; after determining that changes in the contents of the directory file have been detected, it uses a data mirroring backup tool to synchronize the changed contents of the directory file to the directory file of the second device.

[0113] The principle of file synchronization in this embodiment is as follows: the first and second devices respectively use the file monitoring tool inotify-tools to monitor the directory, and after detecting content changes, the data mirroring and backup tool rsync is used to synchronize the files. Because the front-end page of the dual-machine high-availability data center monitoring system involves some business requirements such as image uploading, these image files also need to be synchronized to the second device.

[0114] In one possible implementation, rsync compares the differences between the source and target files to determine what needs to be transferred. By default, rsync uses a quick check algorithm to quickly check if the size and modification time (mtime) of the source and target files are consistent; if they are inconsistent, transfer is required. The specific file transfer protocol is Secure Shell (SSH). Therefore, key-based login settings are needed between the first and second devices to ensure that file transfers are not blocked. Key-based login settings have already been configured during system installation.

[0115] In one possible embodiment, based on the configured maintenance operation status logic, when the current identity is determined to be the host, the abnormal alarm notification logic in the maintenance operation status logic is scheduled normally; when the current identity is determined to be the standby machine, the abnormal alarm notification logic in the maintenance operation status logic is exited.

[0116] Based on the configured maintenance and operation status logic, the monitoring system includes services such as alarm notifications. These services listen for new alarm events in the monitoring system and then notify users via email or SMS. When deploying a dual-machine setup with both a primary and a secondary device, this inevitably leads to duplicate scheduling issues, requiring assurance that alarm notifications are not triggered repeatedly. The solution proposed in this application is to configure maintenance and operation status logic on both the primary and secondary devices. When the current identity is determined to be the primary device, the abnormal alarm notification logic within the maintenance and operation status logic is scheduled normally; when the current identity is determined to be the secondary device, the abnormal alarm notification logic is exited. This ensures that alarm notifications are only scheduled and executed on the device currently acting as the primary device, thus avoiding the problem of duplicate alarm notification scheduling.

[0117] In this embodiment, based on the application-side monitoring function running on the first and second devices, when a virtual IP switch is detected and the current identity is a standby machine, an initialization operation is performed on the data specified by the application side. The data specified by the application side includes the data when the application side is restarted.

[0118] Based on the application-side monitoring function running on the first and second devices, when a virtual IP switch is detected and the current identity is the standby machine, some data initialization operations are performed to avoid restarting the application. By initializing these specified data, the entire application does not need to be restarted, saving time during primary / standby failover.

[0119] Based on the same inventive concept, embodiments of this application also provide a high-availability data center monitoring method based on dual machines, such as... Figure 10 As shown, it includes:

[0120] Step 1001: Monitor the operating status of the first device;

[0121] Step 1002: If the monitoring result of the first device meets the conditions for primary / backup switchover, send the first type of data from the first device to the second device. The first device runs a service that supports the operation of the first application. The first type of data is intermediate data required for the operation of the first application.

[0122] Step 1003: Use virtual IP migration to switch the configuration of the virtual IP that provides application services to the second device, whereby the application services include the services of the first application.

[0123] In some possible embodiments, monitoring the operating status of the first device includes at least one of the following steps:

[0124] The network and system of the first device are monitored by the service software keepalived;

[0125] The watchdog service monitors the application services in the system of the first device.

[0126] In one possible embodiment, the monitoring result of the first device satisfies the primary / backup switchover condition, including at least one of the following:

[0127] The service software keepalived detected network outages / system crashes:

[0128] The watchdog service detected anomalies in the application service.

[0129] In some possible embodiments, the watchdog service detects application service anomalies, including:

[0130] The watchdog service periodically monitors the process running status of application services.

[0131] When an abnormal process running state is detected, the application service is restarted via the watchdog service, and the number of abnormal restarts is counted.

[0132] When the number of abnormal restarts reaches a specified number, an application service anomaly is detected.

[0133] In one possible embodiment, the step of sending a first type of data from the first device to the second device, the first type of data including Redis cached data, wherein:

[0134] Keepalived invokes a data migration and synchronization tool to obtain the intermediate data based on the Redis cache data in the first device, and then synchronizes the intermediate data to the second device.

[0135] In one possible embodiment, the data migration and synchronization tool includes a filtering script, wherein obtaining the intermediate data based on Redis cached data in the first device includes:

[0136] The intermediate data is obtained from the Redis cache data using the filtering script in the migration synchronization tool.

[0137] In one possible embodiment, the first device further includes a second type of data, and the method further includes:

[0138] In the event of an update to the second type of data, the updated portion of the second type of data will be synchronized to the second device;

[0139] The second type of data includes stored data that supports the operation of the second application.

[0140] In one possible embodiment, the second type of data includes data stored in a MySQL database, and synchronizing the updated portion of the second type of data to the second device includes:

[0141] Based on the master-master replication mode pre-configured for the MySQL database by the first device and the second device, the first device automatically synchronizes the updated data of the MySQL database to the MySQL database of the second device.

[0142] In one possible embodiment, the second type of data includes data stored in an Influxdb database, and synchronizing the updated portion of the second type of data to the second device includes:

[0143] When the service of the third application writes updated data to the Influxdb database through the data synchronization agent component of the first device's middleware, the data synchronization agent component also writes the updated data to the Influxdb database of the second device.

[0144] In one possible embodiment, the second type of data includes data stored in a directory file, and synchronizing the updated portion of the second type of data to the second device includes:

[0145] The directory files in the first device are monitored in real time using a file monitoring tool;

[0146] After confirming that the contents of the directory file in the first device have been updated, the updated portion of the directory file is synchronized to the directory file of the second device using a data mirroring backup tool.

[0147] In some possible embodiments, at least one of the following steps is also included:

[0148] Based on the configured maintenance and operation status logic, when the current identity is determined to be the host, the abnormal alarm notification logic in the maintenance and operation status logic is scheduled normally; when the current identity is determined to be the standby machine, the abnormal alarm notification logic in the maintenance and operation status logic is exited.

[0149] Based on the application-side monitoring function, when a virtual IP switch is detected and the current identity is a standby machine, the data specified by the application side is initialized. The data specified by the application side includes the data when the application side is restarted.

[0150] The high-availability data center monitoring method based on dual machines provided in this application embodiment can be further described in detail here, referring to the implementation methods of each device in the high-availability data center monitoring device based on dual machines provided in the above application embodiment.

[0151] Based on the same inventive concept, this application also provides a high-availability data center monitoring device 1100 based on dual machines, such as... Figure 11 As shown, it includes:

[0152] The monitoring module 1101 is used to monitor the operating status of the first device;

[0153] The data update module 1102 is used to send a first type of data from the first device to the second device when the monitoring result of the first device meets the conditions for primary / backup switching. The first device runs a service that supports the operation of the first application, and the first type of data is intermediate data required for the operation of the first application.

[0154] The virtual IP migration module 1103 is used to switch the configuration of the virtual IP that provides application services to the second device using the virtual IP migration method. The application services include the services of the first application.

[0155] This application also provides a high-availability data center monitoring device based on dual machines, as described below. Figure 12 This application describes a dual-machine-based high-availability data center monitoring device 120 according to one embodiment of the present application. Figure 12 The dual-machine-based high-availability data center monitoring device 120 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0156] like Figure 12 As shown, the dual-machine-based high-availability data center monitoring device 120 is presented in the form of a general-purpose electronic device. The components of the dual-machine-based high-availability data center monitoring device 120 may include, but are not limited to: at least one processor 121, at least one memory 122, and a bus 123 connecting different system components (including memory 122 and processor 121).

[0157] Bus 123 represents one or more of several types of bus structures, including memory bus or memory controller, peripheral bus, processor, or local bus using any of the multiple bus structures.

[0158] The memory 122 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1221 and / or cache memory 1222, and may further include read-only memory (ROM) 1223.

[0159] The memory 122 may also include a program / utility 1225 having a set (at least one) of program modules 1224, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0160] The dual-machine high-availability data center monitoring device 120 can also communicate with one or more external devices 124 (e.g., keyboards, pointing devices, etc.), one or more devices that enable users to interact with the dual-machine high-availability data center monitoring device 120, and / or any device that enables the dual-machine high-availability data center monitoring device 120 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interface 125. Furthermore, the dual-machine high-availability data center monitoring device 120 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 126. As shown, network adapter 126 communicates with other modules used in the dual-machine high-availability data center monitoring device 120 via bus 123. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the dual-machine-based high-availability data center monitoring equipment 120, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0161] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0162] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for monitoring a high-availability computer room based on a dual-computer system, comprising: monitoring a running state of a first device; in a case where a monitoring result of the first device meets a master-slave switching condition, sending first type data in the first device to a second device, the first device running a service supporting a first application program, the first type data being intermediate data required for running the first application program; switching a virtual IP providing an application service to the second device by a virtual IP drift method, the application service including a service of the first application program.

2. The method of claim 1, wherein, The case where the monitoring result of the first device meets the master-slave switching condition includes at least one of the following cases: a case where a network of the first device is interrupted or a system of the first device is down; a case where an application service in the first device is abnormal.

3. The method according to claim 1 or 2, characterized in that, The monitoring of the running state of the first device includes at least one of the following steps: monitoring a network and a system of the first device by a service software keepalived; monitoring an application service in the system of the first device by a watchdog service.

4. The method of claim 3, wherein, The monitoring of the application service in the system of the first device by the watchdog service includes: periodically monitoring a process running state of the application service by the watchdog service; when detecting that the process running state is abnormal, triggering a restart of the application service by the watchdog service and counting a number of abnormal restarts; when the number of abnormal restarts reaches a specified number, determining that the application service is abnormal.

5. The method of claim 1, wherein, The first type data includes Redis cache data, and the sending of the first type data in the first device to the second device includes: invoking a data migration synchronization tool by the keepalived, obtaining the intermediate data from the Redis cache data in the first device, and synchronizing the intermediate data to the second device.

6. The method of claim 5, wherein, The data migration synchronization tool includes a filter script, and the obtaining of the intermediate data from the Redis cache data in the first device includes: obtaining the intermediate data from the Redis cache data by the filter script in the migration synchronization tool.

7. The method of claim 1, wherein, The first device further includes second type data, and the method further includes: in a case where the second type data is updated, synchronizing an updated part of the second type data to the second device, the second type data including storage data supporting a second application program.

8. The method of claim 7, wherein, The second type data includes data stored in a Mysql database, and the synchronizing of the updated part of the second type data to the second device includes: based on a master-master replication mode pre-configured for the Mysql database by the first device and the second device, automatically synchronizing updated data of the Mysql database to a Myqsl database of the second device by the first device.

9. The method of claim 7, wherein, The second type data includes data stored in an Influxdb database, and the synchronizing of the updated part of the second type data to the second device includes: In a case that the service of the third application program writes the update data into the Influxdb database through the data synchronization agent component of the first device intermediate layer, the data synchronization agent component also writes the update data into the Influxdb database of the second device.

10. The method of claim 7, wherein, The second type of data includes data stored in a directory file, and the synchronizing of the updated part of the second type of data to the second device comprises: real-time monitoring of the directory file in the first device by a file monitoring tool; after determining that the content of the directory file in the first device is updated, synchronizing the updated part of the directory file to the directory file of the second device by a data mirror backup tool.

11. The method of claim 1, wherein, Further comprising at least one of the following steps: based on the configured maintenance running state logic, when the current identity is the host, normally scheduling the exception alarm notification logic in the maintenance running state logic, and when the current identity is the backup machine, exiting the exception alarm notification logic in the maintenance running state logic; based on the running application side monitoring function, when the virtual IP switching is monitored and the current identity is the backup machine, performing initialization operation on the application side specified data, the application side specified data including data when the application side is restarted.

12. A dual-computer-based high-availability machine room monitoring device, characterized by comprising: The apparatus comprises: a monitoring module configured to monitor a running state of a first device; a data updating module configured to send first type data in the first device to a second device in a case that a monitoring result of the first device meets a master-slave switching condition, the first device running a service supporting a first application program, the first type data being intermediate data required by the first application program; a virtual IP drift module configured to switch a virtual IP providing an application service to the second device by a virtual IP drift manner, the application service including a service of the first application program.

13. A dual-computer based high-availability machine room monitoring device, characterized by, comprise: a memory and a processor, wherein: the memory is configured to store a program executable by the processor; the processor is configured to read the program in the memory and execute the method for monitoring a high-availability computer room based on dual computers according to any one of claims 1-11.