CN115904879A - Instance distribution system, method and device for Prometous cluster - Google Patents

Instance distribution system, method and device for Prometous cluster Download PDF

Info

Publication number
CN115904879A
CN115904879A CN202310014948.1A CN202310014948A CN115904879A CN 115904879 A CN115904879 A CN 115904879A CN 202310014948 A CN202310014948 A CN 202310014948A CN 115904879 A CN115904879 A CN 115904879A
Authority
CN
China
Prior art keywords
instance
cluster
prometheus
server
cache pool
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.)
Granted
Application number
CN202310014948.1A
Other languages
Chinese (zh)
Other versions
CN115904879B (en
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.)
Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Original Assignee
Tianjin Zhuolang Kunlun Cloud Software Technology 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 Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd filed Critical Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Priority to CN202310014948.1A priority Critical patent/CN115904879B/en
Publication of CN115904879A publication Critical patent/CN115904879A/en
Application granted granted Critical
Publication of CN115904879B publication Critical patent/CN115904879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides an instance distribution system, a method and equipment for a Prometheus cluster, relating to the field of server deployment, wherein the instance distribution system dynamically configures an Exporter instance to be pulled for a Prometheus main server through a heartbeat detector, an instance cache pool, an instance dynamic distribution module and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instance to be pulled is redistributed through the components, so that high availability of the service under the condition of down or abnormal service is ensured.

Description

