CN110944047A - Distributed application monitoring method and device - Google Patents

Distributed application monitoring method and device Download PDF

Info

Publication number
CN110944047A
CN110944047A CN201911189614.8A CN201911189614A CN110944047A CN 110944047 A CN110944047 A CN 110944047A CN 201911189614 A CN201911189614 A CN 201911189614A CN 110944047 A CN110944047 A CN 110944047A
Authority
CN
China
Prior art keywords
application
application instance
record
instance
data storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911189614.8A
Other languages
Chinese (zh)
Inventor
樊世雄
黄艺杰
钟艳辉
胡涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201911189614.8A priority Critical patent/CN110944047A/en
Publication of CN110944047A publication Critical patent/CN110944047A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a distributed application monitoring method and device, and agent applications used for monitoring monitored applications are deployed in each application server. And the agent application acquires the state data of the monitored application and writes the state data into the data storage component. The master application obtains the status of the monitored application from the data storage component. According to the scheme, the action of writing the state data into the data storage component is separated from the application through the proxy application, so that the monitoring on the application which is not autonomously developed is realized.

Description

Distributed application monitoring method and device
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a distributed application monitoring method and device.
Background
Distributed applications refer to applications that are distributed over multiple computers to work in concert. The existing distributed application state monitoring scheme requires that the monitored application is written or deployed based on a specific mode, so that software of one monitoring application can only monitor the distributed application based on the software framework, for example, software of a distributed service application can only monitor the application based on the Dubbo framework; kubernets can only monitor applications in containers managed on a kubernets basis. It is difficult to meet the monitoring requirements of old systems or systems with complex application types, unless the old systems or systems with complex application types are modified, but the modification is complex and costly.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for monitoring a distributed application, so as to implement status monitoring on the distributed application without modifying a code of the distributed application itself, where a specific technical scheme is as follows:
in one aspect, the present application provides a distributed application monitoring method, which is applied to a monitoring system, where the monitoring system includes: the system comprises a main control application deployed in a monitoring server, a data storage component used for storing state data and a plurality of agent applications, wherein the agent applications are deployed in application servers where application instances of the distributed applications are deployed; the method comprises the following steps:
for any agent application, the agent application monitors the state of a monitored application instance deployed in an application server where the agent application is located, and writes the state of the monitored application instance into the data storage component;
and the master control application detects the monitored application instance with changed state data in the data storage component and updates the changed state data to the monitoring state of the monitored application instance.
In a possible implementation manner, the writing the state of the monitored application instance into the data storage component includes:
when the agent application monitors a newly started application instance, establishing a corresponding application record for the application to which the application instance belongs in the data storage component;
when the agent application monitors newly started application instances, establishing a corresponding application instance running record for each newly started application instance in the data storage component;
when the agent application monitors that the monitored application instance stops running, deleting an application instance running record corresponding to the monitored application instance from the data storage component;
the agent application creates an application instance record for each application instance deployed in the application server where the agent application is located in the data storage component;
and when the agent application monitors that the state of the monitored application instance is switched from the running state to the stopping state, deleting the application instance record corresponding to the monitored application instance from the data storage component.
In another possible implementation manner, the detecting, by the master application, a monitored application instance in which state data in the data storage component changes, and updating the changed state data to a monitoring state of the monitored application instance by the master application includes:
when the master control application monitors that the application record is newly added or deleted in the data storage component, adding or deleting the record of the application corresponding to the application record;
when the master control application monitors that the application instance records are newly added or deleted in the data storage component, adding or deleting the records of the application instance corresponding to the application instance records;
when the master control application monitors that the application instance running record is newly added in the data storage component, updating the state of the application instance corresponding to the application instance running record into a running state;
and when the master control application monitors that the application instance running record is deleted from the data storage component, updating the state of the application instance corresponding to the application instance running record to stop running.
In another possible implementation manner, after the agent application monitors a newly started application instance, creating a corresponding application record for an application to which the application instance belongs in the data storage component, where the creating includes:
when the agent application monitors a newly started application instance, acquiring an application identifier of an application to which the newly started application instance belongs;
and judging whether an application record corresponding to the application identifier exists in the data storage component, and if not, creating an application record corresponding to the application to which the application instance belongs in the data storage component.
In another possible implementation manner, the monitoring, by each agent application, the state of the monitored application instance deployed in the application server where the agent application is located includes:
after the agent application is started, determining a monitoring script corresponding to the monitored application instance according to a mapping relation between a pre-configured application instance and the monitoring script;
and calling a monitoring script corresponding to the monitored application instance to monitor the state of the monitored application instance.
On the other hand, this application still provides a distributed application monitoring device, includes: the system comprises an agent monitoring module, a data storage component and a main control module;
the agent monitoring module is used for monitoring the state of a monitored application instance deployed in an application server where the agent monitoring module is located and writing the state of the monitored application instance into the data storage component;
the main control module is used for detecting the monitored application instance with changed state data in the data storage component and updating the changed state data to the monitoring state of the monitored application instance.
In one possible implementation, the agent monitoring module includes:
the application record creating sub-module is used for creating a corresponding application record for the application to which the application instance belongs in the data storage component after the agent application monitors a newly started application instance;
the application instance running record creating sub-module is used for creating a corresponding application instance running record for each newly started application instance in the data storage component after the agent application monitors the newly started application instance;
the application instance running record deleting sub-module is used for deleting the application instance running record corresponding to the monitored application instance from the data storage component after the agent application monitors that the monitored application instance stops running;
an application instance record creating submodule, configured to create, by the agent application, an application instance record for each application instance deployed in an application server where the agent application is located in the data storage component;
and the application instance record deleting submodule is used for deleting the application instance record corresponding to the monitored application instance from the data storage component after the agent application monitors that the state of the monitored application instance is switched from the running state to the stopping state.
In another possible implementation manner, the main control module includes:
the application record modification sub-module is used for adding or deleting the application record corresponding to the application record after the master control application monitors that the application record is newly added or deleted in the data storage assembly;
the application instance record modification submodule is used for adding or deleting the record of the application instance corresponding to the application instance record when the master control application monitors that the application instance record is newly added or deleted in the data storage component;
the application instance running state modification submodule is used for updating the state of the application instance corresponding to the application instance running record into a running state after the master control application monitors that the application instance running record is newly added into the data storage component; or, after the master control application monitors that the application instance running record is deleted from the data storage component, updating the state of the application instance corresponding to the application instance running record to stop running.
In another possible implementation manner, the agent monitoring module, when configured to monitor a state of a monitored application instance deployed in an application server where the agent monitoring module is located, is specifically configured to:
after the agent monitoring module is started, determining a monitoring script corresponding to the monitored application instance according to a mapping relation between a pre-configured application instance and the monitoring script;
and calling a monitoring script corresponding to the monitored application instance to monitor the state of the monitored application instance.
In yet another aspect, the present application further provides a storage medium having a program stored thereon, where the program is loaded by a processor and executed by the processor, and the distributed application monitoring method described in any one of the above.
According to the distributed application monitoring method, the agent application used for monitoring the monitored application is deployed in each application server. And the agent application acquires the state data of the monitored application and writes the state data into the data storage component. The master application obtains the status of the monitored application from the data storage component. According to the scheme, the action of writing the state data into the data storage component is separated from the application through the proxy application, so that the monitoring on the application which is not autonomously developed is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a distributed application monitoring system according to an embodiment of the present invention;
fig. 2 is a flowchart of a distributed application monitoring method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another distributed application monitoring method provided by an embodiment of the invention;
FIG. 4 is a flowchart of a distributed application monitoring method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a distributed application monitoring apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic structural diagram of a distributed application monitoring system according to an embodiment of the present invention is shown, where as shown in fig. 1, the monitoring system includes a master application, a data storage component, and a plurality of agent applications; wherein, the master application is the master program.
The agent application is an agent program, and data interaction between the application front end and the application server is forwarded through the agent application, so that the agent application can monitor any type of application system and does not need to modify the application itself.
Each application server is deployed with a proxy application, and each proxy application is used for monitoring the running state of an application instance deployed on the application server where the proxy application is located. An application instance is an instance of an application that has been deployed, e.g., a distributed application has two application instances if one is deployed on each of two servers.
An application server refers to a computer, typically a server, that deploys application instances of distributed applications.
The master control application is deployed on a monitoring server, the data storage component may be deployed on the monitoring server, or the data storage component may also be deployed on a distributed server cluster alone, for example, the data storage component may adopt a database component, or the data storage component is also realized by a ZooKeeper component.
In one embodiment of the present invention, the host application includes a web service thread providing a monitoring page, and a data listening thread, for example, listening for data changes in a data storage component. The agent application comprises: the monitoring system comprises a configuration file containing a list of monitored applications and a monitoring script of each monitored application, and a thread for calling the monitoring script of the monitored application and writing a new state into a data storage component when the application state changes.
The monitoring page comprises a home page and an application page; the home page displays a list, and each item in the list corresponds to one monitored application, the number of deployed applications and the number of running applications. The application page displays a list, each item in the list corresponds to an application instance, and the name of a server where the application instance is located and whether the application instance is running are displayed.
The distributed application monitoring system roughly works as follows: each agent application monitors the state data of the application instance on the application server where the agent application is located and writes the state data into the data storage component. The master control application actively reads the state data of the application instance from the data storage component and displays the state data on a front-end page.
The specific monitoring process will be described in detail below with reference to a flowchart of a distributed application monitoring method.
Referring to fig. 2, a flowchart of a distributed application monitoring method according to an embodiment of the present invention is shown, where the method includes the following steps:
s110, for any agent application, the agent application monitors the state of the monitored application instance deployed in the application server where the agent application is located, and writes the state of the monitored application instance into the data storage component.
The application server may have a plurality of application instances deployed therein, and the agent application deployed in the application server monitors the application instances regardless of the number of monitored application instances in the application server.
The proxy application calls the monitoring script to monitor the state of the monitored application instance, and specifically, the proxy application is configured with a monitored application instance list and a configuration file of the monitoring script of each monitored application instance in advance.
And adding or deleting the configuration information of the monitored application instance in the configuration file to realize the range of the monitored application instance monitored by the agent application.
After the agent application is started, the monitoring script corresponding to the current monitored application instance is determined according to the mapping relation between the pre-configured monitored application instance and the monitoring script. Then, each monitoring script is called regularly to obtain the state of the corresponding application instance (for example, calling every 3 s). Then, the agent application writes the monitored state data of the monitored application instance into the data storage component.
S120, the master control application detects the monitored application instance with changed state data in the data storage component, and updates the changed state data to the monitoring state of the monitored application instance.
The master control application can actively monitor whether the state data in the data storage component changes, and when the change is monitored, the running state of the monitored application instance is updated by using the monitored application instance with the changed state data.
The running state of the monitored application instance comprises a running state and a stopping state.
In the distributed application monitoring method provided by this embodiment, a proxy application for monitoring a monitored application is deployed in each application server. And the agent application acquires the state data of the monitored application and writes the state data into the data storage component. The master application obtains the status of the monitored application from the data storage component. According to the scheme, the action of writing the state data into the data storage component is separated from the application through the proxy application, so that the monitoring on the application which is not autonomously developed is realized.
According to the scheme, the state monitoring of the monitored application is finally realized by utilizing the agent application, the data storage component and the master control application. In addition, the scheme realizes the application monitoring by utilizing the agent application without modifying the code of the monitored application, thereby being suitable for any distributed application system and having low cost.
Referring to fig. 3, a flow chart of another distributed application monitoring method provided by the present invention is shown, which includes the following steps:
and S210, after the agent application is started, calling each monitoring script to monitor each application instance deployed on the application server.
S220, after the agent application monitors the newly started application instance, a corresponding application record is created for the application to which the application instance belongs in the data storage component.
The data storage component in this embodiment may adopt a distributed data storage component, for example, a ZooKeeper component, to reduce the development amount of the master application.
After monitoring a newly started application instance by the agent application, judging whether an application record corresponding to the application to which the application instance belongs exists in the data storage component or not, and if so, not creating the application record corresponding to the application; and if not, creating an application record corresponding to the application. The application records in the data storage component represent monitored applications, and each monitored application corresponds to one application record.
The newly started application instance comprises an application instance which is monitored to be restarted by the agent application after stopping, or the agent application discovers the running application instance for the first time.
The agent application stores the state record of the monitored application instance, and the agent application stores the state record of the monitored application instance according to the stored state record and the currently monitored state of the monitored application instance.
For example, the agent application finds that an application instance is in a stop state in the last monitoring period, and the current monitoring period becomes a running state, and determines that the application instance is restarted. For another example, if the agent application monitors that an application instance is running, but the status record does not include the status record of the application instance, it is determined that the application agent is the application instance which is found to be running for the first time.
And S230, after the master control application monitors that the application records are newly added or reduced in the data storage component, adding or reducing the application records corresponding to the application records.
After monitoring that the application records are newly added or reduced in the data storage component, the master control application correspondingly adds or reduces the application record information corresponding to the application records on the monitoring page.
The monitoring page may be a web page, and may also be a page of an application program or an applet for implementing application monitoring, which is not limited herein.
S240, the agent application creates a corresponding application record for the application instance monitored by the agent application in the data storage component according to the monitored application instance in the configuration file; and deleting the application record corresponding to the monitored application instance after detecting that the state of the monitored application instance is in a stop state.
An application instance record represents an application instance, and the application instance record is used for recording the application instance monitored by the agent application.
After the agent application is started, an application instance record is created for each monitored application according to the monitored application list in the configuration file of the agent application. And meanwhile, when the agent application detects that the state of the monitored application instance is in a stop state, deleting the application instance record corresponding to the monitored application instance in the data storage component.
And S250, when the master control application monitors that the application instance records are newly added or deleted in the data storage component, adding or deleting the application instance records corresponding to the application instance records.
And when the master control application monitors that the application instance record is newly added or deleted in the data storage component, correspondingly newly adding or deleting the record information corresponding to the application instance record on the application page of the monitoring page.
And S260, when the agent application monitors a newly started or stopped application example, creating or deleting an application example running record corresponding to the application example in the data storage component.
And the parent corresponding to the running record of each application instance is the application of the application to which the application instance belongs.
The application instance running record indicates that the application instance corresponding to the application instance running record is in a running state.
And when the agent application monitors a newly started application instance, creating an application instance running record corresponding to the application instance in the data storage component. And when the agent application monitors that the application example stops running, deleting the application example running record corresponding to the application example in the data storage component.
The process of monitoring the newly started application instance by the proxy application is the same as the monitoring process in S220, and is not described herein again.
And S270, after monitoring that the application instance running record is newly added or deleted in the data storage component, the master control application updates the state of the application instance.
If the master control application monitors that an application instance running record is newly added in the data storage assembly, updating the state of the application instance to be running on a monitoring page; and if the master control application monitors that an application instance running record is deleted from the data storage component, updating the state of the application instance to stop on the monitoring page.
In the distributed application monitoring method provided by this embodiment, the state of the monitored application is monitored by using the agent application, and the monitored new state data is written into the data storage component, that is, the monitoring action is implemented by the agent program independent from the monitored application, so that the monitoring function can be implemented without modifying the monitored application itself. And the data storage component for storing the state data of the monitored application and the master control application are independent from each other, so that the development amount of the master control application is reduced.
Referring to fig. 4, a flowchart of another distributed application monitoring method provided in the embodiment of the present invention is shown, where the method includes the following steps:
s310, after the agent application is started, adding an application instance record node "/apps/[ app-name ]/agents/[ hostname ]" into the ZooKeeper.
The app-name is the name of the monitored application, and the hostname is the name of the server where the monitored application is located.
The node of "/apps/[ app-name ]/agents/[ hostname ]" is a temporary node, and after the agent application is started, a node of "/apps/[ app-name ]/agents/[ hostname ]" is created for each monitored application instance in the self configuration file.
It should be noted that, in the ZooKeeper component, the application records, the application instance operation records, and the like referred to above are all stored in the form of nodes.
And S320, when the agent application detects that the configuration file does not contain the configuration information of the monitored application, deleting the application instance record corresponding to the monitored application from the ZooKeeper.
For example, when it is detected that the configuration file does not contain the configuration information of the application instance B and the ZooKeeper contains an application instance record with the application name "B", the application instance record is deleted from the ZooKeeper.
S330, the agent application calls a monitoring script to monitor the state of the monitored application instance, when a newly started application instance is monitored, an application instance running record node, "/apps/[ app-name ]/instances/[ hostname ]" is added into the ZooKeeper, and when the application instance is found to stop, the node, "/apps/[ app-name ]/instances/[ hostname ]" corresponding to the application instance is deleted from the ZooKeeper.
S340, when the master control application monitors that an application record "/apps/[ app-name ]" node is added or reduced in the ZooKeeper, the master control application adds or reduces the corresponding application record in the home page of the monitoring page.
It should be noted that the "/apps/[ app-name ]" node is created when the proxy application detects a newly started application instance and an application record corresponding to the application instance does not exist in the ZooKeeper.
When the proxy application detects an instruction to delete an application record, the corresponding application record is deleted, where the instruction may be generated and sent to the proxy application after the master application detects an operation to delete the application record.
S350, when the master control application monitors that an application instance record "/apps/[ app-name ]/agents/[ hostname ]" node is newly added or reduced in the ZooKeeper, adding or reducing a corresponding application instance record in the application page of the monitoring page.
S360, when the master control application monitors that an application instance running record "/apps/[ app-name ]/instances/[ hostname ]" node is newly added or reduced in the ZooKeeper, the state of the corresponding application instance is updated in the application page of the monitoring page.
Specifically, if an application instance running record is newly added to the ZooKeeper, the master control application updates the state corresponding to the application instance in the application page to the running state. And if one application instance running record is reduced in the ZooKeeper, the master control application updates the state corresponding to the application instance in the application page to a stop state.
The monitoring page comprises a home page and an application page; wherein, the top page displays a list, each item in the list corresponds to a monitored application, and displays the application name (i.e., "/apps/[ app-name ]" value in node [ app-name ] in ZooKeeper), the number of deployed application instances of the application (i.e., "/apps/[ app-name ]/agents" in ZooKeeper), and the number of running application instances (i.e., "/apps/[ app-name ]/entities" in ZooKeeper). One can click to jump to the corresponding application page.
The application page also displays a list, with each entry in the list corresponding to an application instance, showing the name of the server where the application instance is located (i.e., the value of "/apps/[ app-name ]/agents/[ hostname ]" node in ZooKeeper) and whether the application instance is running (i.e., whether the "/apps/[ app-name ]/entities/[ hostname ]" node in ZooKeeper exists).
In the distributed application monitoring method provided by this embodiment, the proxy application is used to monitor the state of the monitored application, and the monitored new state data is written into the data storage component ZooKeeper, that is, the monitoring action is implemented by the proxy program independent from the monitored application, so that the monitoring function can be implemented without modifying the monitored application itself. And moreover, the data storage component ZooKeeper for storing the state data of the monitored application is independent from the master control application, so that the development amount of the master control application is reduced.
On the other hand, the invention also provides an embodiment of the distributed application monitoring device.
Referring to fig. 5, a schematic structural diagram of a distributed application monitoring apparatus according to an embodiment of the present invention is shown, and as shown in fig. 5, the apparatus includes: an agent monitoring module 110, a data storage component 120, and a master module 130.
The agent monitoring module 110 is configured to monitor a state of a monitored application instance deployed in the application server where the agent monitoring module is located, and write the state of the monitored application instance into the data storage component 120.
In a possible implementation manner, when the agent monitoring module 110 is configured to monitor a state of a monitored application instance deployed in an application server where the agent monitoring module is located, specifically, the agent monitoring module is configured to:
after the agent monitoring module is started, determining a monitoring script corresponding to the monitored application instance according to a mapping relation between the pre-configured application instance and the monitoring script; and then, calling a monitoring script corresponding to the monitored application instance to monitor the state of the monitored application instance.
In another possible implementation, the agent monitoring module 110 may include:
and the application record creating sub-module is used for creating a corresponding application record for the application to which the application instance belongs in the data storage component after the proxy application monitors the newly started application instance.
In one embodiment, the application record creation sub-module is specifically configured to:
when a newly started application instance is monitored, acquiring an application identifier of an application to which the newly started application instance belongs; and then, judging whether an application record corresponding to the application identifier exists in the database data storage component, and if not, creating an application record corresponding to the application to which the application instance belongs in the database data storage component.
The application instance running record creating sub-module is used for creating a corresponding application instance running record for each newly started application instance in the data storage component after the proxy application monitors the newly started application instance;
the application instance running record deleting sub-module is used for deleting the application instance running record corresponding to the monitored application instance from the data storage component when the agent application monitors that the monitored application instance stops running;
the application instance record creating submodule is used for creating an application instance record for each application instance deployed in the application server where the application instance record is located in the data storage component by the agent application;
and the application instance record deleting submodule is used for deleting the application instance record corresponding to the monitored application instance from the data storage component after the agent application monitors that the state of the monitored application instance is switched from the running state to the stopping state.
The main control module 130 is configured to detect a monitored application instance with changed state data in the data storage component, and update the changed state data to a monitoring state of the monitored application instance.
In one possible implementation, the main control module 130 includes:
the application record modification sub-module is used for adding or deleting the application record corresponding to the application record after the master control application monitors that the application record is newly added or deleted in the data storage component;
the application example record modification submodule is used for adding or deleting the record of the application example corresponding to the application example record after the master control application monitors that the application example record is newly added or deleted in the data storage component;
the application instance running state modification submodule is used for updating the state of the application instance corresponding to the application instance running record into a running state after the master control application monitors the newly added application instance running record in the data storage component; or, after the master control application monitors that the application instance running record is deleted from the data storage component, updating the state of the application instance corresponding to the application instance running record to stop running.
In the distributed application monitoring apparatus provided in this embodiment, an agent monitoring module for monitoring a monitored application is deployed in each application server. And the agent monitoring module acquires the state data of the monitored application and writes the state data into the data storage component. The master control module obtains the state of the monitored application from the data storage component. According to the scheme, the action of writing the state data into the data storage component is separated from the application by using the agent monitoring module, so that the application which is not independently developed is monitored.
In another aspect, the present application provides a computing device comprising a processor and a memory having stored therein a program executable on the processor. The processor implements any of the above described embodiments of the distributed application monitoring method when running the program stored in the memory.
The processor herein may be a CPU of the terminal, or an MCU integrated within the terminal, or a combination of the CPU and the MCU. The processor comprises a kernel, the kernel fetches corresponding programs from the memory, and the kernel can be set to one or more than one.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The application also provides a storage medium executable by the computing device, wherein the storage medium stores a program, and the program realizes the distributed application monitoring method when executed by the computing device.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The steps in the method of the embodiments of the present application may be sequentially adjusted, combined, and deleted according to actual needs.
The device and the modules and sub-modules in the terminal in the embodiments of the present application can be combined, divided and deleted according to actual needs.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal, apparatus and method may be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of a module or a sub-module is only one logical division, and there may be other divisions when the terminal is actually implemented, for example, a plurality of sub-modules or modules may be combined or integrated into another module, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules or sub-modules described as separate parts may or may not be physically separate, and parts that are modules or sub-modules may or may not be physical modules or sub-modules, may be located in one place, or may be distributed over a plurality of network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, each functional module or sub-module in the embodiments of the present application may be integrated into one processing module, or each module or sub-module may exist alone physically, or two or more modules or sub-modules may be integrated into one module. The integrated modules or sub-modules may be implemented in the form of hardware, or may be implemented in the form of software functional modules or sub-modules.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A distributed application monitoring method is characterized in that the method is applied to a monitoring system, and the monitoring system comprises: the system comprises a main control application deployed in a monitoring server, a data storage component used for storing state data and a plurality of agent applications, wherein the agent applications are deployed in application servers where application instances of the distributed applications are deployed; the method comprises the following steps:
for any agent application, the agent application monitors the state of a monitored application instance deployed in an application server where the agent application is located, and writes the state of the monitored application instance into the data storage component;
and the master control application detects the monitored application instance with changed state data in the data storage component and updates the changed state data to the monitoring state of the monitored application instance.
2. The method of claim 1, wherein writing the status of the monitored application instance to the data storage component comprises:
when the agent application monitors a newly started application instance, establishing a corresponding application record for the application to which the application instance belongs in the data storage component;
when the agent application monitors newly started application instances, establishing a corresponding application instance running record for each newly started application instance in the data storage component;
when the agent application monitors that the monitored application instance stops running, deleting an application instance running record corresponding to the monitored application instance from the data storage component;
the agent application creates an application instance record for each application instance deployed in the application server where the agent application is located in the data storage component;
and when the agent application monitors that the state of the monitored application instance is switched from the running state to the stopping state, deleting the application instance record corresponding to the monitored application instance from the data storage component.
3. The method according to claim 2, wherein the detecting, by the master application, the monitored application instance in which the state data in the data storage component has changed, and updating the changed state data to the monitoring state of the monitored application instance, comprises:
when the master control application monitors that the application record is newly added or deleted in the data storage component, adding or deleting the record of the application corresponding to the application record;
when the master control application monitors that the application instance records are newly added or deleted in the data storage component, adding or deleting the records of the application instance corresponding to the application instance records;
when the master control application monitors that the application instance running record is newly added in the data storage component, updating the state of the application instance corresponding to the application instance running record into a running state;
and when the master control application monitors that the application instance running record is deleted from the data storage component, updating the state of the application instance corresponding to the application instance running record to stop running.
4. The method of claim 2, wherein after the agent application monitors a newly started application instance, creating a corresponding application record for an application to which the application instance belongs in the data storage component, including:
when the agent application monitors a newly started application instance, acquiring an application identifier of an application to which the newly started application instance belongs;
and judging whether an application record corresponding to the application identifier exists in the data storage component, and if not, creating an application record corresponding to the application to which the application instance belongs in the data storage component.
5. The method of claim 1, wherein each agent application monitors the status of the monitored application instance deployed in the application server where the agent application resides, and comprises:
after the agent application is started, determining a monitoring script corresponding to the monitored application instance according to a mapping relation between a pre-configured application instance and the monitoring script;
and calling a monitoring script corresponding to the monitored application instance to monitor the state of the monitored application instance.
6. A distributed application monitoring apparatus, comprising: the system comprises an agent monitoring module, a data storage component and a main control module;
the agent monitoring module is used for monitoring the state of a monitored application instance deployed in an application server where the agent monitoring module is located and writing the state of the monitored application instance into the data storage component;
the main control module is used for detecting the monitored application instance with changed state data in the data storage component and updating the changed state data to the monitoring state of the monitored application instance.
7. The apparatus of claim 6, wherein the agent monitoring module comprises:
the application record creating sub-module is used for creating a corresponding application record for the application to which the application instance belongs in the data storage component after the agent application monitors a newly started application instance;
the application instance running record creating sub-module is used for creating a corresponding application instance running record for each newly started application instance in the data storage component after the agent application monitors the newly started application instance;
the application instance running record deleting sub-module is used for deleting the application instance running record corresponding to the monitored application instance from the data storage component after the agent application monitors that the monitored application instance stops running;
an application instance record creating submodule, configured to create, by the agent application, an application instance record for each application instance deployed in an application server where the agent application is located in the data storage component;
and the application instance record deleting submodule is used for deleting the application instance record corresponding to the monitored application instance from the data storage component after the agent application monitors that the state of the monitored application instance is switched from the running state to the stopping state.
8. The apparatus of claim 7, wherein the master control module comprises:
the application record modification sub-module is used for adding or deleting the application record corresponding to the application record after the master control application monitors that the application record is newly added or deleted in the data storage assembly;
the application instance record modification submodule is used for adding or deleting the record of the application instance corresponding to the application instance record when the master control application monitors that the application instance record is newly added or deleted in the data storage component;
the application instance running state modification submodule is used for updating the state of the application instance corresponding to the application instance running record into a running state after the master control application monitors that the application instance running record is newly added into the data storage component; or, after the master control application monitors that the application instance running record is deleted from the data storage component, updating the state of the application instance corresponding to the application instance running record to stop running.
9. The apparatus according to claim 6, wherein the agent monitoring module, when monitoring the state of the monitored application instance deployed in the application server where the agent monitoring module is located, is specifically configured to:
after the agent monitoring module is started, determining a monitoring script corresponding to the monitored application instance according to a mapping relation between a pre-configured application instance and the monitoring script;
and calling a monitoring script corresponding to the monitored application instance to monitor the state of the monitored application instance.
10. A storage medium having a program stored thereon, wherein the program, when loaded and executed by a processor, implements the distributed application monitoring method of any of claims 1-5.
CN201911189614.8A 2019-11-28 2019-11-28 Distributed application monitoring method and device Pending CN110944047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911189614.8A CN110944047A (en) 2019-11-28 2019-11-28 Distributed application monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911189614.8A CN110944047A (en) 2019-11-28 2019-11-28 Distributed application monitoring method and device

