CN109873736A - A kind of micro services monitoring method and system - Google Patents

A kind of micro services monitoring method and system Download PDF

Info

Publication number
CN109873736A
CN109873736A CN201910048020.9A CN201910048020A CN109873736A CN 109873736 A CN109873736 A CN 109873736A CN 201910048020 A CN201910048020 A CN 201910048020A CN 109873736 A CN109873736 A CN 109873736A
Authority
CN
China
Prior art keywords
service
state
instance
query result
service instance
Prior art date
Application number
CN201910048020.9A
Other languages
Chinese (zh)
Inventor
王富平
翟小青
杨升
崔建梅
孙迁
Original Assignee
苏宁易购集团股份有限公司
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 苏宁易购集团股份有限公司 filed Critical 苏宁易购集团股份有限公司
Priority to CN201910048020.9A priority Critical patent/CN109873736A/en
Publication of CN109873736A publication Critical patent/CN109873736A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5015Service provider selection
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Abstract

The invention discloses a kind of micro services monitoring method and systems, belong to micro services technical field, and method includes: that service register center registers the Service Instance of micro services;Monitoring center sends state acquisition request to gateway;Gateway reception state acquisition request, and the registration of the Service Instance indicated from service register center acquisition state acquisition request;Gateway inquires the service state of the Service Instance of instruction according to registration, and service state query result is sent to monitoring center;Monitoring center receives service state query result and carries out respective handling.The embodiment of the present invention is able to ascend the monitoring convenience and monitoring timeliness of micro services, and the problem of program occupancy monitored there is no resource.

Description

A kind of micro services monitoring method and system

Technical field

The present invention relates to micro services technical field, in particular to a kind of micro services monitoring method and system.

Background technique

Micro services are a kind of methods for developing single application program as a set of small service, and every kind of application program all exists It runs in the process of oneself, and is communicated with lightweight mechanism (usually http resource API).These services are around business Formation function, it can independently be disposed by full-automatic deployment mechanisms.Micro services are substantially Distributed Applications, usually they all It operates on a cluster, Service Instance is had in cluster.

Since micro services operation individual is more, deployment way multiplicity, problem is appeared in everywhere, the monitoring to service state Just become very difficult.The prior art is in micro services monitoring system, for newly-increased Service Instance, it usually needs while to this Service Instance carries out deployment monitoring programme, by monitoring programme timed collection monitoring data, uploads monitoring center, realizes prison with this The purpose of control.

However, there are following defects for the micro services monitoring system of the prior art:

1, configuration is complicated, service monitoring can not automate: newly-increased Service Instance, offline Service Instance, will by configuring, Monitoring programme is destroyed in starting, can not automatic sensing;

2, occupy resource, poor in timeliness: configurator is an individual process, occupies certain machine resources, and take Timing reports mechanism, leads to the latest services state that cannot get micro services, there are the time differences.

Summary of the invention

The present invention is directed to solve at least one of the technical problems existing in the prior art or related technologies, the present invention is mentioned thus For a kind of micro services monitoring method and system.

Specific technical solution provided in an embodiment of the present invention is as follows:

In a first aspect, providing a kind of micro services monitoring method, which comprises

Service register center registers the Service Instance of micro services;

Monitoring center sends state acquisition request to gateway;

The gateway receives the state acquisition request, and obtains the state from the service register center and obtain Request the registration of the Service Instance of instruction;

The gateway inquires the service state of the Service Instance of the instruction according to the registration, and will clothes Business status inquiry result is sent to the monitoring center;

The monitoring center receives the service state query result and carries out respective handling.

Further, after the service register center carries out registration step to the Service Instance of micro services, the method Further include:

The service register center is communicated with the Service Instance using heartbeat mechanism holding, if communication interruption time is more than Preset time, then the service register center nullifies the Service Instance.

Further, the gateway inquires the service shape of the Service Instance of the instruction according to the registration State includes:

The network address of the Service Instance of the instruction is obtained from the registration;

According to the network address, the inquiry request of service state is sent to the Service Instance of the instruction, and receives institute State the service state query result that the Service Instance of instruction returns.