Example distribution system, method and equipment for Prometheus cluster
Technical Field
The present invention relates to the field of server deployment, and in particular, to an instance distribution system, method, and device for a promemeus cluster.
Background
The Prometheus cluster is used as an open-source monitoring system and an alarm system, and is suitable for monitoring hardware indexes such as server and the like and high-dynamic service-architecture-oriented monitoring. Therefore, how to make the Prometheus cluster have high availability becomes an urgent problem to be solved in the prior art. High availability refers to the ability to minimize down time due to routine maintenance operations and sudden system crashes. For a Prometheus cluster, the high availability schemes in the prior art mainly include dual hot-standby, federal mode, use of K8S mechanism, thanos, and the like. However, in the above solution, each Server in the dual-Server hot-standby will pull all the data of the Exporter instance (agent program of the monitored end) in full, and may have one or more times more query requests for the monitored end; the Server with excessive redundancy exists in the federal mode, and the Server has a hierarchical structure, a complex structure and complex operation and maintenance. In the K8S and Thanos solutions, there are too many components to quote, which is clearly not light enough for small scale to support highly available scenes.
In summary, the Prometheus cluster in the prior art also has the problems of repeated pulling of Exporter instances, multiple dependent components and complex operation and maintenance.
Disclosure of Invention
In view of this, an object of the present invention is to provide an instance allocation system, method and device for a Prometheus cluster, wherein an Exporter instance to be pulled is dynamically configured for a Prometheus primary server through a heartbeat detector, an instance cache pool, an instance dynamic allocation module and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instance to be pulled is redistributed through the components, so that high availability of the service under the condition of down or abnormal service is ensured.
In a first aspect, an embodiment of the present invention provides an instance distribution system for a Prometheus cluster, where the system includes: the system comprises a heartbeat detector, an instance cache pool, an instance dynamic allocation module and a dynamic service registration module;
the heartbeat detector and the instance cache pool are arranged in all servers contained in the Prometheus cluster; the server comprises a main server and a plurality of slave servers; the instance dynamic allocation module and the dynamic service registration module are both arranged in the main server;
the input end of the instance cache pool is connected with an Exporter instance of the Prometheus cluster; the output end of the instance cache pool is connected with the main server after passing through the instance dynamic allocation module and the dynamic service registration module respectively; the master server is connected with the slave server through the virtual address of the Prometheus cluster.
In some embodiments, a persistent queue is included in the instance cache pool; the information parameters of the instance are contained in the persistence queue, and the information parameters at least comprise: mac address, IP address, instance name, server name, and registration flag parameter.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: a data bus; the data bus is connected to the host server via the virtual address of the Prometheus cluster.
In some embodiments, the instance distribution system for Prometheus cluster further comprises: querying a filter;
wherein, the data bus is connected with the query filter; the query filter is used for classifying, sorting and correcting the data of the servers acquired in the data bus.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: a shared memory unit;
the shared storage unit is connected with the instance cache pool; the shared storage unit is used for storing the data of the server in the instance cache pool.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: a timing unit; the timing unit is arranged in the data bus and used for controlling the data bus to acquire data from all the servers at regular time through the virtual address of the Prometous cluster.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: an abnormality acquisition unit; the exception acquisition unit is arranged in the slave server through an instance cache pool; the exception acquiring unit is used for acquiring exception data generated from the server.
In a second aspect, an embodiment of the present invention provides an instance allocation method for a Prometheus cluster, where the method is applied to the instance allocation system for a Prometheus cluster mentioned in the first aspect, and the method includes:
initializing a Prometous cluster, and determining a master server and a slave server from the initialized Prometous cluster;
binding all servers contained in the Prometous cluster with the virtual address, and storing instance information in all the servers into a queue of an instance cache pool;
controlling a main server to obtain distribution data from a queue of an instance cache pool by using a heartbeat detector, and determining a distribution strategy according to the distribution data;
and according to the distribution strategy, distributing the slave servers by using the instance dynamic distribution module and the dynamic service registration module.
In a third aspect, an embodiment of the present invention further provides an instance allocation apparatus for a promemeus cluster, including: a processor and a memory; the memory has stored thereon a computer program which, when executed by the processor, implements the steps of the example allocation method for Prometheus clusters mentioned in the first aspect above.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the example allocation method for Prometheus cluster mentioned in the above first aspect.
The embodiment of the invention has the following beneficial effects:
the invention provides an example distribution system, a method and equipment for a Prometous cluster, wherein the system comprises the following steps: the system comprises a heartbeat detector, an instance cache pool, an instance dynamic allocation module and a dynamic service registration module; the heartbeat detector and the instance cache pool are arranged in all servers contained in the Prometheus cluster; the server comprises a main server and a plurality of slave servers; the instance dynamic allocation module and the dynamic service registration module are both arranged in the main server; the input end of the instance cache pool is connected with an Exporter instance of the Prometheus cluster; the output end of the instance cache pool is connected with the main server after passing through the instance dynamic allocation module and the dynamic service registration module respectively; the master server is connected to the slave servers via the virtual address of the Prometheus cluster. In the process of carrying out instance allocation on a Prometous cluster by using the instance allocation system, initializing the Prometous cluster, determining a master server and a slave server from the initialized Prometous cluster, binding all servers contained in the Prometous cluster with virtual addresses, and storing instance information in all servers into a queue of an instance cache pool; then, controlling the main server to acquire distribution data from the queue of the instance cache pool by using the heartbeat detector, and determining a distribution strategy according to the distribution data; and finally, according to the distribution strategy, the slave server is distributed by using the instance dynamic distribution module and the dynamic service registration module. The example distribution system for the Prometheus cluster can dynamically configure an Exporter example to be pulled for a Prometheus main server through a heartbeat detector, an example cache pool, an example dynamic distribution module and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instances to be pulled are redistributed through the components, and therefore high availability of the service under the condition of down or abnormal service is guaranteed.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth hereinafter.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
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 embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic structural diagram of an example distribution system for Prometheus cluster according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of another example distribution system for Prometous clusters according to an embodiment of the present invention;
FIG. 3 is a flowchart of an example distribution method for Prometheus clusters according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an example distribution device for a Prometheus cluster according to an embodiment of the present invention.
Icon:
100-a heartbeat detector; 200-instance cache pool; 300-instance dynamic allocation module; 400-dynamic service registration module; 500-a data bus; 600-a query filter; 700-shared memory unit; 800-a timing unit; 900-exception obtaining unit;
101-a processor; 102-a memory; 103-a bus; 104-communication interface.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
The Prometheus cluster is used as an open-source monitoring system and an alarm system, and is suitable for monitoring hardware indexes such as a server and the like and high-dynamic service-oriented architecture. Therefore, how to make the Prometheus cluster have high availability becomes an urgent problem to be solved in the prior art. High availability refers to the ability to minimize down time due to routine maintenance operations and sudden system crashes. For a Prometheus cluster, the high availability schemes in the prior art mainly include dual hot-standby, federal mode, use of K8S mechanism, thanos, and the like. However, in the above solution, each Server in the dual-Server hot-standby will pull all the data of the Exporter instance (agent program of the monitored end) in full, and may have one or more times more query requests for the monitored end; the Server with excessive redundancy exists in the federal mode, and the Server has a hierarchical structure, a complex structure and complex operation and maintenance. In the K8S and Thanos solutions, there are too many components to reference, and it is clearly not light-weight enough for small-scale and desired support of highly available scenes.
In summary, the Prometheus cluster in the prior art also has the problems of repeated fetching of Exporter instances, more dependent components and complex operation and maintenance. Based on this, the embodiment of the present invention provides an instance allocation system, method and device for a Prometheus cluster, wherein an Exporter instance to be pulled is dynamically configured for a Prometheus main server through a heartbeat detector, an instance cache pool, an instance dynamic allocation module and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instance to be pulled is redistributed through the components, so that high availability of the service under the condition of down or abnormal service is ensured.
To facilitate understanding of the embodiment, first, a detailed description is given of an example distribution system for Prometheus cluster disclosed in the embodiment of the present invention, specifically, a schematic structural diagram of the example distribution system is shown in fig. 1, and includes: heartbeat detector 100, instance cache pool 200, instance dynamic allocation module 300, dynamic service registration module 400. The heartbeat detector 100 and the instance cache pool 200 are arranged in all servers included in the Prometheus cluster; the server comprises a main server and a plurality of slave servers; the dynamic instance allocation module 300 and the dynamic service registration module 400 are both arranged in the main server, and the input end of the instance cache pool 200 is connected with an Exporter instance of the Prometheus cluster; the output end of the instance cache pool 200 is connected with the main server through an instance dynamic allocation module 300 and a dynamic service registration module 400 respectively; the master server is connected to the slave servers via the virtual address of the Prometheus cluster.
Under the connection relation, the Server of each node in the Prometheus cluster can bind a uniform virtual address through Keepalive, store the Exporter instance information of each node into an instance cache pool and record the Exporter instance information by calling a related interface, wherein the data in the instance cache pool is persistent storage data, and is not database record adopted by related schemes in the prior art. The received Exporter instance information is put into the instance cache pool under the control of the Prometheus cluster.
In an actual scene, in a scene without distributing a Server, the Server value corresponding to the Server is null, and the instance dynamic distribution module does not need to periodically poll, traverse and query; and when new information exists in the persistent data of the dynamic instance allocation module, directly taking the Exporter instance information from the instance cache pool. The example dynamic allocation module also comprises a Server Node table of the Prometheus cluster, and the table records the allocation service number of all Server nodes.
The heartbeat detector is arranged in all the servers, and all the servers mutually explore and activate through heartbeats. When a certain server is abnormal, restarting of the abnormal service can be attempted; if the starting is invalid for many times, the dynamic allocation module of the instance is informed, and at the moment, the information of the abnormal Node in the Server Node of the Prometheus cluster is marked. When the Server value in the information taken out from the queue is the abnormal node, the Server is redistributed to register the abnormal node in other servers, and the abnormal node is put into the tail of the queue again, so that the high availability of the service under the condition of downtime or abnormal service is ensured.
As shown in FIG. 2, in some embodiments, a persistent queue is included in the instance cache pool 200; the information parameters of the instance are contained in the persistence queue, and the information parameters at least comprise: mac address, IP address, instance name, server name, and registration flag parameter.
In some embodiments, the instance distribution system for Prometheus cluster further comprises: a data bus 500 and a query filter 600; the data bus 500 is connected to the host server via the virtual address of the Prometheus cluster. The data bus is connected with the query filter 600; the query filter 600 is used to classify, sort and correct the server data obtained in the data bus. Through the data bus 500 and the query filter 600, a data bus query function is realized inside the component, and flexible query of various condition and expression combinations can be provided.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: a timing unit 800; a timing unit 800 is disposed in the data bus 500, and is used for controlling the data bus 500 to periodically obtain data from all servers through the virtual address of the Prometheus cluster.
The data bus 500 polls the data pulled from each node Server through the timing unit 800, the data of each node is classified, sorted and corrected through the query filter 600, the query filter 600 classifies the data collected from each node according to the exporters, and because each node has some deviation on the same Exporter collecting time, the query filter 600 automatically adjusts the collected index time by taking the data bus 500 collecting time as a reference, and meanwhile, the query filter 600 supports multi-condition and/or flexible expression combination query, and also ensures the unification of query entries.
In some embodiments, the instance distribution system for Prometheus cluster further comprises: a shared memory unit 700; wherein, the shared storage unit 700 is connected with the instance cache pool 200; the shared storage unit 700 is used to store data of servers in the instance cache pool 200.
If the Server value taken out from the persistent queue of the instance cache pool 200 is empty, according to the number of distributed services in the Server Node table, the Server Node with lower distribution number in the distribution table is registered in the service registration component of the Prometheus cluster, and meanwhile, the value of the Server in the message is updated to be the distributed Server, and the message is put into the tail of the queue again.
When the Server value in the information taken out from the queue is not empty, the export dynamic allocation module skips allocation and puts the information into the tail of the queue again. The queue is adopted to reduce the query, and simultaneously ensure that the exporters are distributed according to the plan, thereby realizing that different servers pull different exporters.
The servers pull data according to the export list registered on the service registration component of the Prometheus cluster, so that the situation that each Server pulls all the export data in the same way as the existing scheme in the market is avoided, and cross query is reduced. The Server stores the pulled data into the shared storage, so that the data loss during single-point failure is avoided.
Meanwhile, the native Prometheus only supports manual modification of the Rule file updating expression, the query filter provides an encapsulation interface, and the interface form is supported to modify the Rule file.
In some embodiments, the instance distribution system for a Prometheus cluster further comprises: an abnormality acquisition unit 900; the exception acquiring unit 900 is arranged in the slave server through the instance cache pool 200; the exception acquiring unit 900 is configured to acquire exception data generated from a server.
The heartbeat detector is arranged in all the servers, and all the servers mutually explore and activate through heartbeats. When a certain server is abnormal, restarting of the abnormal service can be attempted; if the multiple startup is invalid, the exception obtaining unit 900 is used to notify the instance dynamic allocation module, and at this time, the information of the abnormal Node in the Server Node of the promemeus cluster is marked. When the Server value in the information taken out from the queue is the abnormal node, the Server is redistributed to register in other servers again, and the Server value is put into the tail of the queue again, so that the high availability of the service under the condition of downtime or abnormal service is ensured.
As can be seen from the example distribution system for a Prometheus cluster in the above embodiment, the system dynamically configures an Exporter example to be pulled for a Prometheus main server through a heartbeat detector, an example cache pool, an example dynamic distribution module, and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instances to be pulled are redistributed through the components, and therefore high availability of the service under the condition of down or abnormal service is guaranteed.
An embodiment of the present invention provides an example distribution method for a Prometheus cluster, where the method is applied to the example distribution system for a Prometheus cluster mentioned in the above embodiment, and as shown in fig. 3, the method includes:
step S301, initializing a Prometheus cluster, and determining a master server and a slave server from the initialized Prometheus cluster.
In practical scenarios, the example distribution system for a Prometheus cluster mentioned in the above embodiments may be arranged in the Prometheus cluster as a relevant component, and complete initialization along with the Prometheus cluster.
Step S302, after all servers contained in the Prometous cluster are bound with the virtual address, the instance information in all the servers is stored in the queue of the instance cache pool.
Dynamically configuring an Exporter to be pulled for a Promultimedia Server through dynamic service registration, an Exporter cache pool and an Expoter dynamic allocation device.
Step S303, the main server is controlled by the heartbeat detector to obtain the distribution data from the queue of the instance cache pool, and the distribution strategy is determined according to the distribution data.
Specifically, if the allocation data includes the downtime data fed back by the secondary server, a corresponding reallocation policy may be determined to ensure the availability of the server.
And step S304, distributing the slave servers by using the instance dynamic distribution module and the dynamic service registration module according to the distribution strategy.
For example, when a Server in the cluster goes down, the export dynamic allocation module is notified, at this time, the information of the abnormal node in the Server node is marked, and when the Server value in the information taken out from the queue is the abnormal node, the export dynamic allocation module re-allocates the Server to other servers and re-registers the Server to the tail of the queue, thereby ensuring high availability of the service under the condition of down or abnormal service.
According to the example allocation method for the Prometheus cluster in the embodiment, the method dynamically configures an Exporter example to be pulled for a Prometheus main server through a heartbeat detector, an example cache pool, an example dynamic allocation module and a dynamic service registration module; when a slave server in the Prometheus cluster is down, the Exporter instance to be pulled is redistributed through the components, so that high availability of the service under the condition of down or abnormal service is ensured.
The example distribution method for the Prometheus cluster provided by the embodiment of the invention has the same technical characteristics as the example distribution system for the Prometheus cluster provided by the embodiment, so that the same technical problems can be solved, and the same technical effects are achieved. For the sake of brevity, where not mentioned in the section of the embodiments, reference may be made to the corresponding matters in the foregoing embodiments.
The embodiment further provides an example distribution device for a Prometheus cluster, and a schematic structural diagram of the example distribution device for the Prometheus cluster is shown in fig. 4, where the device includes a processor 101 and a memory 102; memory 102 is configured to store one or more computer instructions that are executed by the processor to implement the steps of the example assignment method for Prometous clusters described above.
The example distribution device for a Prometheus cluster shown in fig. 4 further comprises a bus 103 and a communication interface 104, the processor 101, the communication interface 104 and the memory 102 being connected via the bus 103.
The Memory 102 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Bus 103 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
The communication interface 104 is used for connecting with at least one user terminal and other network units through a network interface, and sending the packaged IPv4 message or IPv4 message to the user terminal through the network interface.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps of the example allocation method for Prometheus cluster mentioned in the foregoing embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention or a part thereof, which essentially contributes to the prior art, can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An instance distribution system for a Prometous cluster, the system comprising: the system comprises a heartbeat detector, an instance cache pool, an instance dynamic allocation module and a dynamic service registration module;
the heartbeat detector and the instance cache pool are arranged in all servers contained in the Prometheus cluster; wherein, the server comprises a main server and a plurality of slave servers; the instance dynamic allocation module and the dynamic service registration module are both arranged in the main server;
the input end of the instance cache pool is connected with an Exporter instance of the Prometheus cluster; the output end of the instance cache pool is connected with the main server after passing through the instance dynamic allocation module and the dynamic service registration module respectively; the master server is connected with the slave server through the virtual address of the Prometous cluster.
2. The system of claim 1, wherein the pool of instance caches contains a persistent queue; the information parameters of the instance are contained in the persistent queue, and the information parameters at least comprise: mac address, IP address, instance name, server name, and registration flag parameter.
3. The instance distribution system for a Prometheus cluster of claim 1, further comprising: a data bus; the data bus is connected with the main server through a virtual address of the Prometous cluster.
4. The instance distribution system for a Prometheus cluster of claim 3, further comprising: inquiring a filter;
wherein the data bus is connected with the query filter; the query filter is used for classifying, sorting and correcting the data of the server acquired from the data bus.
5. The instance distribution system for a Prometheus cluster of claim 1, further comprising: a shared memory unit;
wherein the shared storage unit is connected with the instance cache pool; the shared storage unit is used for storing the data of the server in the instance cache pool.
6. The instance distribution system for a Prometheus cluster of claim 3, further comprising: a timing unit; the timing unit is arranged in the data bus and used for controlling the data bus to acquire data from all the servers at regular time through the virtual address of the Prometous cluster.
7. The instance distribution system for a Prometheus cluster of claim 1, further comprising: an abnormality acquisition unit; the exception acquisition unit is arranged in the slave server through the instance cache pool; the exception acquiring unit is used for acquiring the exception data generated by the slave server.
8. An instance distribution method for Prometous cluster, the method being applied to the instance distribution system for Prometous cluster of any of the preceding claims 1 to 7, the method comprising:
initializing the Prometheus cluster, and determining a master server and a slave server from the initialized Prometheus cluster;
binding all servers contained in the Prometous cluster with virtual addresses, and storing instance information in all the servers into a queue of an instance cache pool;
controlling the main server to acquire distribution data from the queue of the instance cache pool by using a heartbeat detector, and determining a distribution strategy according to the distribution data;
and according to the distribution strategy, distributing the slave servers by utilizing the instance dynamic distribution module and the dynamic service registration module.
9. An instance distribution device for a Prometous cluster, comprising: a processor and a storage device; stored on said storage means is a computer program which, when being executed by said processor, carries out the steps of the method for instance allocation for a Prometheus cluster as claimed in claim 8 above.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for instance allocation for a Prometheus cluster as claimed in claim 8.
CN202310014948.1A 2023-01-06 2023-01-06 Example distribution system, method and equipment for Prometheus cluster Active CN115904879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310014948.1A CN115904879B (en) 2023-01-06 2023-01-06 Example distribution system, method and equipment for Prometheus cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310014948.1A CN115904879B (en) 2023-01-06 2023-01-06 Example distribution system, method and equipment for Prometheus cluster

