WO2021184587A1 - 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质 - Google Patents

基于Prometheus的私有云监控方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021184587A1
WO2021184587A1 PCT/CN2020/099190 CN2020099190W WO2021184587A1 WO 2021184587 A1 WO2021184587 A1 WO 2021184587A1 CN 2020099190 W CN2020099190 W CN 2020099190W WO 2021184587 A1 WO2021184587 A1 WO 2021184587A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration file
prometheus
local disk
master node
database
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.)
Ceased
Application number
PCT/CN2020/099190
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2021184587A1 publication Critical patent/WO2021184587A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3034Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • This application relates to the field of cloud monitoring, and in particular to a private cloud monitoring method, device, computer equipment, and storage medium based on Prometheus.
  • Cloud services are the increase, use, and interaction modes of Internet-based related services, which usually involve the provision of dynamic, easily expandable and often virtualized resources through the Internet. Cloud services can put the software, hardware, and data needed by the enterprise on the network, and use different IT equipment to connect to each other at any time and place to achieve data access, computing and other purposes.
  • common cloud services include public cloud (Public Cloud) and private cloud (Private Cloud).
  • Public Cloud public cloud
  • Private Cloud Private Cloud
  • Private Clouds the private cloud (Private Clouds) is built for a single customer to use, so it can provide the most effective control of data, security and service quality.
  • the current private cloud solution is the battleground for all cloud vendors, and the most important thing in the private cloud is the monitoring solution set up.
  • the availability of monitoring determines the reliability of the delivery of the private cloud solution and the availability of private cloud services. When, whether the alarm can be generated in time.
  • most of the private cloud monitoring solutions directly use public cloud monitoring solutions.
  • the Prometheus monitoring solution adopted in the public cloud basically uses Remote_read and Remote_write to achieve its high availability.
  • the embodiments of the present application provide a Prometheus-based private cloud monitoring method, device, computer equipment, and storage medium, which can improve the high availability of private cloud monitoring, and can generate alarms in time to facilitate user operation and maintenance.
  • an embodiment of the present application provides a Prometheus-based private cloud monitoring method, the method includes: if a monitoring request initiated by a cloud management platform is received, initiating a first connection request to the master node according to the monitoring request; if The first response information returned by the master node in response to the first connection request is received within the preset time range, and the first configuration file monitored by Prometheus in the local disk of the master node is obtained, and the first configuration file includes the first Data collection strategy and first alarm strategy; parse the obtained first configuration file to obtain the first data collection strategy, and perform corresponding data collection according to the first data collection strategy; store the collected data To the Prometheus database in the local disk of the master node; perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the embodiment of the present application also provides a Prometheus-based private cloud monitoring device.
  • the device includes: a first request unit configured to send a monitoring request initiated by the cloud management platform to the host according to the monitoring request.
  • the node initiates the first connection request;
  • the first obtaining unit is configured to obtain the Prometheus monitoring in the local disk of the main node if the first response information returned by the main node in response to the first connection request is received within the preset time range
  • the first configuration file includes a first data collection strategy and a first alarm strategy;
  • the first processing unit is configured to parse the obtained first configuration file to obtain the first data collection strategy, And perform corresponding data collection according to the first data collection strategy;
  • the first storage unit is used to store the collected data in the Prometheus database in the local disk of the master node;
  • the first analysis unit is used to Perform an alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file
  • an embodiment of the present application also provides a computer device.
  • the computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; and the processor is used to run the A computer program stored in the memory to perform the following steps: if a monitoring request initiated by the cloud management platform is received, a first connection request is initiated to the master node according to the monitoring request; if a response from the master node is received within a preset time range The first response information returned by the first connection request is obtained, and the first configuration file monitored by Prometheus in the local disk of the master node is obtained.
  • the first configuration file includes the first data collection strategy and the first alarm strategy;
  • the first configuration file to obtain the first data collection strategy, and perform corresponding data collection according to the first data collection strategy; store the collected data in the Prometheus database in the local disk of the master node In;
  • According to the first alarm strategy of the first configuration file perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node.
  • an embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following Operation: If a monitoring request initiated by the cloud management platform is received, a first connection request is initiated to the master node according to the monitoring request; if the first connection request returned by the master node in response to the first connection request is received within a preset time frame In response to the information, a first configuration file monitored by Prometheus in the local disk of the master node is obtained, where the first configuration file includes a first data collection strategy and a first alarm strategy; the obtained first configuration file is parsed to obtain the First data collection strategy, and perform corresponding data collection according to the first data collection strategy; store the collected data in the Prometheus database in the local disk of the master node; according to the first configuration file The first alarm strategy performs alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node.
  • the embodiments of the application provide a Prometheus-based private cloud monitoring method, device, computer equipment, and storage medium.
  • the monitoring account of the cloud management platform is used to set the configuration file for implementing the Prometheus monitoring of the corresponding private cloud on the local disk of the master-slave node of the monitoring server of the monitoring service system, and the alarm policy configured in the configuration file is used to achieve
  • the high-availability monitoring of the private cloud can realize timely alarms when abnormal problems occur in the related data of the private cloud, and ensure that the high availability of the private cloud monitoring and the effect of user operation and maintenance are improved without increasing the cost.
  • FIG. 1 is a schematic flowchart of a method for monitoring a private cloud based on Prometheus provided by an embodiment of the present application
  • Figure 1a is a schematic diagram of an application scenario of a Prometheus-based private cloud monitoring method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a private cloud monitoring method based on Prometheus provided by another embodiment of the present application;
  • FIG. 3 is a schematic flowchart of a private cloud monitoring method based on Prometheus provided by another embodiment of the present application.
  • FIG. 4 is a schematic block diagram of a Prometheus-based private cloud monitoring device provided by an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a Prometheus-based private cloud monitoring device provided by another embodiment of the present application.
  • Figure 6 is a schematic block diagram of a Prometheus-based private cloud monitoring device provided by another embodiment of the present application
  • FIG. 7 is a schematic diagram of the structural composition of a computer device provided by an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a Prometheus-based private cloud monitoring method provided by an embodiment of the present application.
  • FIG. 1a is a schematic scenario diagram of a Prometheus-based private cloud monitoring method in an embodiment of the present application.
  • the Prometheus-based private cloud monitoring method is applied to the management server 10 in the monitoring service system.
  • the management server 10 sets the configuration file to realize the Prometheus monitoring of the corresponding private cloud through the monitoring account of the cloud management platform 20 on the local disks of the master and slave nodes of the monitoring server 10 of the monitoring service system.
  • the alarm strategy configured in the configuration file realizes the highly available monitoring of the private cloud.
  • This method can ensure that the monitoring service of Prometheus is not interrupted, and when abnormal problems occur in related data of the private cloud, an alarm can be generated in time, and the monitoring cost is not increased, and the high availability of private cloud monitoring can be improved and user operation and maintenance can be facilitated.
  • the steps of the Prometheus-based private cloud monitoring method will be described in detail below from the perspective of the management server 10.
  • FIG. 1 is a schematic flowchart of a Prometheus-based private cloud monitoring method provided by an embodiment of the present application. As shown in Figure 1, the steps of the Prometheus-based private cloud monitoring method include steps S101 to S105.
  • Step S101 If a monitoring request initiated by the cloud management platform is received, a first connection request is initiated to the master node according to the monitoring request.
  • the monitoring service system is used to monitor the relevant data information of the cloud management platform.
  • the monitoring server of the monitoring service system receives the monitoring request initiated by the user cloud management platform, it can send the monitoring request to the monitoring system according to the monitoring request.
  • the master node for monitoring in the service system initiates the first connection request.
  • the cloud management platform here is a platform used to manage the user's private cloud, and the platform may include related servers or server clusters that provide the private cloud.
  • the monitoring service system can monitor the relevant data information of the private cloud.
  • the monitoring service system includes a master node for monitoring and a slave for backing up relevant information in the master node.
  • the master node is the main monitoring node.
  • the slave node will be activated.
  • Step S102 If the first response information returned by the master node in response to the first connection request is received within the preset time range, the first configuration file monitored by Prometheus in the local disk of the master node is obtained, and the first configuration The file includes the first data collection strategy and the first alarm strategy.
  • the preset time range can be set correspondingly according to the needs of the user. After receiving the first connection request, the master node will accordingly want the monitoring server to return the corresponding first response information. If within the preset time range, the monitoring server can receive the first response information returned by the master node, it indicates that a complete connection can be established between the monitoring server and the master node.
  • the monitoring server can obtain the first configuration file monitored by Prometheus in the local disk of the master node to complete specific monitoring according to the first configuration file.
  • the first configuration file is used to configure monitoring related information, so it may include the first data collection strategy and the first alarm strategy.
  • the first configuration file needs to be set in the local disk of the master node in advance according to user needs, which not only facilitates the user to add, delete, and modify the first configuration file, but also update its changes to the slave node synchronously.
  • Step S103 parse the obtained first configuration file to obtain the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • the monitoring server can parse the acquired first configuration file, thereby acquiring the first data collection strategy and the first alarm strategy.
  • corresponding data collection can be implemented according to the first data collection strategy.
  • the first data collection strategy may be to collect and update the relevant data every preset time.
  • Step S104 Store the collected data in the Prometheus database on the local disk of the master node.
  • the collected data can be stored in the Prometheus database on the local disk of the master node, and an alarm is required when During analysis, data is retrieved from the Prometheus database, which not only facilitates data management, but also facilitates data processing and analysis by users.
  • Step S105 Perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the monitoring server can read the corresponding data from the Prometheus database in the local disk of the master node according to the first alarm policy in the first configuration file, and can realize the related data read. The data is processed for alarm analysis.
  • the method may further include the following steps: step S106, according to a preset synchronization rule, synchronously store the data stored in the Prometheus database in the local disk of the master node to the local disk of the slave node.
  • Prometheus database in order to achieve high availability of private cloud monitoring, a preset synchronization rule is usually used to synchronize the data stored in the Prometheus database in the local disk of the master node to Prometheus in the local disk of the slave node.
  • the data of the master and slave nodes can be synchronized and updated, so that when one of the nodes has a problem, the other node can replace the position of the node in real time, so as to continuously monitor the private cloud.
  • the preset synchronization rule may be an Rsync tool, which is a data mirroring backup tool that can synchronize files in different local paths, that is, perform operations such as adding, deleting, and modifying local files.
  • the method may further include the following steps: step S107, if a configuration file modification request sent by the cloud management platform is received, according to the configuration file modification request, the first node in the local disk of the master node A configuration file is modified to obtain a new first configuration file.
  • the monitoring server receives the configuration file modification request sent by the cloud management platform, it can modify the first configuration file in the local disk of the master node according to the configuration file modification request.
  • the configuration file is the new first configuration file.
  • Step S108 according to the preset synchronization rule, synchronize the new first configuration file in the local disk of the master node to the local disk of the slave node to replace the original second configuration file, and use it as the new second configuration file.
  • Configuration file if a configuration file modification request sent by the cloud management platform is received, according to the configuration file modification request, the first node in the local disk of the master node A configuration file is modified to obtain a new first configuration file.
  • the first configuration file in the master node when the first configuration file in the master node is modified to become a new first configuration file, it can be synchronized to the local disk of the slave node through preset synchronization rules, and used to replace the original second configuration file , That is, the new first configuration file is used as the new second configuration file. Since the content in the local disk of the slave node is equivalent to the backup of the master node, the first configuration file and the second configuration file between the two are usually identical.
  • the embodiment of the application uses the monitoring account of the cloud management platform to set the configuration file for implementing the Prometheus monitoring of the corresponding private cloud on the local disks of the master and slave nodes of the monitoring server of the monitoring service system through the alarm configured in the configuration file.
  • the strategy realizes the high-availability monitoring of the private cloud, which can realize timely alarms when abnormal problems occur in the related data of the private cloud, and ensure that the high-availability of private cloud monitoring and the convenience of user operation and maintenance are improved without increasing the cost. Effect.
  • FIG. 2 is a schematic flowchart of a Prometheus-based private cloud monitoring method provided by another embodiment of the present application.
  • the steps of the method include steps S201 to S205'.
  • steps S201 to S205 and steps S101 to S105 in the above-mentioned embodiment will not be repeated here.
  • the following detailed descriptions are provided for the steps added in this embodiment.
  • Step S201 If a monitoring request initiated by the cloud management platform is received, a first connection request is initiated to the master node according to the monitoring request.
  • Step S202 If the first response information returned by the master node in response to the first connection request is received within the preset time range, the first configuration file monitored by Prometheus in the local disk of the master node is obtained, and the first configuration The file includes the first data collection strategy and the first alarm strategy.
  • Step S203 Analyze the acquired first configuration file to acquire the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • Step S204 Store the collected data in the Prometheus database in the local disk of the master node.
  • Step S205 Perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • Step S202' if the first response information returned by the master node in response to the first connection request is not received within the preset time range, a second connection request is initiated to the slave node according to the monitoring request.
  • the monitoring server does not receive the first response information returned by the master node in response to the first connection request within the preset time range, it indicates that the master node is down or cannot communicate with The cloud management platform is connected, and at this time, a second connection request needs to be initiated to the slave node according to the monitoring request, so as to realize continuous monitoring of the cloud management platform.
  • keepalive can be used to switch between the master node and the slave node, that is, it can quickly switch from the master node to the slave node.
  • Step S202a' if the second response information returned by the slave node in response to the second connection request is received within the preset time range, the second configuration file monitored by Prometheus in the local disk of the slave node is acquired, and the second The configuration file includes a second data collection strategy and a second alarm strategy.
  • the monitoring server performs a master-slave switch, if the slave node receives the second connection request and generates the second response message in response within the preset time range, the second response message can be returned to the Monitoring server.
  • the monitoring server can establish a connection with the slave node, and the second configuration file monitored by Prometheus can be obtained from the local disk of the slave node. Since the slave node is a backup relative to the master node, the second configuration file is also the same as the first configuration file, that is, the second configuration file also includes a second data collection strategy and a second alarm strategy.
  • Step S203' parse the acquired second configuration file to acquire the second data collection strategy, and perform corresponding data collection according to the second data collection strategy.
  • the monitoring server can parse the acquired second configuration file, thereby acquiring the second data collection strategy and the second alarm strategy.
  • corresponding data collection can be implemented according to the second data collection strategy.
  • the relevant data can be collected and updated every preset time.
  • Step S204' storing the collected data in the Prometheus database in the local disk of the slave node.
  • the collected data can be stored in the Prometheus database on the local disk of the slave node, and an alarm is required when During analysis, data is retrieved from the Prometheus database, which not only facilitates data management, but also facilitates data processing and analysis by users.
  • Step S205' Perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the slave node according to the second alarm policy of the second configuration file.
  • the monitoring server can read the corresponding data from the Prometheus database in the local disk of the master node according to the second alarm policy in the second configuration file, and can realize the related data read. The data is processed for alarm analysis.
  • the method may further include the following steps: step S206', according to a preset synchronization rule, synchronously storing the data stored in the Prometheus database in the local disk of the slave node to the local disk of the master node Prometheus database.
  • a preset synchronization rule is usually used to synchronize the data stored in the Prometheus database in the local disk of the slave node to Prometheus in the local disk of the master node.
  • the data of the master and slave nodes can be synchronized and updated, so that when one of the nodes has a problem, the other node can replace the position of the node in real time, so as to continuously monitor the private cloud.
  • the preset synchronization rule may be an Rsync tool, which is a data mirroring backup tool that can synchronize files in different local paths, that is, perform operations such as adding, deleting, and modifying local files.
  • Rsync tool is a data mirroring backup tool that can synchronize files in different local paths, that is, perform operations such as adding, deleting, and modifying local files.
  • the method may further include the following steps: step S207', if a configuration file modification request sent by the cloud management platform is received, according to the configuration file modification request, the slave node's local disk
  • the configuration file is modified to obtain a new configuration file.
  • the monitoring server receives a configuration file modification request sent by the cloud management platform, it can modify the second configuration file in the local disk of the slave node according to the configuration file modification request.
  • the second configuration file after that is the new second configuration file.
  • Step S208' synchronize the new configuration file in the local disk of the slave node to the local disk of the master node to replace the original configuration file.
  • the second configuration file in the slave node after the second configuration file in the slave node has been modified to become a new second configuration file, it can be synchronized to the local disk of the master node through preset synchronization rules and used to replace the original The first configuration file, that is, the new second configuration file as the new first configuration file. Since the content in the local disk of the slave node is equivalent to the backup of the master node, the first configuration file and the The second configuration file is the same.
  • FIG. 3 is a schematic flowchart of a Prometheus-based private cloud monitoring method provided by another embodiment of the present application. As shown in Fig. 3, the steps of the method include steps S301a to S305. The relevant explanations and detailed descriptions of steps similar to steps S101-S105 in the above-mentioned embodiment will not be repeated here. The following detailed descriptions are provided for the steps added in this embodiment.
  • step S301a if a user monitoring login request sent by the cloud management platform is received, the user monitoring login request is parsed to obtain corresponding request information.
  • the request information includes a user account and a user password.
  • step S301b If the user account is included in the preset database, it is determined whether the preset password associated with the user account matches the user password.
  • step S301c if the preset password associated with the user account matches the user password, the user monitoring login is successful.
  • users can register a monitoring management account on the cloud management platform according to their own needs, and can prevent the cloud management platform from logging in, and send a user monitoring login request to the monitoring server.
  • the monitoring server can parse the user monitoring login request to obtain the user account and user.
  • Step S301 If a monitoring request initiated by the cloud management platform is received, a first connection request is initiated to the master node according to the monitoring request.
  • Step S302 If the first response information returned by the master node in response to the first connection request is received within the preset time range, the first configuration file monitored by Prometheus in the local disk of the master node is obtained, and the first configuration The file includes the first data collection strategy and the first alarm strategy.
  • Step S303 Analyze the acquired first configuration file to acquire the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • Step S304 Store the collected data in the Prometheus database in the local disk of the master node.
  • Step S305 Perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the program can be stored in a computer-readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), etc.
  • the device 100 includes: a first request unit 101, a first acquisition unit 102, The first processing unit 103, the first storage unit 104, and the first analysis unit 105.
  • the first request unit 101 is configured to, if a monitoring request initiated by the cloud management platform is received, initiate a first connection request to the master node according to the monitoring request.
  • the first acquiring unit 102 is configured to, if the first response information returned by the master node in response to the first connection request is received within a preset time range, acquire the first configuration of Prometheus monitoring in the local disk of the master node File, the first configuration file includes a first data collection strategy and a first alarm strategy.
  • the first processing unit 103 is configured to parse the acquired first configuration file to acquire the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • the first storage unit 104 is configured to store the collected data in the Prometheus database in the local disk of the master node.
  • the first analysis unit 105 is configured to perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the device 100 may further include the following units: a first synchronization unit 106, configured to synchronize and store data stored in the Prometheus database in the local disk of the master node to the slave according to preset synchronization rules. Prometheus database in the local disk of the node.
  • the apparatus 100 may further include the following units: a first modification unit 107, configured to, if a configuration file modification request sent by the cloud management platform is received, send a request to the master node according to the configuration file modification request Modify the first configuration file in the local disk to obtain a new first configuration file.
  • the first update unit 108 is configured to synchronize the new first configuration file in the local disk of the master node to the local disk of the slave node to replace the original second configuration file according to the preset synchronization rule As a new second configuration file.
  • the device 200 includes: a first request unit 201, a first acquisition unit 202, the first processing unit 203, the first storage unit 204, the first analysis unit 205, the second request unit 202', the second acquisition unit 202a', the second processing unit 203', the second storage unit 204', and the second Analysis unit 205'.
  • a first request unit 201 a first acquisition unit 202, the first processing unit 203, the first storage unit 204, the first analysis unit 205, the second request unit 202', the second acquisition unit 202a', the second processing unit 203', the second storage unit 204', and the second Analysis unit 205'.
  • Relevant explanations and detailed descriptions of the same units as the first request unit 101, the first acquisition unit 102, the first processing unit 103, the first storage unit 104, and the first analysis unit 105 in the foregoing embodiment will not be repeated here.
  • the unit added in this embodiment will be described in detail below.
  • the first request unit 201 is configured to, if a monitoring request initiated by the cloud management platform is received, initiate a first connection request to the master node according to the monitoring request.
  • the first acquiring unit 202 is configured to, if the first response information returned by the master node in response to the first connection request is received within a preset time range, acquire the first configuration of Prometheus monitoring in the local disk of the master node File, the first configuration file includes a first data collection strategy and a first alarm strategy.
  • the first processing unit 203 is configured to parse the acquired first configuration file to acquire the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • the first storage unit 204 is configured to store the collected data in the Prometheus database in the local disk of the master node.
  • the first analysis unit 205 is configured to perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the second request unit 202' is configured to, if the first response information returned by the master node in response to the first connection request is not received within a preset time range, initiate a second connection to the slave node according to the monitoring request ask.
  • the second acquiring unit 202a' is configured to, if the second response information returned by the slave node in response to the second connection request is received within the preset time range, acquire the second information monitored by Prometheus in the local disk of the slave node.
  • a configuration file where the second configuration file includes a second data collection strategy and a second alarm strategy.
  • the second processing unit 203' is configured to parse the acquired second configuration file to acquire the second data collection strategy, and perform corresponding data collection according to the second data collection strategy.
  • the second storage unit 204' is configured to store the collected data in the Prometheus database in the local disk of the slave node.
  • the second analysis unit 205' is configured to perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the slave node according to the second alarm policy of the second configuration file.
  • the device 200 may further include the following units:
  • the second synchronization unit 206' is configured to synchronize and store the data stored in the Prometheus database in the local disk of the slave node to the Prometheus database in the local disk of the master node according to a preset synchronization rule.
  • the device 200 may further include the following units:
  • the second modification unit 207' is configured to, if a configuration file modification request sent by the cloud management platform is received, modify the configuration file in the local disk of the slave node according to the configuration file modification request to obtain a new configuration file.
  • the second update unit 208' is configured to synchronize the new configuration file in the local disk of the slave node to the local disk of the master node according to a preset synchronization rule to replace the original configuration file.
  • the device 300 includes: a request unit 301a, a judgment unit 301b, and a login unit 301c, a first request unit 301, a first acquisition unit 302, a first processing unit 303, a first storage unit 304, and a first analysis unit 305.
  • a request unit 301a a request unit 301a
  • a judgment unit 301b a login unit 301c
  • a first request unit 301 a first acquisition unit 302
  • a first processing unit 303 a first storage unit 304
  • a first analysis unit 305 Relevant explanations and detailed descriptions of the same units as the first request unit 101, the first acquisition unit 102, the first processing unit 103, the first storage unit 104, and the first analysis unit 105 in the foregoing embodiment will not be repeated here.
  • the unit added in this embodiment will be described in detail below.
  • the request unit 301a is configured to, if a user monitoring login request sent by the cloud management platform is received, parse the user monitoring login request to obtain corresponding request information.
  • the request information includes a user account and a user password.
  • the determining unit 301b is configured to determine whether the preset password associated with the user account matches the user password if the user account is included in the preset database.
  • the login unit 301c is configured to, if the preset password associated with the user account matches the user password, the user monitors that the login succeeds.
  • the first request unit 301 is configured to, if a monitoring request initiated by the cloud management platform is received, initiate a first connection request to the master node according to the monitoring request.
  • the first obtaining unit 302 is configured to obtain the first configuration file monitored by Prometheus in the local disk of the main node if the first response information returned by the main node in response to the first connection request is received within a preset time range,
  • the first configuration file includes a first data collection strategy and a first alarm strategy.
  • the first processing unit 303 is configured to parse the acquired first configuration file to acquire the first data collection strategy, and perform corresponding data collection according to the first data collection strategy.
  • the first storage unit 304 is configured to store the collected data in the Prometheus database in the local disk of the master node.
  • the first analysis unit 305 is configured to perform alarm analysis on the corresponding data read from the Prometheus database in the local disk of the master node according to the first alarm policy of the first configuration file.
  • the above first request unit 101, first acquisition unit 102, first processing unit 103, first storage unit 104, and first analysis unit 105 can be embedded in hardware or independent of
  • the Prometheus-based private cloud monitoring device can also be stored in the memory of the Prometheus-based private cloud monitoring device in the form of software, so that the processor can call and execute the operations corresponding to the above units.
  • the processor can be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, and so on.
  • the aforementioned Prometheus-based private cloud monitoring device may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 7.
  • FIG. 7 is a schematic diagram of the structural composition of a computer device of this application.
  • the device can be a server, where the server can be an independent server or a server cluster composed of multiple servers.
  • the computer device 400 includes a processor 402, a memory, and a network interface 405 connected through a system bus 401, where the memory may include a non-volatile storage medium 403 and an internal memory 404.
  • the non-volatile storage medium 403 can store an operating system 4031 and a computer program 4032.
  • the processor 402 can execute a Prometheus-based private cloud monitoring method.
  • the processor 402 is used to provide calculation and control capabilities, and support the operation of the entire computer device 400.
  • the internal memory 404 provides an environment for the operation of the computer program 4032 in the non-volatile storage medium 403.
  • the processor 402 can execute a Prometheus-based private cloud monitoring method.
  • the network interface 405 is used for network communication with other devices.
  • the specific computer device 400 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 402 is configured to run a computer program 4032 stored in a memory, so as to implement the steps of the Prometheus-based private cloud monitoring method in the foregoing embodiment.
  • the processor 402 may be a central processing unit (Central Processing Unit, CPU), and the processor 402 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the computer program may be stored in a storage medium, and the storage medium is a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the Prometheus-based private cloud monitoring method in the foregoing embodiment.
  • the storage medium is a physical, non-transitory storage medium, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, etc., which can store program codes. medium.
  • a physical, non-transitory storage medium such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, etc., which can store program codes. medium.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the steps in the method in the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
  • the units in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种基于Prometheus的私有云监控方法、装置、计算机设备及存储介质。该方法应用于云监控领域,涉及大数据技术,该方法包括若接收到云管理平台发起的监控请求,根据监控请求向主节点发起第一连接请求(S101);若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件(S102);解析所获取的第一配置文件,并根据第一数据采集策略进行相应的数据采集(S103);将所采集到的数据存储到主节点的本地磁盘中的Prometheus数据库中(S104);根据第一配置文件的第一告警策略对从主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析(S105)。该方法能够提高私有云监控的高可用,并能及时产生告警,便于用户运维。