Publications (1)

Publication Number Publication Date
CN110944047A true CN110944047A (en) 2020-03-31

Family

ID=69908203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911189614.8A Pending CN110944047A (en) 2019-11-28 2019-11-28 Distributed application monitoring method and device

Country Status (1)

Country Link
CN (1) CN110944047A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115017020A (en) * 2022-05-06 2022-09-06 易保网络技术(上海)有限公司 Screen recording method and medium for small program page and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932210A (en) * 2012-11-23 2013-02-13 北京搜狐新媒体信息技术有限公司 Method and system for monitoring node in PaaS cloud platform
US9225611B1 (en) * 2013-10-10 2015-12-29 Parallels IP Holdings GmbH Method for interception and blocking of mouse move and resize events on mobile device
CN109245962A (en) * 2018-10-12 2019-01-18 北京信研汇智信息技术有限公司 Server monitoring method, system, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932210A (en) * 2012-11-23 2013-02-13 北京搜狐新媒体信息技术有限公司 Method and system for monitoring node in PaaS cloud platform
US9225611B1 (en) * 2013-10-10 2015-12-29 Parallels IP Holdings GmbH Method for interception and blocking of mouse move and resize events on mobile device
CN109245962A (en) * 2018-10-12 2019-01-18 北京信研汇智信息技术有限公司 Server monitoring method, system, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
朱瑞斌: "服务器集群监控系统的设计与实现", 《中国优秀硕士学位论文全文数据库》 *
赵睿,康哲,张伟龙, 吉林大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115017020A (en) * 2022-05-06 2022-09-06 易保网络技术(上海)有限公司 Screen recording method and medium for small program page and electronic equipment
CN115017020B (en) * 2022-05-06 2024-02-09 易保网络技术(上海)有限公司 Screen recording method and medium of applet page and electronic equipment

