CN109271291A - A kind of service monitoring and the method for management - Google Patents
A kind of service monitoring and the method for management Download PDFInfo
- Publication number
- CN109271291A CN109271291A CN201811024079.6A CN201811024079A CN109271291A CN 109271291 A CN109271291 A CN 109271291A CN 201811024079 A CN201811024079 A CN 201811024079A CN 109271291 A CN109271291 A CN 109271291A
- Authority
- CN
- China
- Prior art keywords
- service
- services
- information
- micro services
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000012544 monitoring process Methods 0.000 title claims abstract description 7
- 238000007792 addition Methods 0.000 claims description 2
- 238000012217 deletion Methods 0.000 claims description 2
- 230000037430 deletion Effects 0.000 claims description 2
- 230000001360 synchronised effect Effects 0.000 claims description 2
- 238000007726 management method Methods 0.000 description 12
- 230000000694 effects Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 239000006185 dispersion Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/604—Tools and structures for managing or administering access control systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
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)
- Automation & Control Theory (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention provides a kind of method of service monitoring and management, belong to computer software micro services infrastructure services administrative skill field, the present invention is under micro services framework, the operating status return information of each service is obtained by automatically scanning, convenient for service management, personnel in time safeguard exception service, while can also carry out starting or stoping operation to each micro services by script.Permission classification is carried out for all visible micro services, different rights operator manages different classes of service.
Description
Technical field
The present invention relates to computer software micro services infrastructure services administrative skill more particularly to a kind of service monitoring and management
Method.
Background technique
In Current software framework technology, micro services frame is increasingly popular.So-called micro services frame, being will be one
Large-scale single application program and service, is split according to function, business or specific demand, is split as several or even number
Ten support micro services.Application is created around business scope component, these applications can be developed independently, managed and be changed
Generation.Using cloud framework and platform-type deployment, management and service function in the component of dispersion, product delivery is made to become simpler
It is single.
But in existing micro services framework, the relevant interface of service management, function or service are not provided, need to develop
Person realizes oneself according to demand.Therefore, the function of developing a set of management backstage micro services is imperative.
Summary of the invention
In order to solve the above technical problems, can be supervised in real time the invention proposes a kind of service monitoring and the method for management
Under micrometer service architecture, the operating condition of each service, and as needed, control starting and stopping for service.The function needs
With micro services function opposite independent, supervisory function bit is played for micro services.Therefore the function needs to be detached from the realization of micro services frame.
The technical scheme is that
A kind of service monitoring and the method for management obtain the operation of each service by automatically scanning under micro services framework
State return information carries out each micro services by script to start or stop operation;And it is weighed for all visible micro services
Limit classification, Differentiated Services administration authority:
A, by functional configuration, information on services is preset in advance;
B, registered information on services is obtained by access micro services registration center interface;
C, it is matched by registration information, display service active state;
D, micro services are remotely controlled by shell script and individually services start and stop;
E, service management permission is controlled by user role.
In A, can additions and deletions change and look into safeguard service information, batch safeguards data.
In B, one key of service obtains all micro services information, is synchronized in database;
Routine call micro services registration center REST interface obtains server info.
In C, registration center's feedback information, matching service liveness are parsed, and feed back to user;By timed task,
Real-time update service state.
In D, for different services, shell script is configured;Call shell script, control service starting or stopping.
In E, association user role's table, control different role manages different services.
The present invention obtains the operating status return information of each service by automatically scanning, right in time convenient for service management personnel
Exception service is safeguarded, while can also carry out starting or stoping operation to each micro services by script.For all visible
Micro services have carried out permission classification, and different rights operator manages different classes of service.
Detailed description of the invention
Fig. 1 is service state and information acquisition logic figure;
Fig. 2 is functions implementing the present invention figure.
Specific embodiment
More detailed elaboration is carried out to the contents of the present invention below:
1, interface prototype
Default shows all information on services that active user can check in the interface.Including: service name, service are retouched
It states, service IP, serve port and service state.It inputs service name or service IP clicks inquiry (supporting fuzzy, paging), simultaneously
Service state can be selected and carry out condition query (supporting paging).
" stopping service " button is clicked, prompting frame is popped up.It clicks and determines, execute and stop service operations, while service state
Become " in stopping ".After automatically scanning discovery service has stopped, state is changed to " stop ".Button becomes " starting clothes
Business ".
Starting service button is clicked, prompting frame is popped up.It clicks and determines, execute starting service operations, while service state becomes
For in starting.After automatically scanning discovery service has stopped, state is changed to " start ".Button becomes " stopping service ".
It clicks newly-increased button and pops up content, Service name, service IP, serve port are all required items, and service type is essential
?.Errorless rear click is inputted to determine.The function is that information on services is preset in advance.
2, realization principle
2.1 data structure
Service management table is used for storing service information, compares service state, and structure is as follows:
Service role corresponds to table:
Role Information table:
2.2 logics are summarized
Service state and information acquisition logic: service management application access gateway obtains after gateway requests registration center
Registration service list returns to WEB application, as shown in Figure 1.
Selection needs " starting " or the service of " shutting down " in service list, after executing " starting " or " shutting down " movement,
Far call shell script, corresponding service is started or stoped.After initiating order, then next time before automatically scanning poll,
Service state can be maintained at " in starting " or " in stopping ", after execution movement, inquires registration center again, and return to registration service
Information, as shown in the figure.
The processing of 2.3 key logics
2.3.1 service-seeking
2.3.1.1 the service-seeking page and backstage class.path
Service management application:
JSP:
/jsp/serviceStatement/serviceStatement.jsp
Controller:
src/java/com/genersoft/serviceStatement/controller/
ServiceStatementCont roller.java
service:
Interface:
src/java/com/genersoft/serviceStatement/service/
IServiceStatementServic
e.java
Realize class:
src/java/com/genersoft/serviceStatement/service/impl/
erviceStatementSer
viceImpl.java
mapper:
src/java/com/genersoft/serviceStatement/mapper/
ServiceStatementMapper.x
ml
src/java/com/genersoft/serviceStatement/mapper/
ServiceStatementMapper.java micro services frame:
Integrain-sm-gateway:
/src/main/java/org/integrain/sm/gateway/serviceStatement/
controller/ServiceStatementController.java
2.3.1.2 query logic is realized
2.3.1.2.1 query configuration service
After JSP page initialization or triggering query actions, call in ServiceStatementController class
QueryStatement method, this method@RequestMapping are "/queryStatement ".
QueryStatement calls the queryStatement method in IServiceStatementService.
QueryStatement method in IServiceStatementService passes through calling
QueryStatement method in ServiceStatementMapper inquires PUB_SERVICE_STATEMENT table, distinguishes
Default query or with parameter query, default query not Transfer Parameters.
The query result of return, which is kept in, to be instantiated into ServiceStatementServiceImpl class
In serviceBean.
2.3.1.2.2 the registered service of registration center is inquired
Having executed (1), ServiceStatementController by HttpClient calls integrain- afterwards
The findEurekaApps method of ServiceStatementController class, this method pass through in sm-gateway engineering
The Rest interface "/eureka/apps " of feign far call registration center.Obtain all services registered in registration center
Information.Interface returns to JSON formatted data.
Based on serviceBean data, in conjunction with the registered information on services of registration center, it can be seen that PUB_
The starting state of service is configured in SERVICE_STATEMENT table.After data processing, foreground showing interface is returned to.Page
" operation " button in face changes according to service state dynamic.
Special circumstances control: gateway failure is called, the service registration information of registration center can not be obtained.Therefore gateway is called
When failure, special marking gateway malloc failure malloc is needed to cause other service states unknowable.
2.3.1.2.3 automatic regular polling service state
Other than actively issuing inquiry request, in function carry automatic regular polling movement, transfer in real time registration center "/
Eureka/apps " interface obtains service status information, and core code is as follows:
self.setInterval(“queryServer(…)”,5000)
2.3.2 start and stop are serviced
Start and stop function is serviced, is realized by shell script.It is configured in PUB_SERVICE_STATEMENT table to be all
Service-creation shell script, script is placed under " bin/sh " in Linux server.Shell script reference configuration is such as
Lower stopping service:
#!/bin/bash
HOME='/usr/integrain'
Port=8766
cd$HOME
PID=`ps-ef | grep integrain-sm-gateway-1.0.0-0702.jar | grep-v grep | awk'
{print$2}'`
echo"K is:"$PID
Echo " dfhadfiadfis=" $ PID
kill$PID
Illustrate:
Wherein, HOME represents the path of project jar packet, and cd $ HOME represents the file checked under current file folder.PID=`
Ps-ef | grep integrain-sm-gateway-1.0.0-0702.jar | grep-v grep | awk'{ print $ 2 } ' ` generation
Table obtains the process ID of current service according to jar packet title.Kill $ PID, which is represented, kills this process, service stopping.
Starting service:
Echo " starting service starts * * "
HOME='/usr/integrain'
JAR_HOME=integrain-sm-gateway-1.0.0-0702.jar
cd$HOME
nohup java-jar integrain-sm-gateway-1.0.0-0702.jar>out.log 2>&1&
sleep 1s
Echo " system start automatically in 5... "
sleep 1s
Echo " system start automatically in 4... "
sleep 1s
Echo " system start automatically in 3... "
sleep 1s
Echo " system start automatically in 2... "
sleep 1s
Echo " system start automatically in 1... "
Echo " start completion============================
============" "
Illustrate:
Wherein, HOME represents the path of project jar packet, and cd $ HOME represents the file checked under current file folder.nohup
It is entitled that 2>&1& of java-jar integrain-sm-gateway-1.0.0-0702.jar > out.log represents starting
The jar packet of integrain-sm-gateway-1.0.0-0702.jar, and be output in out.log through log.
2.3.2.1 script path configures
Newly-increased or Edit button is clicked, pop-up plays frame, configures to shell script path, each service corresponding one
A starting script path and a stopping script path, for starting and stopping for service.
Script path naming rule is as follows :/usr/bin/shell/xxxx.sh.Wherein ,/usr/bin/shell/ is represented
The path of placement shell script in Linux server, xxxx.sh represent the title of shell script.
2.3.2.2 script call flow
IP address, the username and password of Linux server are configured first.
Secondly, clicking starting service button or stopping service button, stepped on according to the IP address filled in, username and password
Record Linux server.If logining successfully, the script path that system can be configured according to you, to the shell in Linux server
Script is called, and executes the content in shell script.
Whether finally, being run succeeded according to shell script, the service start and stop page, which can be shown, is had been turned on, stopped or opens
Dynamic failure stops the states such as unsuccessfully.
Method " ShellExecutor " is defined in ServiceStatementController as shell script
Execution method.
According to the information on services on the page in list, in perform script, these information are passed into ShellExecutor
Method, the script of Dynamic Execution difference service.
Before perform script, service state is recorded.After perform script, the registered service letter in registration center is reacquired
Breath, if after service stopping, being still able to see information in registration center, then wait next time poll executes again inquiry move
Make, during which the page, which is in, waits effect, if do not changed yet, prompts " stopping serv-fail ", if stopped, prompting
" stopping services successfully " terminates to wait effect at this time.If checking registration information after starting service, not finding that service is activated,
Then prompt " service starting failure ".
Claims (6)
1. a kind of service monitoring and the method for management, which is characterized in that
Under micro services framework, the operating status return information of each service is obtained by automatically scanning, by script to respectively in incognito
Business carries out starting or stoping operation;And permission classification is carried out for all visible micro services, Differentiated Services administration authority:
A, by functional configuration, information on services is preset in advance;
B, registered information on services is obtained by access micro services registration center interface;
C, it is matched by registration information, display service active state;
D, micro services are remotely controlled by shell script and individually services start and stop;
E, service management permission is controlled by user role.
2. method according to claim 1, it is characterised in that:
In A, can additions and deletions change and look into safeguard service information, batch safeguards data.
3. method according to claim 1, it is characterised in that:
In B, one key of service obtains all micro services information, is synchronized in database;Routine call micro services registration center
REST interface obtains server info.
4. method according to claim 1, it is characterised in that:
In C, registration center's feedback information, matching service liveness are parsed, and feed back to user;By timed task, in real time
Update service state.
5. method according to claim 1, it is characterised in that:
In D, for different services, shell script is configured;Call shell script, control service starting or stopping.
6. method according to claim 1, it is characterised in that:
In E, association user role's table, control different role manages different services.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811024079.6A CN109271291A (en) | 2018-09-04 | 2018-09-04 | A kind of service monitoring and the method for management |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811024079.6A CN109271291A (en) | 2018-09-04 | 2018-09-04 | A kind of service monitoring and the method for management |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109271291A true CN109271291A (en) | 2019-01-25 |
Family
ID=65188086
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811024079.6A Pending CN109271291A (en) | 2018-09-04 | 2018-09-04 | A kind of service monitoring and the method for management |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109271291A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109981784A (en) * | 2019-04-01 | 2019-07-05 | 山东浪潮云信息技术有限公司 | A kind of cloud service monitoring system data access method |
CN110708201A (en) * | 2019-10-14 | 2020-01-17 | 中国人民解放军32039部队 | Operation and maintenance service management and control method and device |
CN111130955A (en) * | 2020-03-31 | 2020-05-08 | 四川新网银行股份有限公司 | Distributed link monitoring method based on internet credit system |
CN114138375A (en) * | 2021-12-30 | 2022-03-04 | 高新兴智联科技有限公司 | Internet of things service cloud architecture and radio frequency test system applying same |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
CN106302497A (en) * | 2016-08-25 | 2017-01-04 | 广州唯品会信息科技有限公司 | The authority control method of micro services and device |
CN106610836A (en) * | 2016-12-23 | 2017-05-03 | 国网信息通信产业集团有限公司 | Micro-service operation management tool |
CN107528853A (en) * | 2017-09-12 | 2017-12-29 | 上海艾融软件股份有限公司 | The implementation method of micro services control of authority |
CN107665114A (en) * | 2017-09-25 | 2018-02-06 | 南京农纷期电子商务有限公司 | A kind of method using Rundeck monitoring application service survivals |
CN107911433A (en) * | 2017-12-21 | 2018-04-13 | 上海数烨数据科技有限公司 | A kind of LAN cluster system access method based on WebShell |
CN107911430A (en) * | 2017-11-06 | 2018-04-13 | 上海电机学院 | A kind of micro services infrastructure equipment |
CN108279892A (en) * | 2018-02-27 | 2018-07-13 | 郑州云海信息技术有限公司 | It is a kind of to split the method, apparatus and equipment that large-scale application service is micro services |
CN108306917A (en) * | 2017-01-13 | 2018-07-20 | 中国移动通信集团江西有限公司 | The register method and device of data processing method and device, micro services module |
CN108446111A (en) * | 2018-03-26 | 2018-08-24 | 国家电网公司客户服务中心 | A kind of micro services construction method based on Spring cloud |
-
2018
- 2018-09-04 CN CN201811024079.6A patent/CN109271291A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
CN106302497A (en) * | 2016-08-25 | 2017-01-04 | 广州唯品会信息科技有限公司 | The authority control method of micro services and device |
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 |
CN107528853A (en) * | 2017-09-12 | 2017-12-29 | 上海艾融软件股份有限公司 | The implementation method of micro services control of authority |
CN107665114A (en) * | 2017-09-25 | 2018-02-06 | 南京农纷期电子商务有限公司 | A kind of method using Rundeck monitoring application service survivals |
CN107911430A (en) * | 2017-11-06 | 2018-04-13 | 上海电机学院 | A kind of micro services infrastructure equipment |
CN107911433A (en) * | 2017-12-21 | 2018-04-13 | 上海数烨数据科技有限公司 | A kind of LAN cluster system access method based on WebShell |
CN108279892A (en) * | 2018-02-27 | 2018-07-13 | 郑州云海信息技术有限公司 | It is a kind of to split the method, apparatus and equipment that large-scale application service is micro services |
CN108446111A (en) * | 2018-03-26 | 2018-08-24 | 国家电网公司客户服务中心 | A kind of micro services construction method based on Spring cloud |
Non-Patent Citations (3)
Title |
---|
佚名: "一个启动,停止,重启微服务的shell脚本例子", 《HTTPS://WWW.YIHAOMEN.COM/ARTICLE/LINUX/686.HTM》 * |
张晶等: "微服务框架的设计与实现", 《计算机系统应用》 * |
等你归去来: "写一个shell 快速启动停止你的微服务吧", 《HTTPS://WWW.CNBLOGS.COM/YOUGEWE/P/7077066.HTML》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109981784A (en) * | 2019-04-01 | 2019-07-05 | 山东浪潮云信息技术有限公司 | A kind of cloud service monitoring system data access method |
CN110708201A (en) * | 2019-10-14 | 2020-01-17 | 中国人民解放军32039部队 | Operation and maintenance service management and control method and device |
CN111130955A (en) * | 2020-03-31 | 2020-05-08 | 四川新网银行股份有限公司 | Distributed link monitoring method based on internet credit system |
CN111130955B (en) * | 2020-03-31 | 2020-08-21 | 四川新网银行股份有限公司 | Distributed link monitoring method based on internet credit system |
CN114138375A (en) * | 2021-12-30 | 2022-03-04 | 高新兴智联科技有限公司 | Internet of things service cloud architecture and radio frequency test system applying same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271291A (en) | A kind of service monitoring and the method for management | |
US11714665B2 (en) | Method and apparatus for composite user interface creation | |
US11171897B2 (en) | Method and apparatus for composite user interface generation | |
CN111274001B (en) | Micro-service management platform | |
US8606897B2 (en) | Systems and methods for exporting usage history data as input to a management platform of a target cloud-based network | |
US7152104B2 (en) | Method and apparatus for notifying administrators of selected events in a distributed computer system | |
US20180060066A1 (en) | Application Centric Continuous Integration and Delivery With Automated Service Assurance | |
JP5394123B2 (en) | Multiple device management method and system | |
EP0834809B1 (en) | Scaleable and extensible system management architecture with dataless endpoints | |
US20180276056A1 (en) | Event notification | |
US20050222969A1 (en) | Centralized configuration data management for distributed clients | |
CN109245988A (en) | Monitor mail automatic sending method, system, computer equipment and storage medium | |
US20080140760A1 (en) | Service-oriented architecture system and methods supporting dynamic service provider versioning | |
US20080140759A1 (en) | Dynamic service-oriented architecture system configuration and proxy object generation server architecture and methods | |
US7937716B2 (en) | Managing collections of appliances | |
CN104615489B (en) | A kind of implementation method of multinode data interaction | |
CN112799786A (en) | Exit method, device, equipment and storage medium of micro-service instance | |
CN103049268A (en) | Naplet based application development and management system | |
US11245744B1 (en) | Asynchronous distributed modular function calling | |
CN109117259A (en) | Method for scheduling task, platform, device and computer readable storage medium | |
CN114168179A (en) | Micro-service management method, device, computer equipment and storage medium | |
CN112667251A (en) | Service deployment method, device, computer equipment and storage medium | |
GB2456201A (en) | Notification of a background processing event in an enterprise resource planning system | |
US11582345B2 (en) | Context data management interface for contact center | |
Hao | Edge computing on low availability devices with K3S in a smart home IoT system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190125 |
|
RJ01 | Rejection of invention patent application after publication |