Description

基于Prometheus的私有云监控方法、装置、计算机设备及存储介质
本申请要求于2020年03月18日提交中国专利局、申请号为202010189434.6,发明名称为“基于Prometheus的私有云监控方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云监控领域,尤其涉及一种基于Prometheus的私有云监控方法、装置、计算机设备及存储介质。
背景技术
云服务是基于互联网的相关服务的增加、使用和交互模式,通常涉及通过互联网来提供动态易扩展且经常是虚拟化的资源。云服务可以将企业所需的软硬件、资料都放到网络上,在任何时间、地点,使用不同的IT设备互相连接,实现数据存取、运算等目的。当前,常见的云服务有公共云(Public Cloud)与私有云(Private Cloud)两种。其中的私有云(Private Clouds)是为一个客户单独使用而构建的,因而能够提供对数据、安全性和服务质量的最有效控制。
当前私有云方案是各个云厂商必争的兵家之地,而私有云中最为重要的是其设置的监控方案,监控的可用性决定了私有云方案交付的可靠性,以及私有云业务的可用性发生问题时,是否能及时产生告警。目前,私有云的监控方案大多数直接使用公有云的监控方案。同时公有云中采用的Prometheus的监控方案基本都是使用Remote_read和Remote_write的方式实现其高可用性。发明人意识到通常当私有云部署交付,而其又为很小的私有云产品方案时,通常并不提供远程读写的存储方案,只提供本地磁盘的存储方案时,私有云的远程读写方案就不可用,此时监控的高可用性将无法实现。
发明内容
本申请实施例提供一种基于Prometheus的私有云监控方法、装置、计算机设备及存储介质,能够提高私有云监控的高可用,并能及时产生告警,便于用户运维。
第一方面,本申请实施例提供了一种基于Prometheus的私有云监控方法,该方法包括:若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
第二方面,本申请实施例还提供了一种基于Prometheus的私有云监控装置,该装置包括:第一请求单元,用于若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;第一获取单元,用于若在预设时间范围内接收到主节点响应所述第一连接请 求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;第一处理单元,用于解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;第一存储单元,用于将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;第一分析单元,用于根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
第三方面,本申请实施例还提供了一种计算机设备,所述计算机设备包括存储器,以及与所述存储器相连的处理器;所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行以下步骤:若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下操作:若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
本申请实施例提供了一种基于Prometheus的私有云监控方法、装置、计算机设备及存储介质。本申请实施例通过云管理平台的监控账号在监控服务系统的监控服务器的主从节点的本地磁盘上设置实现对应的私有云的Prometheus监控的配置文件,通过配置文件中所配置的告警策略实现对私有云的高可用的监控,可实现在私有云的相关数据发生异常问题时能及时产生告警,并确保在不增加成本的情况下提高私有云监控的高可用以及便于用户运维的效果。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种基于Prometheus的私有云监控方法的流程示意图;
图1a是本申请实施例提供的一种基于Prometheus的私有云监控方法的应用场景示意图;
图2是本申请另一实施例提供的一种基于Prometheus的私有云监控方法的流程示意图;
图3是本申请另一实施例提供的一种基于Prometheus的私有云监控方法的流程示意图;
图4是本申请实施例提供的一种基于Prometheus的私有云监控装置的示意性框图;
图5是本申请另一实施例提供的一种基于Prometheus的私有云监控装置的示意性框图;
图6是本申请另一实施例提供的一种基于Prometheus的私有云监控装置的示意性框图
图7是本申请实施例提供的一种计算机设备结构组成示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
请参阅图1和图1a,图1是本申请实施例提供的一种基于Prometheus的私有云监控方法的示意流程图,图1a是本申请实施例中基于Prometheus的私有云监控方法的场景示意图。该基于Prometheus的私有云监控方法应用于监控服务系统中的管理服务器10中。该管理服务器10根据基于Prometheus的私有云监控方法通过云管理平台20的监控账号在监控服务系统的监控服务器10的主从节点的本地磁盘上设置实现对应的私有云的Prometheus监控的配置文件,通过配置文件中所配置的告警策略实现对私有云的高可用的监控。该方法能够在保证Prometheus的监控服务不中断,且私有云的相关数据发生异常问题时可及时产生告警,以及确保监控成本不增加的情况下,提高私有云监控的高可用以及便于用户运维。以下将以管理服务器10的角度详细地介绍该基于Prometheus的私有云监控方法的各个步骤。
请参阅图1,图1是本申请实施例提供的基于Prometheus的私有云监控方法的示意流程图。如图1所示,该基于Prometheus的私有云监控方法的步骤包括步骤S101~S105。
步骤S101,若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。在本实施例中,监控服务系统用于实现对云管理平台的相关数据信息的监控,当监控服务系统的监控服务器接收到用户云管理平台发起的监控请求,此时可以根据该监控请求向监控服务系统中的用于监控的主节点发起第一连接请求。通常,此处的云管理平台为用户的私有云的用于实现对其管理的平台,该平台可以包括提供私有云的相关服务器或者服务器群集等。而监控服务系统能够实现对私有云的相关数据信息的监控,为了实现对私有云的监控的高可用性,监控服务系统包括用于监控的主节点和用于备份该主节点中的相关信息的 从节点,其中的主节点为主要的监控节点,当主节点出现宕机或者连接不上的情况,此时则会启用从节点。
步骤S102,若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略。在本实施例中,预设时间范围可以根据用户的需求进行相应的设定。主节点在接收到第一连接请求后,会相应地想监控服务器返回相应的第一响应信息。若在预设时间范围内,监控服务器能够接收到由主节点所返回的第一响应信息,则表明监控服务器与主节点之间能够建立完整的连接。监控服务器能够获取主节点的本地磁盘中的Prometheus监控的第一配置文件,以根据该第一配置文件来完成具体的监控。通常,第一配置文件是用于配置监控的相关信息,故其可以包括第一数据采集策略以及第一告警策略。同时,第一配置文件是需要预先在主节点的本地磁盘中根据用户需求进行设置的,不仅便于用户对该第一配置文件的增删改,将其变动同步更新到从节点中。
步骤S103,解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。在本实施例中,监控服务器能够解析所获取的第一配置文件,从而获取到第一数据采集策略和第一告警策略。此处,获取第一数据采集策略之后,可以根据该第一数据采集策略来实现相应的数据的采集。例如,对于私有云而言,为对其性能及安全等进行实时监控,此时可以对于私有云中传输的数据流量信息、数据存储信息以及服务器的CPU占比等数据进行监控获取,并通过后续的对比分析来实现对私有云的性能的监控和告警等。作为可选的,该第一数据采集策略可以是每隔预设时间即对相关数据进行一次采集更新。
步骤S104,将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。在本实施例中,当监控服务器采集到相应的数据后,为了便于对相关数据进行统计分析,可以将所采集到的数据都存储到主节点的本地磁盘中的Prometheus数据库中,当需要进行告警分析的时候,则从Prometheus数据库中进行数据调取,不仅方便数据的管理,还便于用户对数据的处理和分析。
步骤S105,根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。在本实施例中,监控服务器能够根据所述第一配置文件中的第一告警策略,从主节点的本地磁盘中的Prometheus数据库中读取的相应的数据,并能够实现对所读取的相关数据进行告警分析处理。
在一实施例中,所述方法还可以包括以下步骤:步骤S106,根据预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中。在本实施例中,为了实现私有云监控的高可用性,通常会采用预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中,从而实现主从节点的数据的同步更新,以便于在其中一个节点出现问题时,另一个节点能够实时顶替该节点的位置,从而不间断地实现对私有云的监控。作为可选的,该预设同步规则可以是Rsync工具,Rsync工具是数据镜像备份工具, 能够实现本地不同路径下的文件的同步,即实现本地文件的同步的增删改等操作。
在进一步的实施例中,所述方法还可以包括以下步骤:步骤S107,若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述主节点的本地磁盘中的第一配置文件进行修改以得到新的第一配置文件。其中,监控服务器若收到到云管理平台发送的配置文件修改请求,则可以根据该配置文件修改请求来实现对所述主节点的本地磁盘中的第一配置文件的修改,修改后的第一配置文件即为新的第一配置文件。步骤S108,根据预设同步规则将所述主节点的本地磁盘中的新的第一配置文件同步到从节点的本地磁盘中以替换原有的第二配置文件,并将其作为新的第二配置文件。其中,当主节点中的第一配置文件经过修改变为新的第一配置文件后,可以通过预设同步规则将其同步至从节点的本地磁盘中,并用于替换掉原有的第二配置文件,即将新的第一配置文件作为新的第二配置文件,由于从节点的本地磁盘中的内容相当于是对主节点的备份,故通常两者之间的第一配置文件和第二配置文件是相同的。
综上,本申请实施例通过云管理平台的监控账号在监控服务系统的监控服务器的主从节点的本地磁盘上设置实现对应的私有云的Prometheus监控的配置文件,通过配置文件中所配置的告警策略实现对私有云的高可用的监控,可实现在私有云的相关数据发生异常问题时能及时产生告警,并确保在不增加成本的情况下提高私有云监控的高可用以及便于用户运维的效果。
请参阅图2,图2是本申请另一实施例提供的一种基于Prometheus的私有云监控方法的示意流程图。如图2所示,该方法的步骤包括步骤S201~S205′。其中步骤S201~S205与上述实施例中的步骤S101~S105的步骤的相关解释和详细说明在此不再赘述,下面详细说明的为本实施例中所增加的步骤。
步骤S201,若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。步骤S202,若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略。步骤S203,解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。步骤S204,将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。步骤S205,根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
步骤S202′,若在预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,根据所述监控请求向从节点发起第二连接请求。在本实施例中,若监控服务器止啊预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,则表明此时的主节点发生宕机或者不能够与云管理平台进行连接,此时需要根据监控请求,向从节点发起第二连接请求,以实现对云管理平台的持续监控。通常,可以通过Keepalive来实现主节点和从节点之间的切换,即能够快速的从主节点切换到从节点。
步骤S202a′,若在预设时间范围内接收到从节点响应所述第二连接请求而返回的第二 响应信息,获取从节点的本地磁盘中的Prometheus监控的第二配置文件,所述第二配置文件包括第二数据采集策略以及第二告警策略。在本实施例中,当监控服务器进行主从切换之后,此时若在预设时间范围内,从节点接收第二连接请求并响应生成第二响应信息后,能够将第二响应信息返回给到监控服务器,此时监控服务器则能与从节点建立连接,进而可以从从节点的本地磁盘中获取到Prometheus监控的第二配置文件。由于从节点是相对于主节点的备份,故所述第二配置文件也与第一配置文件相同,即第二配置文件也包括第二数据采集策略以及第二告警策略。
步骤S203′,解析所获取的第二配置文件,以获取所述第二数据采集策略,并根据所述第二数据采集策略进行相应的数据采集。在本实施例中,监控服务器能够解析所获取的第二配置文件,从而获取到第二数据采集策略和第二告警策略。此处,获取第二数据采集策略之后,可以根据该第二数据采集策略来实现相应的数据的采集。例如,对于私有云而言,为对其性能及安全等进行实时监控,此时可以对于私有云中传输的数据流量信息、数据存储信息以及服务器的CPU占比等数据进行监控获取,并通过后续的对比分析来实现对私有云的性能的监控和告警等。作为可选的,可以每隔预设时间即对相关数据进行一次采集更新。
步骤S204′,将所采集到的数据存储到所述从节点的本地磁盘中的Prometheus数据库中。
在本实施例中,当监控服务器采集到相应的数据后,为了便于对相关数据进行统计分析,可以将所采集到的数据都存储到从节点的本地磁盘中的Prometheus数据库中,当需要进行告警分析的时候,则从Prometheus数据库中进行数据调取,不仅方便数据的管理,还便于用户对数据的处理和分析。
步骤S205′,根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。在本实施例中,监控服务器能够根据所述第二配置文件中的第二告警策略,从主节点的本地磁盘中的Prometheus数据库中读取的相应的数据,并能够实现对所读取的相关数据进行告警分析处理。
在一实施例中,所述方法还可以包括以下步骤:步骤S206′,根据预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中。在本实施例中,为了实现私有云监控的高可用性,通常会采用预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中,从而实现主从节点的数据的同步更新,以便于在其中一个节点出现问题时,另一个节点能够实时顶替该节点的位置,从而不间断地实现对私有云的监控。作为可选的,该预设同步规则可以是Rsync工具,Rsync工具是数据镜像备份工具,能够实现本地不同路径下的文件的同步,即实现本地文件的同步的增删改等操作。作为可选的,监控服务器通过监控到主节点恢复正常后,还可以通过反向同步性能数据和监控配置信息数据再次使用主节点中的Prometheus监控,从而提供持续可用的主从模式的监控高可用方案。
在进一步的实施例中,所述方法还可以包括以下步骤:步骤S207′,若接收到云管理平 台发送的配置文件修改请求,根据所述配置文件修改请求对所述从节点的本地磁盘中的配置文件进行修改以得到新的配置文件。在本实施例中,监控服务器若收到到云管理平台发送的配置文件修改请求,则可以根据该配置文件修改请求来实现对所述从节点的本地磁盘中的第二配置文件的修改,修改后的第二配置文件即为新的第二配置文件。
步骤S208′,根据预设同步规则将所述从节点的本地磁盘中的新的配置文件同步到主节点的本地磁盘中以替换原有的配置文件。在本实施例中,当从节点中的第二配置文件经过修改变为新的第二配置文件后,可以通过预设同步规则将其同步至主节点的本地磁盘中,并用于替换掉原有的第一配置文件,即将新的第二配置文件作为新的第一配置文件,由于从节点的本地磁盘中的内容相当于是对主节点的备份,故通常两者之间的第一配置文件和第二配置文件是相同的。
请参阅图3,图3是本申请另一实施例提供的一种基于Prometheus的私有云监控方法的示意流程图。如图3所示,该方法的步骤包括步骤S301a~S305。其中与上述实施例中的步骤S101-S105类似的步骤的相关解释和详细说明在此不再赘述,下面详细说明的为本实施例中所增加的步骤。
步骤S301a,若接收到云管理平台发送的用户监控登录请求,解析所述用户监控登录请求以获取相应的请求信息,所述请求信息包括用户账号和用户密码。步骤S301b,若预设数据库中包括所述用户账号,判断所述用户账号所关联的预设密码是否与所述用户密码相匹配。步骤S301c,若所述用户账号所关联的预设密码与所述用户密码相匹配,则用户监控登录成功。其中,用户可以根据自身需求在云管理平台注册监控管理账号,并能够阻止云管理平台进行登录,并向监控服务器发送用户监控登录请求,监控服务器能够解析该用户监控登录请求从而获取用户账号和用户密码,进而进行相应的匹配检测,若匹配通过,则用户监控登录成功,此时监控管理系统可以实现对私有云的云管理平台的全面可持续的高可用监控。步骤S301,若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。步骤S302,若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略。步骤S303,解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。步骤S304,将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。步骤S305,根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
本领域普通技术员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。
请参阅图4,对应上述一种基于Prometheus的私有云监控方法,本申请实施例还提出一种基于Prometheus的私有云监控装置,该装置100包括:第一请求单元101、第一获取单元 102、第一处理单元103、第一存储单元104以及第一分析单元105。
所述第一请求单元101,用于若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。
所述第一获取单元102,用于若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略。
所述第一处理单元103,用于解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。
所述第一存储单元104,用于将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。
所述第一分析单元105,用于根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
在一实施例中,所述装置100还可以包括以下单元:第一同步单元106,用于根据预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中。在进一步的实施例中,所述装置100还可以包括以下单元:第一修改单元107,用于若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述主节点的本地磁盘中的第一配置文件进行修改以得到新的第一配置文件。第一更新单元108,用于根据预设同步规则将所述主节点的本地磁盘中的新的第一配置文件同步到从节点的本地磁盘中以替换原有的第二配置文件,并将其作为新的第二配置文件。
请参阅图5,对应上述一种基于Prometheus的私有云监控方法,本申请另一实施例还提出一种基于Prometheus的私有云监控装置,该装置200包括:第一请求单元201、第一获取单元202、第一处理单元203、第一存储单元204、第一分析单元205、第二请求单元202′、第二获取单元202a′、第二处理单元203′、第二存储单元204′以及第二分析单元205′。其中与上述实施例中的第一请求单元101、第一获取单元102、第一处理单元103、第一存储单元104以及第一分析单元105相同的单元的相关解释和详细说明在此不再赘述,下面详细说明的为本实施例中所增加的单元。
所述第一请求单元201,用于若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。
所述第一获取单元202,用于若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略。
所述第一处理单元203,用于解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。
所述第一存储单元204,用于将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。
所述第一分析单元205,用于根据所述第一配置文件的第一告警策略对从所述主节点的 本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
所述第二请求单元202′,用于若在预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,根据所述监控请求向从节点发起第二连接请求。
所述第二获取单元202a′,用于若在预设时间范围内接收到从节点响应所述第二连接请求而返回的第二响应信息,获取从节点的本地磁盘中的Prometheus监控的第二配置文件,所述第二配置文件包括第二数据采集策略以及第二告警策略。
所述第二处理单元203′,用于解析所获取的第二配置文件,以获取所述第二数据采集策略,并根据所述第二数据采集策略进行相应的数据采集。
所述第二存储单元204′,用于将所采集到的数据存储到所述从节点的本地磁盘中的Prometheus数据库中。
所述第二分析单元205′,用于根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
在一实施例中,所述装置200还可以包括以下单元:
第二同步单元206′,用于根据预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中。
在进一步的实施例中,所述装置200还可以包括以下单元:
第二修改单元207′,用于若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述从节点的本地磁盘中的配置文件进行修改以得到新的配置文件。
第二更新单元208′,用于根据预设同步规则将所述从节点的本地磁盘中的新的配置文件同步到主节点的本地磁盘中以替换原有的配置文件。
请参阅图6,对应上述一种基于Prometheus的私有云监控方法,本申请另一实施例还提出一种基于Prometheus的私有云监控装置,该装置300包括:请求单元301a、判断单元301b、登录单元301c、第一请求单元301、第一获取单元302、第一处理单元303、第一存储单元304以及第一分析单元305。其中与上述实施例中的第一请求单元101、第一获取单元102、第一处理单元103、第一存储单元104以及第一分析单元105相同的单元的相关解释和详细说明在此不再赘述,下面详细说明的为本实施例中所增加的单元。
请求单元301a,用于若接收到云管理平台发送的用户监控登录请求,解析所述用户监控登录请求以获取相应的请求信息,所述请求信息包括用户账号和用户密码。
判断单元301b,用于若预设数据库中包括所述用户账号,判断所述用户账号所关联的预设密码是否与所述用户密码相匹配。
登录单元301c,用于若所述用户账号所关联的预设密码与所述用户密码相匹配,则用户监控登录成功。
第一请求单元301,用于若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求。
第一获取单元302,用于若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一 配置文件包括第一数据采集策略以及第一告警策略。
第一处理单元303,用于解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集。
第一存储单元304,用于将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中。
第一分析单元305,用于根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述基于Prometheus的私有云监控装置100和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
由以上可见,在硬件实现上,以上第一请求单元101、第一获取单元102、第一处理单元103、第一存储单元104以及第一分析单元105等可以以硬件形式内嵌于或独立于基于Prometheus的私有云监控的装置中,也可以以软件形式存储于基于Prometheus的私有云监控装置的存储器中,以便处理器调用执行以上各个单元对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。
上述基于Prometheus的私有云监控装置可以实现为一种计算机程序的形式,计算机程序可以在如图7所示的计算机设备上运行。
图7为本申请一种计算机设备的结构组成示意图。该设备可以是服务器,其中,服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。
参照图7,该计算机设备400包括通过系统总线401连接的处理器402、存储器和网络接口405,其中,存储器可以包括非易失性存储介质403和内存储器404。
该非易失性存储介质403可存储操作系统4031和计算机程序4032,该计算机程序4032被执行时,可使得处理器402执行一种基于Prometheus的私有云监控方法。该处理器402用于提供计算和控制能力,支撑整个计算机设备400的运行。该内存储器404为非易失性存储介质403中的计算机程序4032的运行提供环境,该计算机程序4032被处理器402执行时,可使得处理器402执行一种基于Prometheus的私有云监控方法。该网络接口405用于与其它设备进行网络通信。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备400的限定,具体的计算机设备400可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器402用于运行存储在存储器中的计算机程序4032,以实现上述实施例中的基于Prometheus的私有云监控方法的步骤。
应当理解,在本申请实施例中,处理器402可以是中央处理单元(Central Processing Unit,CPU),该处理器402还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、 分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供一种存储介质。该计算机可读存储介质可以是非易失性,也可以是易失性。该存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行上述实施例中的基于Prometheus的私有云监控方法的步骤。
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的实体存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种基于Prometheus的私有云监控方法,其中,所述方法包括:
    若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;
    若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;
    解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;
    根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  2. 如权利要求1所述的方法,其中,所述方法还包括:
    根据预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中。
  3. 如权利要求1所述的方法,其中,所述方法还包括:
    若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述主节点的本地磁盘中的第一配置文件进行修改以得到新的第一配置文件;
    根据预设同步规则将所述主节点的本地磁盘中的新的第一配置文件同步到从节点的本地磁盘中以替换原有的第二配置文件,并将其作为新的第二配置文件。
  4. 如权利要求1所述的方法,其中,所述若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求的步骤之后,还包括:
    若在预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,根据所述监控请求向从节点发起第二连接请求;
    若在预设时间范围内接收到从节点响应所述第二连接请求而返回的第二响应信息,获取从节点的本地磁盘中的Prometheus监控的第二配置文件,所述第二配置文件包括第二数据采集策略以及第二告警策略;
    解析所获取的第二配置文件,以获取所述第二数据采集策略,并根据所述第二数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述从节点的本地磁盘中的Prometheus数据库中;
    根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  5. 如权利要求4所述的方法,其中,所述方法还包括:
    根据预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中。
  6. 如权利要求4所述的方法,其中,所述方法还包括:
    若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述从节 点的本地磁盘中的配置文件进行修改以得到新的配置文件;
    根据预设同步规则将所述从节点的本地磁盘中的新的配置文件同步到主节点的本地磁盘中以替换原有的配置文件。
  7. 如权利要求1所述的方法,其中,所述若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求的步骤之前,还包括:
    若接收到云管理平台发送的用户监控登录请求,解析所述用户监控登录请求以获取相应的请求信息,所述请求信息包括用户账号和用户密码;
    若预设数据库中包括所述用户账号,判断所述用户账号所关联的预设密码是否与所述用户密码相匹配;
    若所述用户账号所关联的预设密码与所述用户密码相匹配,则用户监控登录成功。
  8. 一种基于Prometheus的私有云监控装置,其中,所述装置包括:
    第一请求单元,用于若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;
    第一获取单元,用于若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;
    第一处理单元,用于解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;
    第一存储单元,用于将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;
    第一分析单元,用于根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  9. 一种计算机设备,包括存储器以及与所述存储器相连的处理器;其中,所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行以下步骤:
    若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;
    若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;
    解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;
    根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  10. 如权利要求9所述的计算机设备,其中,所述根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    根据预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中。
  11. 如权利要求9所述的计算机设备,其中,所述根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述主节点的本地磁盘中的第一配置文件进行修改以得到新的第一配置文件;
    根据预设同步规则将所述主节点的本地磁盘中的新的第一配置文件同步到从节点的本地磁盘中以替换原有的第二配置文件,并将其作为新的第二配置文件。
  12. 如权利要求9所述的计算机设备,其中,所述若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求之后,还包括:
    若在预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,根据所述监控请求向从节点发起第二连接请求;
    若在预设时间范围内接收到从节点响应所述第二连接请求而返回的第二响应信息,获取从节点的本地磁盘中的Prometheus监控的第二配置文件,所述第二配置文件包括第二数据采集策略以及第二告警策略;
    解析所获取的第二配置文件,以获取所述第二数据采集策略,并根据所述第二数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述从节点的本地磁盘中的Prometheus数据库中;
    根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  13. 如权利要求12所述的计算机设备,其中,所述根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    根据预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中。
  14. 如权利要求12所述的计算机设备,其中,所述根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述从节点的本地磁盘中的配置文件进行修改以得到新的配置文件;
    根据预设同步规则将所述从节点的本地磁盘中的新的配置文件同步到主节点的本地磁盘中以替换原有的配置文件。
  15. 如权利要求9所述的计算机设备,其中,所述若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求之前,还包括:
    若接收到云管理平台发送的用户监控登录请求,解析所述用户监控登录请求以获取相应 的请求信息,所述请求信息包括用户账号和用户密码;
    若预设数据库中包括所述用户账号,判断所述用户账号所关联的预设密码是否与所述用户密码相匹配;
    若所述用户账号所关联的预设密码与所述用户密码相匹配,则用户监控登录成功。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下操作:
    若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求;
    若在预设时间范围内接收到主节点响应所述第一连接请求而返回的第一响应信息,获取主节点的本地磁盘中的Prometheus监控的第一配置文件,所述第一配置文件包括第一数据采集策略以及第一告警策略;
    解析所获取的第一配置文件,以获取所述第一数据采集策略,并根据所述第一数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述主节点的本地磁盘中的Prometheus数据库中;
    根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    根据预设同步规则将所述主节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到从节点的本地磁盘中的Prometheus数据库中。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述根据所述第一配置文件的第一告警策略对从所述主节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    若接收到云管理平台发送的配置文件修改请求,根据所述配置文件修改请求对所述主节点的本地磁盘中的第一配置文件进行修改以得到新的第一配置文件;
    根据预设同步规则将所述主节点的本地磁盘中的新的第一配置文件同步到从节点的本地磁盘中以替换原有的第二配置文件,并将其作为新的第二配置文件。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述若接收到云管理平台发起的监控请求,根据所述监控请求向主节点发起第一连接请求之后,还包括:
    若在预设时间范围内没有接收到主节点响应所述第一连接请求而返回的第一响应信息,根据所述监控请求向从节点发起第二连接请求;
    若在预设时间范围内接收到从节点响应所述第二连接请求而返回的第二响应信息,获取从节点的本地磁盘中的Prometheus监控的第二配置文件,所述第二配置文件包括第二数据采集策略以及第二告警策略;
    解析所获取的第二配置文件,以获取所述第二数据采集策略,并根据所述第二数据采集策略进行相应的数据采集;
    将所采集到的数据存储到所述从节点的本地磁盘中的Prometheus数据库中;
    根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述根据所述第二配置文件的第二告警策略对从所述从节点的本地磁盘中的Prometheus数据库中读取的相应的数据进行告警分析之后,还包括:
    根据预设同步规则将所述从节点的本地磁盘中的Prometheus数据库中所存储的数据同步存储到主节点的本地磁盘中的Prometheus数据库中。