Further, the service state include CPU usage, memory usage, disk read-write, network connection state, HeapSize information and heapUsedSize information it is one or more.

Further, the respective handling includes:

The service state query result is stored;And/or

The service state query result is subjected to page presentation;And/or

According to the service state query result, alarming processing is carried out to the Service Instance of service state exception.

Second aspect provides a kind of micro services monitoring system, the system comprises service register center, monitoring center and Gateway, in which:

The service register center is registered for the Service Instance to micro services;

The monitoring center, for sending state acquisition request to the gateway;

The gateway includes:

Front processor, for receiving the state acquisition request;

Query processor, for obtaining Service Instance that the state acquisition request indicates from the service register center Registration, and according to the registration, inquire the service state of the Service Instance of the instruction;

Results processor, for service state query result to be sent to the monitoring center;

The monitoring center is also used to receive the service state query result and carries out respective handling.

Further, the service register center is also used to:

It is communicated with the Service Instance using heartbeat mechanism holding, if communication interruption time is more than preset time, is nullified The Service Instance.

Further, the query processor includes:

Service processor, the network address of the Service Instance for obtaining the instruction from the registration;

Serviced broadcast plug-in unit, for sending service state to the Service Instance of the instruction according to the network address Inquiry request, and the service state query result that the Service Instance for receiving the instruction returns.

Further, the service state include CPU usage, memory usage, disk read-write, network connection state, HeapSize information and heapUsedSize information it is one or more.

Further, the monitoring center is specifically used for:

The service state query result is stored;

The service state query result is subjected to page presentation;

According to the service state query result, alarming processing is carried out to the Service Instance of service state exception.

Technical solution provided in an embodiment of the present invention has the benefit that

1, it due to the dilatation of micro services, capacity reducing, without carrying out manual configuration, by service register center, can dynamically obtain The Service Instance of micro services is taken, the purpose of automatic sensing Service Instance is realized, improves the monitoring convenience of micro services;

2, traditional approach uses timing mechanism upload service state, and in the embodiment of the present invention, monitoring center can pass through Gateway obtains the latest services state of Service Instance in real time, and timeliness is high, improves monitoring timeliness, and without configuring prison Program is controlled, there is no the monitored program occupation problems of resource.

Detailed description of the invention

To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.

Fig. 1 is a kind of flow chart for micro services monitoring method that the embodiment of the present invention one provides;

Fig. 2 is a kind of block diagram of micro services monitoring system provided by Embodiment 2 of the present invention.

Specific embodiment

To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention Figure, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist Every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.

In the description of the present application, it is to be understood that term " first ", " second " etc. are used for description purposes only, without It can be interpreted as indication or suggestion relative importance.In addition, in the description of the present application, unless otherwise indicated, the meaning of " multiple " It is two or more.

Fig. 1 is a kind of flow chart for micro services monitoring method that the embodiment of the present invention one provides, as shown in Figure 1, this method May include step:

101, service register center registers the Service Instance of micro services.

Specifically, service register center receives the registration information of the micro services Service Instance of active transmission on startup, and Service Instance is registered according to the registration information of Service Instance.

Wherein, registration information includes the information such as micro services title, network address, port, several Service Instances.

After the Service Instance of micro services is registered in service register center completion, the registration of Service Instance can be generated And store, subsequent use is transferred to the registration information of Service Instance in gateway to facilitate.

During an illustrative realization, after step 101, method further include:

Service register center is communicated with Service Instance using heartbeat mechanism holding, if communication interruption time is more than default Between, then service register center nullifies the Service Instance.

Specifically, by the predetermined period time (can be set as 30 seconds) being sent out to service register center after micro services starting Heartbeat is sent, if service register center is not received by the Service Instance of the micro services in preset time (can be set as 90 seconds) Heartbeat, it will nullify the Service Instance.

In the embodiment of the present invention, is registered by Service Instance of the service register center to micro services, be able to ascend prison Control convenience, i.e.,, only need to be by service register center without carrying out manual configuration to the dilatation of micro services, capacity reducing, it being capable of dynamic The Service Instance of micro services is obtained, realizes the purpose of automatic sensing Service Instance.

102, monitoring center sends state acquisition request to gateway.