Publications (2)

Publication Number Publication Date
CN115904879A true CN115904879A (en) 2023-04-04
CN115904879B CN115904879B (en) 2023-06-06

Family

ID=86481011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310014948.1A Active CN115904879B (en) 2023-01-06 2023-01-06 Example distribution system, method and equipment for Prometheus cluster

Country Status (1)

Country Link
CN (1) CN115904879B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147596A (en) * 2019-12-30 2020-05-12 中国移动通信集团江苏有限公司 Prometous cluster deployment method, device, equipment and medium
CN112994935A (en) * 2021-02-04 2021-06-18 烽火通信科技股份有限公司 prometheus management and control method, device, equipment and storage medium
WO2021184586A1 (en) * 2020-03-18 2021-09-23 平安科技(深圳)有限公司 Private cloud monitoring method and apparatus based on non-flat network, and computer device and storage medium
CN114039836A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Fault processing method and device for Exporter collector
CN114201362A (en) * 2021-12-09 2022-03-18 兴业银行股份有限公司 Prometheus-based enterprise-level high-availability monitoring system and implementation method
CN114398334A (en) * 2022-01-10 2022-04-26 山东浪潮科学研究院有限公司 Prometheus remote storage method and system based on ZNBase cluster
CN114564314A (en) * 2022-03-15 2022-05-31 京东科技信息技术有限公司 Method and device for collecting monitoring data in cluster
CN115373757A (en) * 2022-08-02 2022-11-22 杭州溪塔科技有限公司 Solving method and device for cluster monitoring data loss in Promethues fragmentation mode

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147596A (en) * 2019-12-30 2020-05-12 中国移动通信集团江苏有限公司 Prometous cluster deployment method, device, equipment and medium
WO2021184586A1 (en) * 2020-03-18 2021-09-23 平安科技(深圳)有限公司 Private cloud monitoring method and apparatus based on non-flat network, and computer device and storage medium
CN112994935A (en) * 2021-02-04 2021-06-18 烽火通信科技股份有限公司 prometheus management and control method, device, equipment and storage medium
CN114039836A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Fault processing method and device for Exporter collector
CN114201362A (en) * 2021-12-09 2022-03-18 兴业银行股份有限公司 Prometheus-based enterprise-level high-availability monitoring system and implementation method
CN114398334A (en) * 2022-01-10 2022-04-26 山东浪潮科学研究院有限公司 Prometheus remote storage method and system based on ZNBase cluster
CN114564314A (en) * 2022-03-15 2022-05-31 京东科技信息技术有限公司 Method and device for collecting monitoring data in cluster
CN115373757A (en) * 2022-08-02 2022-11-22 杭州溪塔科技有限公司 Solving method and device for cluster monitoring data loss in Promethues fragmentation mode

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄静;陈秋燕;: "基于Prometheus + Grafana实现企业园区信息化PaaS平台监控", 数字通信世界, no. 09 *

