A method and system for operation and maintenance alarm based on master-slave architecture
By setting up middleware and heartbeat mechanism in the master-slave architecture, automatic switching is achieved when the master node fails, solving the system interruption problem caused by the master node failure and improving the stability and reliability of the operation and maintenance alarm system.
Patent Information
- Application Number
- CN202411798479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In the existing technology, the operation and maintenance alarm service of the master-slave architecture is prone to cause system service interruption when the master node fails, and cannot meet the operation and maintenance alarm needs of the enterprise.
Middleware is set up in the master-slave architecture to achieve data synchronization between the master node and the slave node. When the master node fails, the backup node takes over the work of the master node to ensure uninterrupted generation and processing of alarm information. The node status is monitored through the heartbeat mechanism to perform master-slave switching.
The stability and reliability of the operation and maintenance alarm system have been improved, ensuring that alarm information can still be generated and processed in a timely manner when the main node fails, reducing human intervention and improving operation and maintenance efficiency.
Smart Images

Figure CN119847580B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of operation and maintenance alarm technology, and in particular to an operation and maintenance alarm method and system based on a master-slave architecture. Background Art
[0002] In the modern information technology environment, the importance of operation and maintenance alarm services to every enterprise is self-evident. Operation and maintenance alarm services can help enterprises perform system monitoring, alarm processing, early warning notification and other functions, and can effectively ensure the stability and predictability of the system. Among them, the high availability of the operation and maintenance alarm service system is an important factor in ensuring the continuity of enterprise business.
[0003] However, the master-slave architecture currently used in operation and maintenance alarm services often leads to system service interruptions in certain scenarios due to failures of the master node in the master-slave architecture, thereby affecting the implementation of the operation and maintenance alarm service and failing to meet the enterprise's operation and maintenance alarm needs.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0005] The main purpose of the present invention is to provide an operation and maintenance alarm method and system based on a master-slave architecture, aiming to solve the problem that the master-slave architecture adopted by the operation and maintenance alarm service in the prior art often leads to system service interruption in certain scenarios due to failure of the master node in the master-slave architecture, thereby affecting the implementation of the operation and maintenance alarm service.
[0006] To achieve the above object, the present invention provides an operation and maintenance alarm method based on a master-slave architecture, the operation and maintenance alarm method based on a master-slave architecture comprising the following steps:
[0007] The master process management node of the master node generates data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, sends the data collection configuration information and the alarm configuration information to the standby process agent node of the slave node;
[0008] The standby process agent node performs data collection processing according to the data collection configuration information to obtain target collected data, and performs abnormal data detection processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information;
[0009] If the standby process agent node determines that the main process management node of the main node is in a fault state, the standby process agent node sends the target collection data and the abnormal alarm information to the standby process management node of the main node;
[0010] The standby process management node reports and visually displays the target collected data and the abnormal alarm information.
[0011] Optionally, in the operation and maintenance alarm method based on the master-slave architecture, the master node and the slave node establish a connection through a first middleware; the master process management node and the standby process management node establish a connection through a second middleware; and the master process proxy node and the standby process proxy node establish a connection through a third middleware;
[0012] The master process management node of the master node generates data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, sends the data collection configuration information and the alarm configuration information to the standby process agent node of the slave node, specifically including:
[0013] The master process management node of the master node obtains user demand information, and generates data collection configuration information and alarm configuration information according to the user demand information;
[0014] The master process management node obtains the node status of the master process proxy node through the first middleware, and if it is determined that the node status of the master process proxy node is a fault state, establishes a connection with the standby process proxy node of the slave node through the first middleware;
[0015] The main process management node sends the data collection configuration information and the alarm configuration information to the standby process agent node.
[0016] Optionally, the operation and maintenance alarm method based on the master-slave architecture, wherein the master process management node obtains the node status of the master process agent node through the first middleware, further includes:
[0017] The standby process proxy node obtains the connection port of the active process proxy node, monitors the connection port, and sends a heartbeat message to the active process proxy node once every preset time interval through the second middleware;
[0018] If the master process agent node receives the heartbeat message, it is determined that the master process agent node is in a normal state;
[0019] If the master process agent node does not receive the heartbeat message, it is determined that the master process agent node is in a fault state.
[0020] Optionally, in the operation and maintenance alarm method based on the master-slave architecture, wherein the master process management node obtains the node status of the master process agent node through the first middleware, the method further includes:
[0021] If it is determined that the node status of the main process agent node is normal, the main process management node sends the data collection configuration information and the alarm configuration information to the main process agent node through the first middleware.
[0022] Optionally, in the operation and maintenance alarm method based on the master-slave architecture, if it is determined that the node status of the master process agent node is normal, the master process management node sends the data collection configuration information and the alarm configuration information to the master process agent node through the first middleware, and then further includes:
[0023] When the main process agent node receives the data collection configuration information and the alarm configuration information, the standby process agent node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the main process agent node through the third middleware.
[0024] Optionally, the operation and maintenance alarm method based on the master-slave architecture, wherein the standby process agent node performs data acquisition processing according to the data acquisition configuration information to obtain target acquired data, and performs abnormal data detection processing on the target acquired data according to the alarm configuration information to obtain abnormal alarm information, specifically includes:
[0025] The standby process agent node performs data collection and processing according to the data collection configuration information to obtain target collection data, wherein the target collection data includes server CPU occupancy rate, IO occupancy rate, import and export traffic, and user-defined indicator data;
[0026] The standby process agent node obtains the data alarm threshold set in the alarm configuration information, and compares the target collected data with the data alarm threshold;
[0027] If the data in the target collected data exceeds the data alarm threshold, the data exceeding the data alarm threshold is determined to be abnormal alarm data, and abnormal alarm information is generated according to the abnormal alarm data.
[0028] Optionally, the operation and maintenance alarm method based on the master-slave architecture, wherein if the standby process agent node determines that the master process management node of the master node is in a faulty state, the target collected data and the abnormal alarm information are sent to the standby process management node of the master node, specifically comprising:
[0029] The standby process agent node obtains the node status of the main process management node through the first middleware;
[0030] If the node status of the main process management node is a fault state, establishing a connection with the backup process management node of the main node through the first middleware;
[0031] The standby process agent node sends the target collected data and the abnormal alarm information to the standby process management node.
[0032] Optionally, the operation and maintenance alarm method based on the master-slave architecture, wherein the standby process agent node obtains the node status of the master process management node through the first middleware, further comprising:
[0033] If the node status of the main process management node is normal, the standby process agent node sends the target collection data and the abnormal alarm information to the main process management node of the master node through the first middleware.
[0034] Optionally, the operation and maintenance alarm method based on the master-slave architecture, wherein, if the node status of the master process management node is normal, the standby process agent node sends the target collection data and the abnormal alarm information to the master process management node of the master node through the first middleware, and then further includes:
[0035] When the main process management node receives the target collection data and the abnormal alarm information, the standby process management node synchronously obtains the target collection data and the abnormal alarm information obtained by the main process management node through the second middleware.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides an operation and maintenance alarm system based on a master-slave architecture, wherein the operation and maintenance alarm system based on the master-slave architecture includes: a master node, a slave node and a middleware, wherein the master node includes a master process management node and a standby process management node, the slave node includes a master process agent node and a standby process agent node, the middleware includes a first middleware, a second middleware and a third middleware, the master node and the slave node establish a connection through the first middleware, the master process agent node and the standby process agent node establish a connection through the second middleware, and the master process agent node and the standby process agent node establish a connection through the third middleware;
[0037] The master process management node of the master node is used to generate data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, the data collection configuration information and the alarm configuration information are sent to the standby process agent node of the slave node;
[0038] The standby process agent node is used to perform data collection and processing according to the data collection configuration information to obtain target collected data, and perform abnormal data detection and processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information;
[0039] The standby process agent node is further configured to send the target collected data and the abnormal alarm information to the standby process management node of the master node if it is determined that the master process management node of the master node is in a fault state;
[0040] The standby process management node is used to report and visualize the target collection data and the abnormal alarm information.
[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and an operation and maintenance alarm program based on a master-slave architecture stored on the memory and runnable on the processor, and when the operation and maintenance alarm program based on the master-slave architecture is executed by the processor, the steps of the operation and maintenance alarm method based on the master-slave architecture as described above are implemented.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an operation and maintenance alarm program based on a master-slave architecture, and when the operation and maintenance alarm program based on a master-slave architecture is executed by a processor, the steps of the operation and maintenance alarm method based on a master-slave architecture as described above are implemented.
[0043] In the present invention, the main process management node of the master node generates data collection configuration information and alarm configuration information. If it is determined that the main process agent node of the slave node is in a fault state, the data collection configuration information and the alarm configuration information are sent to the standby process agent node of the slave node; the standby process agent node performs data collection and processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection and processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information; if the standby process agent node determines that the main process management node of the master node is in a fault state, the target collection data and the abnormal alarm information are sent to the standby process management node of the master node; the standby process management node reports and visualizes the target collection data and the abnormal alarm information. The present invention sets up a master node and a slave node on the basis of a master-slave architecture. When a failure occurs in the master process management node in the master node or the master process proxy node in the slave node, the backup process for data synchronization by the middleware, such as the backup process management node or the backup process proxy node, can perform master-slave switching to replace the work of the master process management node or the master process proxy node. This can effectively solve the problem that the operation and maintenance system cannot perform normal alarms due to the failure of the master process, and effectively improve the stability and reliability of the operation and maintenance alarm system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of a preferred embodiment of the operation and maintenance alarm method based on the master-slave architecture of the present invention;
[0045] Figure 2 It is a schematic diagram of the network communication framework of a preferred embodiment of the operation and maintenance alarm method based on the master-slave architecture of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0047] In the modern information technology environment, the importance of operation and maintenance alarm services to every enterprise is self-evident. Operation and maintenance alarm services can help enterprises perform system monitoring, alarm processing, early warning notification and other functions, and can effectively ensure the stability and predictability of the system. Among them, the high availability of the operation and maintenance alarm service system is an important factor in ensuring the continuity of enterprise business.
[0048] However, the master-slave architecture currently used in operation and maintenance alert services often leads to system service interruptions in certain scenarios due to failures of the master node in the master-slave architecture. This affects the implementation of the operation and maintenance alert service and fails to meet the operation and maintenance alert needs of enterprises. Therefore, designing a highly available master-slave operation and maintenance alert mechanism is particularly important.
[0049] To solve the above problems, the present invention provides an operation and maintenance alarm method based on a master-slave architecture. This solution ensures the synchronization of alarm data by setting up middleware and ensures that alarm information can still be generated and processed in a timely manner when the master node fails, thereby improving the reliability of the operation and maintenance alarm system.
[0050] The operation and maintenance alarm method based on the master-slave architecture described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the operation and maintenance alarm method based on the master-slave architecture includes the following steps:
[0051] Step S10: The master process management node of the master node generates data collection configuration information and alarm configuration information. If the master process proxy node of the slave node is determined to be in a faulty state, the master process management node sends the data collection configuration information and the alarm configuration information to the backup process proxy node of the slave node. The master node and the slave node establish a connection via a first middleware; the master process management node and the backup process management node establish a connection via a second middleware; and the master process proxy node and the backup process proxy node establish a connection via a third middleware.
[0052] like Figure 2 As shown, it is a schematic diagram of the network communication framework set in the present invention. Figure 2 The connection lines in the figure indicate that this middleware is used for communication connections. For example, the connection between the master process management node and the standby process management node in the master node, the connection between the master process proxy node and the standby process proxy node in the slave node, and the connection between the master node and multiple slave nodes are all connected through the middleware.
[0053] The master-slave switching logic set in the present invention is pre-written in the program. For example, the master process agent node and the standby process agent node in the slave node are connected through the middleware. When the standby process agent node detects that the master process agent node is suddenly disconnected, that is, the connection is disconnected, the standby process agent node will automatically start the collection thread to work.
[0054] Specifically, the main process management node of the master node obtains user demand information, and generates data collection configuration information and alarm configuration information based on the user demand information; the main process management node obtains the node status of the main process agent node through the first middleware, and if it is determined that the node status of the main process agent node is a fault state, a connection is established with the standby process agent node of the slave node through the first middleware; the main process management node sends the data collection configuration information and the alarm configuration information to the standby process agent node.
[0055] System architecture: The present invention sets up a master node and a slave node, wherein the master node includes a main process management node and a standby process management node. When the master node is in a normal state, the master process management node takes the lead and generates data collection configuration information and alarm configuration information, while the standby process management node synchronizes the data of the master process management node through the second middleware. The following is the working configuration of the master node: 1. Issue data collection configuration information and alarm configuration information to the slave node; 2. Collect data collected from the slave node for aggregate statistics; 3. Collect data collected from the slave node for aggregate alarm processing and storage; 4. Be responsible for web calls to display and process front-end statistical data.
[0056] Among them, for data collection configuration information: the applications deployed on each server in the enterprise are different. In addition to the common basic server indicators, for example, server A collects database table data deployed on the current server, and server B collects log data of a certain application. The data collection configuration information is obtained from the deployment information on all servers in the master node, and then the indicator information that needs to be collected by each slave node is calculated and then distributed.
[0057] For example, the process of issuing data collection configuration information is as follows:
[0058] <id> 1< / id> ;
[0059] <name>CPU utilization< / name> ;
[0060] <type>shell< / type> ;
[0061] <code>mpstat 1 1 | awk ' / ^Average: / {print 100-NF}'< / code> ;
[0062] <cycle> 5s< / cycle> ;
[0063] This process collects the CPU usage metric every 5 seconds. The collection type is shell script execution, and the execution command is: mpstat1 1|awk' / ^Average: / {print 100-NF}'.
[0064] Among them, for the alarm configuration information: the alarm configuration information can be understood as the delivery of an XML file, and the file content of the XML file is the alarm configuration information.
[0065] For example, the process of issuing alarm configuration information is as follows:
[0066] <id> 1< / id> ;
[0067] <name>CPU utilization< / name> ;
[0068] <threshold> 80< / threshold> ;
[0069] <unit> %< / unit> ;
[0070] <cycle> 3< / cycle> ;
[0071] This process means that when the CPU usage of the collected indicator exceeds 80% and exceeds 3 times or more, an alarm is triggered (that is, the data alarm threshold is set).
[0072] Therefore, when the master node needs to send data collection configuration information and alarm configuration information to the slave node, it is found that the master standby process of the slave node (that is, the master process agent node of the slave node) is in a faulty state. In order to ensure the successful issuance of the data collection configuration information and the alarm configuration information and the normal execution of the slave node, it is necessary to establish a connection relationship between the master node and the standby process agent node of the slave node. This connection establishment process is completed by the standby process agent node of the slave node. The standby process agent node of the slave node will detect the status of the master process agent node of the slave node according to the heartbeat mechanism. When it is found that the master process agent node of the slave node fails, it will take over the position of the master process agent node of the slave node and establish a connection with the master node to receive the data collection configuration information and alarm configuration information sent by the master node and execute them.
[0073] Among them, the standby process agent node obtains the connection port of the main process agent node, monitors the connection port, and sends a heartbeat message to the main process agent node once at a preset time interval through the second middleware; if the main process agent node receives the heartbeat message, it is determined that the main process agent node is in a normal state; if the main process agent node does not receive the heartbeat message, it is determined that the main process agent node is in a fault state.
[0074] The present invention provides a master-slave switching mechanism: the state of the master process (the master process refers to the master process management node in the master node and the master process proxy node in the slave node. When the master node and the slave node are in normal state, the master process management node and the master process proxy node perform the work) is monitored through the heartbeat mechanism. When it is detected that the master process is unavailable (wherein, the reasons for unavailability may include: 1. program abnormality, which may be a code problem; 2. operation abnormality, such as memory leak; 3. communication abnormality, heartbeat data cannot be received, and other abnormal exit situations), the standby process quickly takes over the alarm processing task (when the standby process refers to the master process management node in the master node or the master process proxy node in the slave node is in a faulty state, the standby process management node in the master node replaces the master process management node to work, or the standby process proxy node in the slave node replaces the master process proxy node to work).
[0075] The heartbeat mechanism actually refers to the TCP connection between the master process and the standby process. The master process opens a port, such as port 555, and the standby process listens to this port 555, and then sends a heartbeat message every 5 seconds. If both sides can communicate, it means the connection is normal. If the master process does not receive it, it means it is disconnected. Then, the master-slave switching action is performed after the disconnection (that is, the master process management node is switched to the standby process management node, or the master process proxy node is switched to the standby process proxy node). After taking over, the standby process can seamlessly connect to the database and continue to process historical alarm information.
[0076] For master processes: The master process is the master process management node in the master node and the master process proxy node in the slave node. The master process is the first to execute work on the server. The master process of the master node connects to all active master processes of the slave nodes and performs some data collection, alarm calculation, and alarm notification functions.
[0077] The backup process is divided into a primary process agent node and a backup process agent node. (The backup process assumes the responsibilities of the primary process after the primary process exits abnormally.) The backup process primarily synchronizes the primary process's status in real time, including the current step of scheduled tasks, and caches collected data. If the primary process experiences an anomaly, it automatically takes over its functions and becomes the primary process. For example, if the primary process management node of the primary node fails, the backup node will automatically connect to the backup process management node of the primary node and send aggregated metrics and alarm data to the backup process management node.
[0078] Among them, the connection of the master-slave switching is also determined based on the synchronization information. For example, when the main process management node in the master node fails, the standby process management node in the master node needs to take over the work of the main process management node. At this time, the standby process management node will synchronize the connection information of the main process management node to determine whether the main process management node was connected to the main process proxy node of the slave node or the standby process proxy node before the failure. If the main process management node was connected to the main process proxy node of the slave node before the failure, the standby process management node will re-establish the connection with the main process proxy node of the slave node.
[0079] The present invention also provides a database for storing alarm information and historical records. Both the master node and the slave node can connect to the database.
[0080] Furthermore, if the node status of the master process agent node is determined to be normal, the master process management node sends the data collection configuration information and the alarm configuration information to the master process agent node via the first middleware. When the master process agent node receives the data collection configuration information and the alarm configuration information, the standby process agent node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the master process agent node via the third middleware.
[0081] When both the master and slave nodes are operating normally, the master process performs the task. Specifically, the master process management node generates data collection and alarm configuration information and establishes a connection with the master process proxy node of the slave node through the first middleware. The master process management node then sends this information to the master process proxy node of the slave node, which then performs data collection and alarm calculations. Simultaneously, the slave node's backup process proxy node also synchronizes data and alarm information collected by the slave node's master process proxy node.
[0082] Step S20: The standby process agent node performs data collection processing according to the data collection configuration information to obtain target collected data, and performs abnormal data detection processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information.
[0083] Slave nodes include master and backup process agents. Their operation process is as follows: 1. They collect data according to the data collection configuration information issued by the master node and perform alarm calculations according to the alarm configuration information issued by the master node. 2. Alarm generation mechanism: When the collected data exceeds the data alarm threshold, the alarm information is sent to the master node process for alarm notification.
[0084] Specifically, the standby process agent node performs data collection and processing according to the data collection configuration information to obtain target collection data, wherein the target collection data includes server CPU occupancy, IO occupancy, import and export traffic and user-defined indicator data; the standby process agent node obtains the data alarm threshold set in the alarm configuration information, and compares the target collection data with the data alarm threshold; if the data in the target collection data exceeds the data alarm threshold, it is determined that the data exceeding the data alarm threshold is abnormal alarm data, and abnormal alarm information is generated according to the abnormal alarm data.
[0085] The target data is collected by slave nodes through multi-threaded collection. The corresponding data metrics include common indicators such as server CPU utilization, I / O utilization, and import and export traffic. Custom metrics are also available, such as collecting business metrics by collecting keywords from log files or querying databases for statistical metrics. Based on the data collection configuration information issued by the master node, slave nodes set up different threads according to the data collection configuration type and perform data collection according to the data collection configuration information.
[0086] Furthermore, the collection module of the slave node will send the collected data to the alarm module. For example, after collecting the CPU occupancy value, it will be sent to the alarm module. The alarm module detects that it is a CPU indicator based on the type of data transmitted, and compares it with the threshold of the alarm configuration. If the threshold and period requirements are met, an alarm message will be generated.
[0087] Step S30: If the standby process agent node determines that the main process management node of the main node is in a faulty state, it sends the target collected data and the abnormal alarm information to the standby process management node of the main node.
[0088] Generally, the master process agent node of the slave node will connect to the master process management node of the working master node to perform data collection and storage. When aggregation-type collection indicators are generated, the data will be sent to the master process management node of the master node. When an alarm is generated, it will be sent to the master process management node of the master node.
[0089] Specifically, the standby process proxy node obtains the node status of the main process management node through the first middleware; if the node status of the main process management node is a fault state, a connection is established with the standby process management node of the main node through the first middleware; the standby process proxy node sends the target collection data and the abnormal alarm information to the standby process management node.
[0090] After the standby process proxy node has collected the required target collection data and abnormal alarm information, it needs to upload the target collection data and abnormal alarm information to the main node. During this period, the standby process proxy node needs to obtain the status of the main process management node in the main node. If the main process management node is in a faulty state, it needs to connect to the standby process management node in the main node. This connection process is determined by the standby process management node. The standby process management node will obtain the status of the main process management node through the heartbeat mechanism. When it is determined that the status of the main process management node is in a faulty state, it will take over the position of the main process management node and establish a connection with the standby process proxy node through the first middleware.
[0091] Furthermore, if the node status of the primary process management node is normal, the standby process agent node sends the target collection data and the abnormality alarm information to the primary process management node of the primary node through the first middleware. When the primary process management node receives the target collection data and the abnormality alarm information, the standby process management node synchronously obtains the target collection data and the abnormality alarm information obtained by the primary process management node through the second middleware.
[0092] When both the master node and the slave node are in normal operation, the upload of the target collected data and the abnormal alarm information is completed by the master process. That is, after the master process agent node of the slave node obtains the target collected data and abnormal alarm information, it establishes a connection with the master process management node of the master node through the second middleware. The master process agent node of the slave node sends the target collected data and abnormal alarm information to the master process management node of the master node, which then performs data visualization. At the same time, the backup process management node of the master node also synchronizes the data and alarm information collected by the master process management node of the master node.
[0093] Step S40: The standby process management node reports and visualizes the target collected data and the abnormal alarm information.
[0094] Furthermore, the master node aggregates the alarm data uploaded by the slave nodes and determines whether an aggregated alarm is required. If an aggregated alarm is required, the master node stores the alarm information and then waits for all slave nodes to report the alarm before performing alarm calculation and notification.
[0095] Aggregate alarms are also based on system configurations, such as detecting the CPU operation status of the entire server cluster. For example:
[0096] <id>< / id> ;
[0097] <name>CPU utilization< / name> ;
[0098] <converge> 192.0.0.1,192.0.0.2< / converge> ;
[0099] <threshold> 80< / threshold> ;
[0100] <type>Single / multiple< / type> ;
[0101] This example shows an aggregate indicator. When the CPU usage of both servers reaches or one of them reaches the threshold (whether it is a single or multiple thresholds, determined by the configuration in type), an aggregate alarm is generated.
[0102] Regarding the alarm processing mechanism provided by the present invention: This invention uses a message queue to send alarm information in the form of messages, ensuring that even in the event of a master node failure, the slave nodes can receive the alarm information. Furthermore, when the master node receives the alarm information from the slave nodes, it needs to implement alarm deduplication and priority sorting to ensure that important alarms can be processed promptly.
[0103] Regarding the alarm notification mechanism set up in the present invention: the present invention supports multiple notification methods (such as email, SMS, and instant messaging, etc.), and selects the appropriate notification method for alarm push according to the preset priority. Furthermore, an alarm receipt mechanism is implemented to ensure that operation and maintenance personnel receive alarm notifications in a timely manner.
[0104] Regarding system scalability: Support horizontal expansion and enhance system availability by increasing the number of slave nodes.
[0105] In summary, the present invention can effectively improve the high availability of the operation and maintenance alarm system in the master-slave architecture, ensure that the business can still respond quickly in the face of failures, ensure the stability and reliability of the system, significantly reduce human intervention, and improve operation and maintenance efficiency.
[0106] Furthermore, based on the above-mentioned operation and maintenance alarm method based on the master-slave architecture, the present invention also provides an operation and maintenance alarm system based on the master-slave architecture, wherein the operation and maintenance alarm system based on the master-slave architecture includes:
[0107] A master node, a slave node, and middleware, wherein the master node includes a master process management node and a standby process management node, the slave node includes a master process proxy node and a standby process proxy node, and the middleware includes a first middleware, a second middleware, and a third middleware, the master node and the slave node establish a connection via the first middleware, the master process proxy node and the standby process proxy node establish a connection via the second middleware, and the master process proxy node and the standby process proxy node establish a connection via the third middleware;
[0108] The master process management node of the master node is used to generate data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, the data collection configuration information and the alarm configuration information are sent to the standby process agent node of the slave node;
[0109] The standby process agent node is used to perform data collection and processing according to the data collection configuration information to obtain target collected data, and perform abnormal data detection and processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information;
[0110] The standby process agent node is further configured to send the target collected data and the abnormal alarm information to the standby process management node of the master node if it is determined that the master process management node of the master node is in a fault state;
[0111] The standby process management node is used to report and visualize the target collection data and the abnormal alarm information.
[0112] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. An operation and maintenance alarm method based on a master-slave architecture, characterized in that: The operation and maintenance alarm method based on the master-slave architecture is applied to an operation and maintenance alarm system based on the master-slave architecture, wherein the operation and maintenance alarm system based on the master-slave architecture includes a master node and a slave node; the master node includes a master process management node and a standby process management node; The slave nodes include a master process agent node and a standby process agent node; The operation and maintenance alarm method based on the master-slave architecture includes: The master process management node of the master node generates data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, sends the data collection configuration information and the alarm configuration information to the standby process agent node of the slave node; The standby process agent node performs data collection processing according to the data collection configuration information to obtain target collected data, and performs abnormal data detection processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information; If the standby process agent node determines that the main process management node of the main node is in a fault state, the standby process agent node sends the target collection data and the abnormal alarm information to the standby process management node of the main node; The standby process management node reports and visually displays the target collected data and the abnormal alarm information.
2. The operation and maintenance alarm method based on the master-slave architecture according to claim 1 is characterized in that: The master node and the slave node establish a connection through a first middleware; the master process management node and the standby process management node establish a connection through a second middleware; the master process proxy node and the standby process proxy node establish a connection through a third middleware; The master process management node of the master node generates data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, sends the data collection configuration information and the alarm configuration information to the standby process agent node of the slave node, specifically including: The master process management node of the master node obtains user demand information, and generates data collection configuration information and alarm configuration information according to the user demand information; The master process management node obtains the node status of the master process proxy node through the first middleware, and if it is determined that the node status of the master process proxy node is a fault state, establishes a connection with the standby process proxy node of the slave node through the first middleware; The main process management node sends the data collection configuration information and the alarm configuration information to the standby process agent node.
3. The operation and maintenance alarm method based on the master-slave architecture according to claim 2 is characterized in that: The master process management node obtains the node status of the master process agent node through the first middleware, and the process also includes: The standby process proxy node obtains the connection port of the active process proxy node, monitors the connection port, and sends a heartbeat message to the active process proxy node once every preset time interval through the second middleware; If the master process agent node receives the heartbeat message, it is determined that the master process agent node is in a normal state; If the master process agent node does not receive the heartbeat message, it is determined that the master process agent node is in a fault state.
4. The operation and maintenance alarm method based on the master-slave architecture according to claim 2 is characterized in that: The master process management node obtains the node status of the master process agent node through the first middleware, and then further includes: If it is determined that the node status of the main process agent node is normal, the main process management node sends the data collection configuration information and the alarm configuration information to the main process agent node through the first middleware.
5. The operation and maintenance alarm method based on the master-slave architecture according to claim 4 is characterized in that: If it is determined that the node status of the master process agent node is normal, the master process management node sends the data collection configuration information and the alarm configuration information to the master process agent node through the first middleware, and then further includes: When the main process agent node receives the data collection configuration information and the alarm configuration information, the standby process agent node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the main process agent node through the third middleware.
6. The operation and maintenance alarm method based on the master-slave architecture according to claim 1 is characterized in that: The standby process agent node performs data collection processing according to the data collection configuration information to obtain target collected data, and performs abnormal data detection processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information, specifically including: The standby process agent node performs data collection and processing according to the data collection configuration information to obtain target collection data, wherein the target collection data includes server CPU occupancy rate, IO occupancy rate, import and export traffic, and user-defined indicator data; The standby process agent node obtains the data alarm threshold set in the alarm configuration information, and compares the target collected data with the data alarm threshold; If the data in the target collected data exceeds the data alarm threshold, the data exceeding the data alarm threshold is determined to be abnormal alarm data, and abnormal alarm information is generated according to the abnormal alarm data.
7. The operation and maintenance alarm method based on the master-slave architecture according to claim 2 is characterized in that: If the standby process agent node determines that the main process management node of the main node is in a fault state, sending the target collection data and the abnormal alarm information to the standby process management node of the main node specifically includes: The standby process agent node obtains the node status of the main process management node through the first middleware; If the node status of the main process management node is a fault state, establishing a connection with the backup process management node of the main node through the first middleware; The standby process agent node sends the target collected data and the abnormal alarm information to the standby process management node.
8. The operation and maintenance alarm method based on the master-slave architecture according to claim 7 is characterized in that: The standby process agent node obtains the node status of the main process management node through the first middleware, and then further includes: If the node status of the main process management node is normal, the standby process agent node sends the target collection data and the abnormal alarm information to the main process management node of the master node through the first middleware.
9. The operation and maintenance alarm method based on the master-slave architecture according to claim 8 is characterized in that: If the node status of the main process management node is normal, the standby process agent node sends the target collection data and the abnormal alarm information to the main process management node of the main node through the first middleware, and then further includes: When the main process management node receives the target collection data and the abnormal alarm information, the standby process management node synchronously obtains the target collection data and the abnormal alarm information obtained by the main process management node through the second middleware.
10. An operation and maintenance alarm system based on a master-slave architecture, characterized in that: The operation and maintenance alarm system based on the master-slave architecture includes: a master node, a slave node, and middleware, wherein the master node includes a master process management node and a standby process management node, the slave node includes a master process proxy node and a standby process proxy node, the middleware includes a first middleware, a second middleware, and a third middleware, the master node and the slave node establish a connection via the first middleware, the master process proxy node and the standby process proxy node establish a connection via the second middleware, and the master process proxy node and the standby process proxy node establish a connection via the third middleware; The master process management node of the master node is used to generate data collection configuration information and alarm configuration information, and if it is determined that the master process agent node of the slave node is in a fault state, the data collection configuration information and the alarm configuration information are sent to the standby process agent node of the slave node; The standby process agent node is used to perform data collection and processing according to the data collection configuration information to obtain target collected data, and perform abnormal data detection and processing on the target collected data according to the alarm configuration information to obtain abnormal alarm information; The standby process agent node is further configured to send the target collected data and the abnormal alarm information to the standby process management node of the master node if it is determined that the master process management node of the master node is in a fault state; The standby process management node is used to report and visualize the target collection data and the abnormal alarm information.
Citation Information
Patent Citations
Alarm method, system, electronic device and storage medium
CN109039733A
Cluster process management method and device
CN111639006A