In the present embodiment, state acquisition request can be http request, be can wrap in state acquisition request containing specified The network address of Service Instance, the specified Service Instance can be single Service Instance, can also be with multiple Service Instances;This Outside, in the case of not specified services example, state acquisition request instruction Service Instance be then in service register center Registered all Service Instances.

Wherein, gateway is the Distributed Services gateway configured using SpringCloud+Zuul.

In the embodiment of the present invention, gateway disposes framework using distributed decentralization, avoids in traditional approach and leads to It crosses and deployment monitoring programme is carried out to Service Instance, and monitoring programme thus avoids list it is possible that the situation of delay machine occurs Point problem, meets high availability.

103, gateway reception state acquisition request, and the clothes that state acquisition request indicates are obtained from service register center The registration of pragmatic example.

Wherein, gateway includes front processor (pre Filters), query processor (route filters) and knot Multiple internal components such as fruit processor (post Filters), query processor further comprise serviced broadcast plug-in unit and service center Manage device.

Specifically, the process may include:

By the front processor reception state acquisition request in gateway, which is pre-processed, into One step, can also include that front processor verifies state acquisition request before pre-processing to state acquisition request The step of;

By the service processor in query processor according to load balancing, to the service register center request shape The registration of the Service Instance of state acquisition request instruction, and receive the state acquisition request instruction of service register center return Service Instance registration.

It should be noted that if the Service Instance of state acquisition request instruction is that the unregistered service of service register center is real When example, then the Service Instance that gateway generation request failure message is indicated with instruction state acquisition request is not registered, and will Request failure information is back to monitoring center.

104, gateway inquires the service state of the Service Instance of instruction according to registration, and service state is looked into It askes result and is sent to monitoring center.

Specifically, the process may include:

The network address of the Service Instance of instruction is obtained from registration by the serviced broadcast plug-in unit in query processor, What the Service Instance that state acquisition request is broadcasted on the Service Instance indicated to the state acquisition request, and receives instruction returned Service state query result;

Processing is packaged to service state query result by the results processor in gateway, and is sent in monitoring The heart.

Wherein, service state includes CPU usage, memory usage, disk read-write, network connection state, heapSize Information and heapUsedSize information it is one or more.

105, monitoring center receives service state query result and carries out respective handling.

Specifically, monitoring center carries out respective handling to service state query result, may include:

Service state query result is stored;And/or

Service state query result is subjected to page presentation;And/or

According to service state query result, alarming processing is carried out to the Service Instance of service state exception.

Specifically, analyzing service state query result, it is abnormal to judge that the service state of Service Instance exists, works as clothes The service state of pragmatic example is deposited when abnormal, can guarantee to inform user in time by carrying out alarming processing, so as to convenient User is in time handled Service Instance.

In the embodiment of the present invention, monitoring center can obtain service by " the serviced broadcast function " in gateway in real time The service state of the registered specified services example of registration center or whole Service Instances, to realize that acquisition service in real time is real The purpose of the latest services state of example is compared with traditional approach using timing mechanism upload service state, can be very big Ground promotes monitoring timeliness.

Fig. 2 is a kind of block diagram of micro services monitoring system provided by Embodiment 2 of the present invention, which includes service registration Center 21, monitoring center 22 and gateway 23, in which:

Service register center 21 is registered for the Service Instance to micro services;

Monitoring center 22, for sending the state acquisition request of destination service example to gateway;

Gateway 23 includes:

Front processor 231 is used for reception state acquisition request;

Query processor 232, for obtaining the registration for the Service Instance that state acquisition request indicates from service register center Record, and according to registration, inquire the service state of the Service Instance of instruction;

Results processor 233, for the service state query result of destination service example to be sent to monitoring center 22;

Monitoring center 22 is also used to receive service state query result and carries out respective handling.

Further, service register center 21 is also used to:

It is communicated with Service Instance using heartbeat mechanism holding, if communication interruption time is more than preset time, the service of nullifying Example.

Further, query processor 232 includes:

Service processor, the network address of the Service Instance for obtaining instruction from registration;