Also Published As

Publication number Publication date
CN115904879B (en) 2023-06-06

Similar Documents

Publication Publication Date Title
CN109428922B (en) Subscription and publishing method and server
CN108683720B (en) Container cluster service configuration method and device
US11122128B2 (en) Method and device for customer resource acquisition, terminal device and storage medium
CN110096336B (en) Data monitoring method, device, equipment and medium
CN111737003B (en) Pod balanced scheduling method and device, master node and storage medium
US20170339238A1 (en) Large message support for a publish-subscribe messaging system
CN104885407A (en) Network function virtualisation NFV fault management apparatus, device, and method
CN107105013B (en) File processing method, server, terminal and system
CN111580884A (en) Configuration updating method and device, server and electronic equipment
CN107210924B (en) Method and apparatus for configuring a communication system
CN110213309B (en) Binding relationship management method, device and storage medium
CN108809848A (en) Load-balancing method, device, electronic equipment and storage medium
EP3172682B1 (en) Distributing and processing streams over one or more networks for on-the-fly schema evolution
CN107819632A (en) A kind of dynamic load leveling group system based on performance monitoring system and Docker Swarm
CN109167819B (en) Data synchronization system, method, device and storage medium
CN111490890A (en) Hierarchical registration method, device, storage medium and equipment based on micro-service architecture
CN113660231A (en) Message parsing method, device, equipment and storage medium
US10951550B2 (en) Logging infrastructure with time sustain requirements
CN114153609A (en) Resource control method and device, electronic equipment and computer readable storage medium
CN105493444A (en) Fault management apparatus, device and method for network function virtualization (nfv)
CN110764705B (en) Data reading and writing method, device, equipment and storage medium
CN115904879A (en) Instance distribution system, method and device for Prometous cluster
CN111008071A (en) Task scheduling system, method and server
CN105912412A (en) Message distribution method, message distribution device and message distribution system
CN112966051A (en) Distributed data exchange system and method

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
GR01 Patent grant
GR01 Patent grant