PCT/CN2020/099190 2020-03-18 2020-06-30 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质 Ceased WO2021184587A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010189434.6 2020-03-18
CN202010189434.6A CN111459749B (zh) 2020-03-18 2020-03-18 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021184587A1 true WO2021184587A1 (zh) 2021-09-23

Family

ID=71683202

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099190 Ceased WO2021184587A1 (zh) 2020-03-18 2020-06-30 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111459749B (zh)
WO (1) WO2021184587A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443047A (zh) * 2021-12-28 2022-05-06 天翼云科技有限公司 一种解析PromeQL的方法、装置及设备
CN114553740A (zh) * 2022-03-11 2022-05-27 以萨技术股份有限公司 一种跨网监控的方法、系统、可读存储介质及设备
CN114866551A (zh) * 2022-06-06 2022-08-05 中国工商银行股份有限公司 Prometheus集群的处理方法、装置、设备及存储介质
CN115827461A (zh) * 2022-12-05 2023-03-21 雄狮汽车科技(南京)有限公司 车辆软件的告警系统及方法
CN116361342A (zh) * 2023-03-23 2023-06-30 中国—东盟信息港股份有限公司 一种同步Prometheus告警数据的方法、系统、设备及存储介质
CN116405417A (zh) * 2023-01-03 2023-07-07 烽火通信科技股份有限公司 一种监控部署方法、设备及装置
CN116737514A (zh) * 2023-08-15 2023-09-12 南京国睿信维软件有限公司 一种基于日志与探针解析自动化运维方法

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130996B (zh) * 2020-09-22 2025-02-07 腾讯科技(深圳)有限公司 数据监控控制系统、方法、装置、电子设备和存储介质
CN112511339B (zh) * 2020-11-09 2023-04-07 宝付网络科技(上海)有限公司 基于多集群的容器监控告警方法、系统、设备及存储介质
CN114666249B (zh) * 2020-12-03 2023-07-07 腾讯科技(深圳)有限公司 云平台上的流量采集方法、设备以及计算机可读存储介质
CN112650644A (zh) * 2020-12-22 2021-04-13 南方电网深圳数字电网研究院有限公司 一种基于prometheus的监控方法及系统
CN116186160B (zh) * 2023-02-10 2026-02-10 上海沄熹科技有限公司 一种时序数据库之间的数据同步方法及工具
CN117574010B (zh) * 2023-11-03 2024-07-19 中信建投证券股份有限公司 一种数据采集方法、装置、设备以及存储介质
CN118631824A (zh) * 2024-06-05 2024-09-10 江苏智先生信息科技有限公司 一种基于设备自主管理的医用数据保护和实时监控系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486445A (zh) * 2014-12-30 2015-04-01 北京天云融创软件技术有限公司 一种基于云平台的分布式可扩展资源监控系统及方法
CN109245931A (zh) * 2018-09-19 2019-01-18 四川长虹电器股份有限公司 基于kubernetes的容器云平台的日志管理和监控报警的实现方法
CN109586999A (zh) * 2018-11-12 2019-04-05 深圳先进技术研究院 一种容器云平台状态监控预警系统、方法及电子设备
CN110247810A (zh) * 2019-07-09 2019-09-17 浪潮云信息技术有限公司 一种收集容器服务监控数据的系统及方法
KR102062576B1 (ko) * 2018-10-10 2020-01-06 숭실대학교산학협력단 Vm 기반의 vnf 및 컨테이너 기반의 vnf를 모두 모니터링하기 위한 vnf 모니터링 시스템
CN110659109A (zh) * 2019-09-26 2020-01-07 上海仪电(集团)有限公司中央研究院 一种openstack集群虚拟机监控系统及方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108289034B (zh) * 2017-06-21 2019-04-09 新华三大数据技术有限公司 一种故障发现方法和装置
CN107844399B (zh) * 2017-10-10 2020-06-16 武汉斗鱼网络科技有限公司 自动监控数据库服务的方法、存储介质、电子设备及系统
CN108763026A (zh) * 2018-05-31 2018-11-06 郑州云海信息技术有限公司 一种磁盘监控告警方法、系统、设备及计算机存储介质
RU2716029C1 (ru) * 2019-07-04 2020-03-05 Общество с ограниченной ответственностью «Инлексис» (ООО «Инлексис») Система мониторинга качества и процессов на базе машинного обучения
CN110688281A (zh) * 2019-09-25 2020-01-14 凡普数字技术有限公司 监控系统中的告警方法、装置以及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486445A (zh) * 2014-12-30 2015-04-01 北京天云融创软件技术有限公司 一种基于云平台的分布式可扩展资源监控系统及方法
CN109245931A (zh) * 2018-09-19 2019-01-18 四川长虹电器股份有限公司 基于kubernetes的容器云平台的日志管理和监控报警的实现方法
KR102062576B1 (ko) * 2018-10-10 2020-01-06 숭실대학교산학협력단 Vm 기반의 vnf 및 컨테이너 기반의 vnf를 모두 모니터링하기 위한 vnf 모니터링 시스템
CN109586999A (zh) * 2018-11-12 2019-04-05 深圳先进技术研究院 一种容器云平台状态监控预警系统、方法及电子设备
CN110247810A (zh) * 2019-07-09 2019-09-17 浪潮云信息技术有限公司 一种收集容器服务监控数据的系统及方法
CN110659109A (zh) * 2019-09-26 2020-01-07 上海仪电(集团)有限公司中央研究院 一种openstack集群虚拟机监控系统及方法

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443047A (zh) * 2021-12-28 2022-05-06 天翼云科技有限公司 一种解析PromeQL的方法、装置及设备
CN114553740A (zh) * 2022-03-11 2022-05-27 以萨技术股份有限公司 一种跨网监控的方法、系统、可读存储介质及设备
CN114553740B (zh) * 2022-03-11 2023-11-10 以萨技术股份有限公司 一种跨网监控的方法、系统、可读存储介质及设备
CN114866551A (zh) * 2022-06-06 2022-08-05 中国工商银行股份有限公司 Prometheus集群的处理方法、装置、设备及存储介质
CN115827461A (zh) * 2022-12-05 2023-03-21 雄狮汽车科技(南京)有限公司 车辆软件的告警系统及方法
CN116405417A (zh) * 2023-01-03 2023-07-07 烽火通信科技股份有限公司 一种监控部署方法、设备及装置
CN116361342A (zh) * 2023-03-23 2023-06-30 中国—东盟信息港股份有限公司 一种同步Prometheus告警数据的方法、系统、设备及存储介质
CN116737514A (zh) * 2023-08-15 2023-09-12 南京国睿信维软件有限公司 一种基于日志与探针解析自动化运维方法
CN116737514B (zh) * 2023-08-15 2023-12-22 南京国睿信维软件有限公司 一种基于日志与探针解析自动化运维方法