Serviced broadcast plug-in unit, for sending the inquiry request of service state to the Service Instance of instruction according to network address, And the service state query result that the Service Instance for receiving instruction returns.

Further, service state include CPU usage, memory usage, disk read-write, network connection state, HeapSize information and heapUsedSize information it is one or more.

Further, monitoring center 22 is specifically used for:

Service state query result is stored;

Service state query result is subjected to page presentation;

According to service state query result, alarming processing is carried out to the Service Instance of service state exception.

It should be understood that in micro services monitoring system provided by the above embodiment, only with stroke of above-mentioned each functional module Divide and be illustrated, in practical application, can according to need and be completed by different functional modules above-mentioned function distribution, i.e., The internal structure of system is divided into different functional modules, to complete all or part of the functions described above.On in addition, It states micro services monitoring system and micro services monitoring method embodiment belongs to same design, implement process and beneficial effect is detailed See micro services monitoring method embodiment, which is not described herein again.

Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, associated hardware can also be instructed to complete by program, the program can store can in a kind of computer It reads in storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..

The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of micro services monitoring method, which is characterized in that the described method includes:
Service register center registers the Service Instance of micro services;
Monitoring center sends state acquisition request to gateway;
The gateway receives the state acquisition request, and obtains the state acquisition request from the service register center The registration of the Service Instance of instruction;
The gateway inquires the service state of the Service Instance of the instruction according to the registration, and will service shape State query result is sent to the monitoring center;
The monitoring center receives the service state query result and carries out respective handling.
2. the method according to claim 1, wherein the service register center to the Service Instances of micro services into After row registration step, the method also includes:
The service register center is communicated with the Service Instance using heartbeat mechanism holding, if communication interruption time is more than default Time, then the service register center nullifies the Service Instance.
3. the method according to claim 1, wherein the gateway inquires institute according to the registration The service state for stating the Service Instance of instruction includes:
The network address of the Service Instance of the instruction is obtained from the registration;
According to the network address, the inquiry request of service state is sent to the Service Instance of the instruction, and receives the finger The service state query result that the Service Instance shown returns.
4. the method according to claim 1, wherein the service state includes CPU usage, memory use Rate, disk read-write, network connection state, heapSize information and heapUsedSize information it is one or more.
5. method according to any one of claims 1 to 4, which is characterized in that the respective handling includes:
The service state query result is stored;And/or
The service state query result is subjected to page presentation;And/or
According to the service state query result, alarming processing is carried out to the Service Instance of service state exception.
6. a kind of micro services monitoring system, which is characterized in that the system comprises service register center, monitoring center and service networks It closes, in which:
The service register center is registered for the Service Instance to micro services;
The monitoring center, for sending state acquisition request to the gateway;
The gateway includes:
Front processor, for receiving the state acquisition request;
Query processor, for obtaining the registration for the Service Instance that the state acquisition request indicates from the service register center Record, and according to the registration, inquire the service state of the Service Instance of the instruction;
Results processor, for service state query result to be sent to the monitoring center;
The monitoring center is also used to receive the service state query result and carries out respective handling.
7. system according to claim 6, which is characterized in that the service register center is also used to:
With the Service Instance using heartbeat mechanism holding communicate, if communication interruption time be more than preset time, cancellation described in Service Instance.
8. system according to claim 6, which is characterized in that the query processor includes:
Service processor, the network address of the Service Instance for obtaining the instruction from the registration;
Serviced broadcast plug-in unit, for sending the inquiry of service state to the Service Instance of the instruction according to the network address Request, and the service state query result that the Service Instance for receiving the instruction returns.
9. system according to claim 6, which is characterized in that the service state includes CPU usage, memory use Rate, disk read-write, network connection state, heapSize information and heapUsedSize information it is one or more.
10. according to the described in any item systems of claim 6 to 9, which is characterized in that the monitoring center is specifically used for:
The service state query result is stored;
The service state query result is subjected to page presentation;
According to the service state query result, alarming processing is carried out to the Service Instance of service state exception.
CN201910048020.9A 2019-01-18 2019-01-18 A kind of micro services monitoring method and system CN109873736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910048020.9A CN109873736A (en) 2019-01-18 2019-01-18 A kind of micro services monitoring method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910048020.9A CN109873736A (en) 2019-01-18 2019-01-18 A kind of micro services monitoring method and system
PCT/CN2019/106781 WO2020147331A1 (en) 2019-01-18 2019-09-19 Micro-service monitoring method and system

