Operation and maintenance alarm method and system based on master-slave architecture
By setting up middleware in the master-slave architecture of the operation and maintenance alarm system, master-slave switching is achieved, the system service interruption caused by master node failure is solved, and the system stability and reliability are improved.
Patent Information
- Application Number
- CN202411798479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In some scenarios, the master-slave architecture adopted by the operation and maintenance alarm service in the prior art will cause system service interruption due to master node failure, affecting the implementation of the operation and maintenance alarm service.
A master-slave architecture-based operation and maintenance alarm method is designed, and the master-slave switching is realized by setting middleware between the master node and the slave node. When a master or slave node fails, the backup proxy node or backup management node takes over its responsibilities to ensure the synchronization and processing of alarm data.
It effectively solves the problem that the operation and maintenance system cannot alarm normally due to the main process failure, improves the stability and reliability of the operation and maintenance alarm system, and ensures that the business can still respond quickly when facing failures.
Smart Images

Figure CN119847580A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the 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 the operation and maintenance alarm service often leads to system service interruption due to failure of the master node in the master-slave architecture in certain scenarios, thereby affecting the implementation of the operation and maintenance alarm service and failing to meet the operation and maintenance alarm needs of the enterprise.
[0004] Therefore, the prior art 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 due to the failure of the master node in the master-slave architecture in certain scenarios, 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, and the operation and maintenance alarm method based on a master-slave architecture comprises 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 proxy 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 proxy node of the slave node;
[0008] The standby process proxy node performs data collection processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information;
[0009] If the standby process proxy node determines that the main process management node of the main node is in a faulty state, the target collection data and the abnormal alarm information are sent to the standby process management node of the main node;
[0010] The standby process management node reports and visualizes the target collection 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; 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 proxy 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 proxy 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 proxy node through the first middleware, further comprising:
[0017] The standby process proxy node obtains the connection port of the main process proxy node, monitors the connection port, and sends a heartbeat message to the main process proxy node once at a preset interval through the second middleware;
[0018] If the master process proxy node receives the heartbeat message, it is determined that the master process proxy node is in a normal state;
[0019] If the master process proxy node does not receive the heartbeat message, it is determined that the master process proxy node is in a fault state.
[0020] Optionally, in the operation and maintenance alarm method based on the master-slave architecture, the master process management node obtains the node status of the master process proxy node through the first middleware, and then further includes:
[0021] If it is determined that the node state 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 state 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 proxy node receives the data collection configuration information and the alarm configuration information, the standby process proxy node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the main process proxy 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 acquisition data, and performs abnormal data detection processing on the target acquisition data according to the alarm configuration information to obtain abnormal alarm information, specifically includes:
[0025] The standby process proxy node performs data collection 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 proxy node determines that the master process management node of the master node is in a faulty state, the target collection 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 faulty state, establishing a connection with the standby process management node of the main node through the first middleware;
[0031] The standby process proxy node sends the target collection 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, and then further includes:
[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 main 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 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 through the first middleware, the master process proxy node and the standby process proxy node establish a connection through the second middleware, and the master process proxy node and the standby process proxy 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 proxy 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 proxy node of the slave node;
[0038] The standby process proxy node is used to perform data collection processing according to the data collection configuration information to obtain target collection data, and perform abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information;
[0039] The standby process proxy node is further configured to send the target collection 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 in the memory and executable on the processor, wherein the operation and maintenance alarm program based on the master-slave architecture implements the steps of the operation and maintenance alarm method based on the master-slave architecture as described above when executed by the processor.
[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 the master-slave architecture is executed by a processor, the steps of the operation and maintenance alarm method based on the 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 proxy node of the slave node is in a faulty state, the data collection configuration information and the alarm configuration information are sent to the standby process proxy node of the slave node; the standby process proxy node performs data collection processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information; if the standby process proxy node determines that the main process management node of the master node is in a faulty 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 a master node and a slave node on the basis of a master-slave architecture. When a master process management node in the master node or a master process proxy node in the slave node fails, a backup process for data synchronization by the middleware, such as a backup process management node or a 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 a master process failure, and effectively improves the stability and reliability of the operation and maintenance alarm system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It 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 solution and advantages of the present invention clearer and more specific, 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 used 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 the operation and maintenance alarm service often causes system service interruptions in certain scenarios due to failures of the master node in the master-slave architecture, which affects the implementation of the operation and maintenance alarm service and cannot meet the operation and maintenance alarm needs of enterprises. Therefore, it is particularly important to design a highly available master-slave operation and maintenance alarm mechanism.
[0049] To solve the above problems, the present invention provides an operation and maintenance alarm method based on a master-slave architecture. The scheme 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, and if it is determined that the master process proxy node of the slave node is in a faulty state, the data collection configuration information and the alarm configuration information are sent to the standby process proxy node of the slave node. Wherein, the master node and the slave node establish a connection through the first middleware; the master process management node and the standby process management node establish a connection through the second middleware; the master process proxy node and the standby process proxy node establish a connection through the third middleware.
[0052] like Figure 2 FIG. 1 is a schematic diagram of a network communication framework provided in the present invention. Figure 2 The connection lines in the figure indicate that this middleware is used for communication connection, such as 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, all of which are communication connections made 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 proxy node and the standby process proxy node in the slave node are connected through the middleware. When the standby process proxy node detects that the master process proxy node is suddenly disconnected, that is, the connection is disconnected, the standby process proxy 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 according to 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 the node status of the main process agent node is determined to be 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 to generate 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 indicators of the servers, 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 issued.
[0057] For example, the process of sending data collection configuration information is as follows:
[0058] <id> 1< / id> ;
[0059] <name> CPU usage< / name> ;
[0060] <type> shell< / type> ;
[0061] <code> mpstat1 1|awk' / ^Average: / {print 100-NF}'< / code> ;
[0062] <cycle> 5s< / cycle> ;
[0063] This process indicates that the CPU usage indicator is collected every 5 seconds. The collection type is shell script execution. 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 usage< / 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 and execute the data collection configuration information and alarm configuration information sent by the master node.
[0073] Among them, the standby process proxy node obtains the connection port of the main process proxy node, monitors the connection port, and sends a heartbeat message to the main process proxy node once at a preset interval through the second middleware; if the main process proxy node receives the heartbeat message, it is determined that the main process proxy node is in a normal state; if the main process proxy node does not receive the heartbeat message, it is determined that the main process proxy node is in a faulty 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, and when the master node and the slave node are in normal state, the master process management node and the master process proxy node 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, abnormal exit such as failure to receive heartbeat data), 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 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-standby 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 the master process: 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 the working slave node master processes to perform partial data collection, alarm calculation and alarm notification functions.
[0077] For the standby process: it is divided into the main process proxy node and the standby process proxy node (the role of the standby process is to assume the responsibilities of the main process after the main process exits abnormally). The standby process is mainly to synchronize the status of the main process in real time, the step currently executed by the main process scheduled task in real time, cache the collected data, etc. When the main process is abnormal, it can automatically take over the functions of the main process and become the main process itself. For example, when the main process management node of the main node fails, the slave node will automatically connect to the standby process management node of the main node and send the aggregated indicators and alarm data to the standby 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, and both the master node and the slave node can be connected to the database.
[0080] Furthermore, if it is determined that the node state of the main process proxy node is normal, the main process management node sends the data collection configuration information and the alarm configuration information to the main process proxy node through the first middleware. When the main process proxy node receives the data collection configuration information and the alarm configuration information, the standby process proxy node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the main process proxy node through the third middleware.
[0081] When both the master node and the slave node are in a normal state, the master process is used to complete the process, that is, the master process management node of the master node generates data collection configuration information 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 of the master node sends the data collection configuration information and alarm configuration information to the master process proxy node of the slave node, and the master process proxy node of the slave node performs data collection and alarm calculation. At the same time, the standby process proxy node of the slave node will also synchronize the data and alarm information collected by the master process proxy node of the slave node.
[0082] Step S20: the standby process proxy node performs data collection processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information.
[0083] The slave nodes include the master process proxy node and the standby process proxy node, and their working process is as follows: 1. Perform data collection according to the data collection configuration information issued by the master node and perform alarm calculation 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 proxy node performs data collection 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 proxy 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] Among them, the target collection data is obtained by multi-threaded collection from the slave node. The data indicators corresponding to the target collection data include general indicators such as server CPU occupancy, IO occupancy, import and export traffic, etc. There are also some custom indicators, such as collecting a keyword in a log file to collect business indicators, and querying the database for statistical acquisition of indicators. According to the data collection configuration information issued by the master node, the slave node sets different threads according to the data collection configuration information according to different types to collect data.
[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 transmission, 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 proxy node determines that the main process management node of the main node is in a faulty state, the target collection data and the abnormal alarm information are sent 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 faulty 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] When 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] Further, if the node state of the main process management node is normal, the standby process proxy 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. 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.
[0092] When both the master node and the slave node are in a normal state, the upload of the target collection 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 collection data and the abnormal alarm information, it establishes a connection with the master process management node of the master node through the second middleware, and the master process agent node of the slave node sends the target collection data and the abnormal alarm information to the master process management node of the master node, and the master process management node of the master node performs data visualization display. At the same time, the standby process management node of the master node will also synchronize 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 collection data and the abnormal alarm information.
[0094] Furthermore, the master node aggregates the alarm data uploaded by the slave nodes to determine whether an aggregate alarm is required. If an aggregate 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] Among them, the aggregate alarm is also based on the system configuration, such as detecting the CPU operation status of the entire server cluster, as shown below:
[0096] <id>< / id> ;
[0097] <name> CPU usage< / name> ;
[0098] <converge> 192.0.0.1,192.0.0.2< / converge> ;
[0099] <threshold> 80< / threshold> ;
[0100] <type> Single / multiple< / type> ;
[0101] This example is an aggregate indicator. When the CPU usage of both servers reaches or one of them reaches the threshold (determined by the configuration in type, whether it is a single or multiple), an aggregate alarm is issued.
[0102] Regarding the alarm processing mechanism set in the present invention: the present invention uses a message queue to send the alarm information in the form of a message to ensure that the slave node can receive the alarm information even when the master node fails. At the same time, when the master node receives the alarm information from the slave node, it is necessary to implement alarm deduplication and priority sorting to ensure that important alarms can be processed in a timely manner.
[0103] Regarding the alarm notification mechanism set in the present invention: the present invention supports multiple notification methods (such as email, SMS and instant message, 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 the operation and maintenance personnel receive the alarm notification in time.
[0104] For 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 when facing a failure, ensure the stability and reliability of the system, significantly reduce human intervention, and improve operation and maintenance efficiency.
[0106] Further, 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 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 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 through the first middleware, the master process proxy node and the standby process proxy node establish a connection through the second middleware, and the master process proxy node and the standby process proxy node establish a connection through 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 proxy 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 proxy node of the slave node;
[0109] The standby process proxy node is used to perform data collection processing according to the data collection configuration information to obtain target collection data, and perform abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information;
[0110] The standby process proxy node is further configured to send the target collection 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 ordinary technicians in this field, 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 the operation and maintenance alarm system based on the master-slave architecture, and 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 proxy node and a standby process proxy 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 proxy 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 proxy node of the slave node; The standby process proxy node performs data collection processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information; If the standby process proxy node determines that the main process management node of the main node is in a faulty state, the target collection data and the abnormal alarm information are sent to the standby process management node of the main node; The standby process management node reports and visualizes the target collection 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 proxy 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 proxy 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 main process management node obtains the node status of the main process agent node through the first middleware, and the process also includes: The standby process proxy node obtains the connection port of the main process proxy node, monitors the connection port, and sends a heartbeat message to the main process proxy node once at a preset interval through the second middleware; If the master process proxy node receives the heartbeat message, it is determined that the master process proxy node is in a normal state; If the master process proxy node does not receive the heartbeat message, it is determined that the master process proxy 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 main process management node obtains the node status of the main process agent node through the first middleware, and then further includes: If it is determined that the node state 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 state of the main process proxy node is normal, the main process management node sends the data collection configuration information and the alarm configuration information to the main process proxy node through the first middleware, and then further includes: When the main process proxy node receives the data collection configuration information and the alarm configuration information, the standby process proxy node synchronously obtains the data collection configuration information and the alarm configuration information obtained by the main process proxy 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 proxy node performs data collection processing according to the data collection configuration information to obtain target collection data, and performs abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information, specifically including: The standby process proxy node performs data collection 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 proxy 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 faulty state, establishing a connection 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.
8. The operation and maintenance alarm method based on the master-slave architecture according to claim 7 is characterized in that: The standby process proxy 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 main 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 state of the main process management node is normal, the standby process proxy 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 through the first middleware, the master process proxy node and the standby process proxy node establish a connection through the second middleware, and the master process proxy node and the standby process proxy node establish a connection through 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 proxy 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 proxy node of the slave node; The standby process proxy node is used to perform data collection processing according to the data collection configuration information to obtain target collection data, and perform abnormal data detection processing on the target collection data according to the alarm configuration information to obtain abnormal alarm information; The standby process proxy node is further configured to send the target collection 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
Abnormality detection method and device, equipment, medium and program product
CN114244693A