Also Published As

Publication number Publication date
CN111459749B (zh) 2024-08-16
CN111459749A (zh) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2021184587A1 (zh) 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质
US20220391293A1 (en) Systems and methods for enabling a highly available managed failover service
WO2021184586A1 (zh) 基于非扁平网络的私有云监控方法、装置、计算机设备及存储介质
WO2021056949A1 (zh) 一种边缘应用管理方法及系统
US10044550B2 (en) Secure cloud management agent
US11366728B2 (en) Systems and methods for enabling a highly available managed failover service
WO2018036148A1 (zh) 一种服务器集群系统
CN103605722B (zh) 数据库监控方法及装置、设备
US20140068040A1 (en) System for Enabling Server Maintenance Using Snapshots
US11153173B1 (en) Dynamically updating compute node location information in a distributed computing environment
CN111052092B (zh) 集群系统、集群系统控制方法、服务器设备、控制方法和存储程序的非暂时性计算机可读介质
CN111698126B (zh) 信息监控方法、系统及计算机可读存储介质
CN103677967A (zh) 一种数据库的远程数据服务系统及任务调度方法
KR102665749B1 (ko) 클라우드 저하 모드에서 지속적인 디바이스 동작 안정성을 보장하기 위한 방법 및 장치
CN111258627A (zh) 一种接口文档生成方法和装置
CN104243195A (zh) 异地灾备处理方法及装置
CN100426751C (zh) 保证集群系统中配置信息一致的方法
CN113835836A (zh) 动态发布容器服务的系统、方法、计算机设备及介质
WO2019019457A1 (zh) 控制中心装置、业务系统处理的方法、系统及存储介质
CN116668269A (zh) 一种用于双活数据中心的仲裁方法、装置及系统
WO2025097974A1 (zh) 异常处理系统、方法、设备及存储介质
CN111722988A (zh) 一种数据空间节点的故障切换方法和装置
CN113918390A (zh) 一种业务服务提供方法、装置、服务器和存储介质
HK40032036A (zh) 基於prometheus的私有云监控方法、装置、计算机设备及存储介质
HK40032036B (zh) 基於prometheus的私有云监控方法、装置、计算机设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20925382

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20925382

Country of ref document: EP

Kind code of ref document: A1