Publications (1)

Publication Number Publication Date
CN109873736A true CN109873736A (en) 2019-06-11

Family

ID=66917690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910048020.9A CN109873736A (en) 2019-01-18 2019-01-18 A kind of micro services monitoring method and system

Country Status (2)

Country Link
CN (1) CN109873736A (en)
WO (1) WO2020147331A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020147331A1 (en) * 2019-01-18 2020-07-23 苏宁云计算有限公司 Micro-service monitoring method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610836A (en) * 2016-12-23 2017-05-03 国网信息通信产业集团有限公司 Micro-service operation management tool
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN108512689A (en) * 2017-12-15 2018-09-07 中国平安财产保险股份有限公司 Micro services business monitoring method and server
CN108845910A (en) * 2018-05-31 2018-11-20 康键信息技术(深圳)有限公司 Monitoring method, device and the storage medium of extensive micro services system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
US10411973B2 (en) * 2017-03-20 2019-09-10 Red Hat, Inc. Automatic microservice problem detection in enterprise applications
CN107566153B (en) * 2017-07-21 2020-09-25 哈尔滨工程大学 Self-management micro-service implementation method
CN109873736A (en) * 2019-01-18 2019-06-11 苏宁易购集团股份有限公司 A kind of micro services monitoring method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610836A (en) * 2016-12-23 2017-05-03 国网信息通信产业集团有限公司 Micro-service operation management tool
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN108512689A (en) * 2017-12-15 2018-09-07 中国平安财产保险股份有限公司 Micro services business monitoring method and server
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN108845910A (en) * 2018-05-31 2018-11-20 康键信息技术(深圳)有限公司 Monitoring method, device and the storage medium of extensive micro services system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020147331A1 (en) * 2019-01-18 2020-07-23 苏宁云计算有限公司 Micro-service monitoring method and system

Also Published As

Publication number Publication date
WO2020147331A1 (en) 2020-07-23

Similar Documents

Publication Publication Date Title
US10516577B2 (en) Graceful scaling in software driven networks
US9705800B2 (en) Load distribution in data networks
JP6332774B2 (en) Network function virtualized NFV failure management apparatus, device, and method
US9838483B2 (en) Methods, systems, and computer readable media for a network function virtualization information concentrator
EP3226132B1 (en) Method and apparatus for deploying virtual machine instances in a nfv architecture
US8434087B2 (en) Distributed acceleration devices management for streams processing
US9251040B2 (en) Remote debugging in a cloud computing environment
US7558859B2 (en) Peer-to-peer auction based data distribution
US10069707B2 (en) System and method for seamless horizontal scaling using logical scalable units
US8584136B2 (en) Context-aware request dispatching in clustered environments
DE69728601T2 (en) Client-server architecture with concurrent servers
US8788565B2 (en) Dynamic and distributed queueing and processing system
US20160191631A1 (en) System and Method for Using VoLTE Session Continuity Information using Logical Scalable Units
US10063443B2 (en) System and method for managing VoLTE session continuity information using logical scalable units
CN103118076B (en) Upgraded server cluster system and load balancing method thereof
CN105338086B (en) A kind of distributed message forwarding method
US20140379712A1 (en) Data stream management systems
US20080183991A1 (en) System and Method for Protecting Against Failure Through Geo-Redundancy in a SIP Server
KR101533864B1 (en) A Method and Apparatus of selecting network connection in M2M communication
CN105721535A (en) Parallel processing of service functions in service function chains
EP1404138A1 (en) Equipment and method for managing the status information of a terminal for the data transmission in a telephone circuit
CN101730086B (en) High speed downloading method of mobile terminal connecting multiple gateways and starting multiple threads
US20140137080A1 (en) System and method of optimization for mobile apps
CN105141452A (en) High-performance service system and method based on CXF
CN102880475B (en) Based on the real-time event disposal system of cloud computing and method in computer software

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