Similar Documents

Publication Publication Date Title
US11226847B2 (en) Implementing an application manifest in a node-specific manner using an intent-based orchestrator
CN108376118B (en) Service distribution system, method, device and storage medium
WO2017140131A1 (en) Data writing and reading method and apparatus, and cloud storage system
US9836346B2 (en) Error troubleshooting using a correlated knowledge base
CN112929401B (en) Registration method and device
US11456914B2 (en) Implementing affinity and anti-affinity with KUBERNETES
CN109445841B (en) Interface document management method, device, server and storage medium
US10715628B2 (en) Attribute operating method and device
CN112486552A (en) Server hot update method, device, equipment and storage medium
CN103647811A (en) A method and an apparatus for application's accessing backstage service
CN110944047A (en) Distributed application monitoring method and device
CN112799588B (en) Data storage method for loading container cluster application data by using external storage
CN109445966B (en) Event processing method, device, medium and computing equipment
CN110704041A (en) Software development method and device
CN109144620B (en) Skipping method and device for suspension window permission setting interface
CN107085514B (en) Shared library upgrading method and device
CN110083509B (en) Method and device for arranging log data
CN110532457B (en) Method and system for acquiring network segment ID
CN113132241A (en) ACL template dynamic configuration method and device
CN108196962B (en) Method and device for realizing calling of interfaces of different versions
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
CN112748931B (en) Compiled file management method, calling method and device and electronic equipment
CN110618791B (en) CFS storage domain configuration method, device, equipment and readable storage medium
CN114629783B (en) State monitoring method, system, equipment and computer readable storage medium
CN114281604B (en) Data recovery method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200331

RJ01 Rejection of invention patent application after publication