CN113821743A - Dubbo service tracing method and device - Google Patents
Dubbo service tracing method and device Download PDFInfo
- Publication number
- CN113821743A CN113821743A CN202111114144.6A CN202111114144A CN113821743A CN 113821743 A CN113821743 A CN 113821743A CN 202111114144 A CN202111114144 A CN 202111114144A CN 113821743 A CN113821743 A CN 113821743A
- Authority
- CN
- China
- Prior art keywords
- machine
- service
- dubbo
- tracing
- acquiring
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
- G06Q10/06311—Scheduling, planning or task assignment for a person or group
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/20—Administration of product repair or maintenance
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Theoretical Computer Science (AREA)
- Economics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Entrepreneurship & Innovation (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Tourism & Hospitality (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Operations Research (AREA)
- Development Economics (AREA)
- Game Theory and Decision Science (AREA)
- Educational Administration (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a method and a device for tracing a Dubbo service, wherein the method is applied to a server and comprises the following steps: acquiring a service address of a parameter Dubbo; then, obtaining a zookeeper connection through a server; inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from URL information registered by the zookeeper; reversely inquiring machine information in a machine resource management platform according to the machine IP; acquiring an engineering name through the system attribute of the machine, and inquiring in a system engineering library to acquire engineering information so as to realize the source tracing of the Dubbo service; the beneficial effects are as follows: information such as real engineering affiliation, engineering responsible persons and the like can be traced back by using the Dubbo service; therefore, the defect that the source tracing is difficult due to inconsistent names in the prior art is overcome.
Description
Technical Field
The invention relates to the technical field of service tracing, in particular to a method and a device for tracing a Dubbo service.
Background
The Dubbo is a distributed service framework, aims to provide a high-performance and transparent RPC remote service calling scheme and an SOA service governance scheme, and is widely applied.
At present, the configuration of Dubbo service is the project name of the user-defined service and the project information of a person in charge, so that the problem of source tracing difficulty caused by inconsistency between the project name and the name in a system project library easily exists; when a certain service has a problem, the corresponding engineering affiliation and the corresponding responsible person need to be found in time for processing; therefore, a solution for tracing the source of the Dubbo service is needed.
Disclosure of Invention
Aiming at the technical defects in the prior art, the embodiments of the present invention provide a method and an apparatus for tracing to the source of a Dubbo service, which acquire the attribution information of the service through the Dubbo service, and overcome the defect of difficult tracing due to inconsistent names.
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides a method for tracing to a source of a Dubbo service, which is applied to a server, and the method includes:
acquiring a service address of a parameter Dubbo;
then, obtaining a zookeeper connection through a server;
inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from URL information registered by the zookeeper;
reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service;
and acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information so as to realize the source tracing of the Dubbo service.
Preferably, the service address of the Dubbo includes a fully qualified name # method name of the class, a string type.
Preferably, the reverse query specifically includes the following steps:
preparing a dubbo service address for entering a reference;
configuring the same address as the zookeeper registered by the dubbo service;
obtaining a zookeeper connection;
reading the full qualified name/providers data of the zookeeper node/dubbo/class;
and analyzing the acquired node data into a URL, and acquiring a host in the URL, namely the IP of the service provider.
Preferably, the obtaining of the project name through the system attribute of the machine specifically includes the following steps:
inquiring machine data of a machine resource management platform through the IP of the access machine;
acquiring an environment variable project name of a machine;
and inquiring the engineering information in the system engineering library to acquire the information containing the engineering responsible person, thereby achieving the function of tracing the source.
In a second aspect, an embodiment of the present invention provides a source tracing apparatus for a Dubbo service, which is applied to a server and includes a connection unit, an inquiry unit, and a source tracing unit;
the connection unit is used for:
acquiring a service address of a parameter Dubbo;
then, obtaining a zookeeper connection through a server;
the query unit is configured to:
inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from the URL information registered by zk;
the tracing unit is used for:
reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service;
and acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information so as to realize the source tracing of the Dubbo service.
By implementing the embodiment of the invention, zookeeper connection is obtained through the service address participating in Dubbo, the machine IP of the service is obtained from URL information registered by zookeeper, and finally, the information such as real engineering attribution, engineering responsible person and the like can be traced back by utilizing Dubbo service through reverse query of the machine IP; therefore, the defect that the source tracing is difficult due to inconsistent names in the prior art is overcome.
Drawings
In order to more clearly illustrate the detailed description of the invention or the technical solutions in the prior art, the drawings that are needed in the detailed description of the invention or the prior art will be briefly described below.
Fig. 1 is a flowchart of a method for tracing to a source of a Dubbo service according to an embodiment of the present invention;
fig. 2 is a structural diagram of a source tracing apparatus of a Dubbo service provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For better understanding of the embodiments of the present invention, the following description is made for the related art:
dubbo is a high-performance, lightweight, open-source Java RPC framework that provides three core capabilities: interface-oriented remote method invocation, intelligent fault tolerance and load balancing, and automatic registration and discovery of services.
ZooKeeper is a distributed, open-source distributed application coordination service, is an open-source implementation of Chubby of Google, and is an important component of Hadoop and Hbase. It is a software that provides a consistent service for distributed applications, and the functions provided include: configuration maintenance, domain name service, distributed synchronization, group service, etc.
Referring to fig. 1, a method for tracing a source of a Dubbo service provided in an embodiment of the present invention is applied to a server, and the method includes:
s101, acquiring the service address of the parameter Dubbo.
Specifically, the parameter called by the server is a service address of the Dubbo, and the service address is a basic parameter; wherein, the service address of Dubbo includes the fully qualified name # method name and the character string type of the class;
and S102, obtaining the zookeeper connection through the server.
Specifically, zk connection can be acquired through the Dubbo service, which registers with the registry.
S103, inquiring whether the Dubbo service is registered, and if so, acquiring the machine IP of the service from the URL information registered by the zookeeper.
Specifically, the zookeeper can query which services are registered, and if the services are not registered, the services are not legal.
S104, reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service.
Specifically, the server registers a local IP into the zookeeper, and a real machine is inquired reversely through the machine IP;
the reverse query specifically comprises the following steps:
preparing a dubbo service address of a parameter;
configuring the same address as the zookeeper registered by the dubbo service;
obtaining a zookeeper connection;
reading the full qualified name/providers data of the zookeeper node/dubbo/class;
analyzing the acquired node data into a URL (uniform resource locator), and acquiring a host in the URL, namely a service provider IP (Internet protocol);
the executing bodies of the reverse queries are all servers.
Whole process does not rely on third party's subassembly, can realize the inside dubbo service of company and trace to the source, also has security and practicality concurrently.
And S105, acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information, thereby realizing the source tracing of the Dubbo service.
Specifically, in this embodiment, the machine data of the machine resource management platform is queried through the participating machine IP;
acquiring an environment variable project name of a machine;
and inquiring the engineering information in the system engineering library to acquire the information containing the engineering responsible person, thereby achieving the function of tracing the source.
As can be seen from the above description, in the method provided by the embodiment of the present invention, Zookeeper connection is obtained by entering the service address of the Dubbo, the machine IP of the service is obtained from the URL information registered by the Zookeeper, and finally, by reverse query of the machine IP, information such as real engineering affiliation and engineering responsible person can be traced back by using the Dubbo service; therefore, the defect that the source tracing is difficult due to inconsistent names in the prior art is overcome.
Based on the same inventive concept, the embodiment of the present invention further provides a source tracing apparatus for a Dubbo service, which is applied to a server, and is shown in fig. 2, and includes a connection unit, an inquiry unit, and a source tracing unit;
the connection unit is used for:
acquiring a service address of a parameter Dubbo; wherein, the service address of Dubbo includes the fully qualified name of the class, # method name, string type;
then, obtaining a zookeeper connection through a server;
the query unit is configured to:
inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from the URL information registered by zk;
the tracing unit is used for:
reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service;
and acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information so as to realize the source tracing of the Dubbo service.
Further, when the method is applied, the reverse query specifically includes the following steps:
preparing a dubbo service address for entering a reference;
configuring the same address as the zookeeper registered by the dubbo service;
obtaining a zookeeper connection;
reading the full qualified name/providers data of the zookeeper node/dubbo/class;
and analyzing the acquired node data into a URL, and acquiring a host in the URL, namely the IP of the service provider.
The method for acquiring the project name through the system attribute of the machine specifically comprises the following steps:
inquiring machine data of a machine resource management platform through the IP of the access machine;
acquiring an environment variable project name of a machine;
and inquiring the engineering information in the system engineering library to acquire the information containing the engineering responsible person, thereby achieving the function of tracing the source.
It should be noted that, for a more specific working process of the tracing apparatus, please refer to the foregoing method embodiment, which is not described herein again.
In the whole scheme, through the Dubbo service, the reverse query is utilized to obtain the related information of the project affiliation, the responsible person and the like of the service provider, so as to realize the tracing.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed units and methods may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, 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 mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (8)
1. A tracing method of Dubbo service is applied to a server, and the method comprises the following steps:
acquiring a service address of a parameter Dubbo;
then, obtaining a zookeeper connection through a server;
inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from URL information registered by the zookeeper;
reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service;
and acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information so as to realize the source tracing of the Dubbo service.
2. The method of claim 1, wherein the service address of the Dubbo comprises a fully qualified name # method name of a class, a string type.
3. The method for tracing the source of the Dubbo service as claimed in claim 2, wherein said reverse query specifically comprises the steps of:
preparing a dubbo service address for entering a reference;
configuring the same address as the zookeeper registered by the dubbo service;
obtaining a zookeeper connection;
reading the full qualified name/providers data of the zookeeper node/dubbo/class;
and analyzing the acquired node data into a URL, and acquiring a host in the URL, namely the IP of the service provider.
4. The method for tracing the source of the Dubbo service according to claim 3, wherein the step of obtaining the project name through the system attribute of the machine specifically comprises the steps of:
inquiring machine data of a machine resource management platform through the IP of the access machine;
acquiring an environment variable project name of a machine;
and inquiring the engineering information in the system engineering library to acquire the information containing the engineering responsible person, thereby achieving the function of tracing the source.
5. A source tracing device of Dubbo service is characterized in that the source tracing device is applied to a server and comprises a connection unit, an inquiry unit and a source tracing unit;
the connection unit is used for:
acquiring a service address of a parameter Dubbo;
then, obtaining a zookeeper connection through a server;
the query unit is configured to:
inquiring whether the Dubbo service is registered, if so, acquiring a machine IP of the service from the URL information registered by zk;
the tracing unit is used for:
reversely inquiring machine information in a machine resource management platform according to the machine IP; the machine resource management platform stores information of each server corresponding to the deployed Dubbo service;
and acquiring the project name through the system attribute of the machine, and inquiring in a system project library to acquire project information so as to realize the source tracing of the Dubbo service.
6. The apparatus as claimed in claim 5, wherein the service address of the Dubbo includes a fully qualified name # method name of a class, a string type.
7. The apparatus for tracing to a Dubbo service in claim 6, wherein the backward query specifically comprises the following steps:
preparing a dubbo service address for entering a reference;
configuring the same address as the zookeeper registered by the dubbo service;
obtaining a zookeeper connection;
reading the full qualified name/providers data of the zookeeper node/dubbo/class;
and analyzing the acquired node data into a URL, and acquiring a host in the URL, namely the IP of the service provider.
8. The apparatus for tracing to a Dubbo service as claimed in claim 7, wherein said obtaining the project name through the system attribute of the machine specifically comprises the following steps:
inquiring machine data of a machine resource management platform through the IP of the access machine;
acquiring an environment variable project name of a machine;
and inquiring the engineering information in the system engineering library to acquire the information containing the engineering responsible person, thereby achieving the function of tracing the source.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111114144.6A CN113821743B (en) | 2021-09-23 | 2021-09-23 | Dubbo service tracing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111114144.6A CN113821743B (en) | 2021-09-23 | 2021-09-23 | Dubbo service tracing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113821743A true CN113821743A (en) | 2021-12-21 |
CN113821743B CN113821743B (en) | 2023-08-04 |
Family
ID=78915221
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111114144.6A Active CN113821743B (en) | 2021-09-23 | 2021-09-23 | Dubbo service tracing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113821743B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019104975A1 (en) * | 2017-11-30 | 2019-06-06 | 平安科技(深圳)有限公司 | Dubbo framework–based remote invoking method, server, and storage medium |
CN110401614A (en) * | 2018-04-24 | 2019-11-01 | 中移(杭州)信息技术有限公司 | The source tracing method and device of malice domain name |
CN111786998A (en) * | 2020-06-30 | 2020-10-16 | 成都新潮传媒集团有限公司 | Authority management method and device based on micro-service calling and storage medium |
CN112350873A (en) * | 2020-11-25 | 2021-02-09 | 中国工商银行股份有限公司 | Application service information processing method, application service calling method, device and system |
-
2021
- 2021-09-23 CN CN202111114144.6A patent/CN113821743B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019104975A1 (en) * | 2017-11-30 | 2019-06-06 | 平安科技(深圳)有限公司 | Dubbo framework–based remote invoking method, server, and storage medium |
CN110401614A (en) * | 2018-04-24 | 2019-11-01 | 中移(杭州)信息技术有限公司 | The source tracing method and device of malice domain name |
CN111786998A (en) * | 2020-06-30 | 2020-10-16 | 成都新潮传媒集团有限公司 | Authority management method and device based on micro-service calling and storage medium |
CN112350873A (en) * | 2020-11-25 | 2021-02-09 | 中国工商银行股份有限公司 | Application service information processing method, application service calling method, device and system |
Non-Patent Citations (2)
Title |
---|
JIA-HAO BI,YI-FAN TONG,ZHE-WEI QIU,XING-FENG YANG,JOHN MINNA,ADI F.GAZDAR,KAI SONG: "ClickGene: an open cloud-based platform for big pan-canner data genome-wide association study,visualization and exploration" * |
李帅: "微服务架构的研究及其在线教育系统的实现" * |
Also Published As
Publication number | Publication date |
---|---|
CN113821743B (en) | 2023-08-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3701741B1 (en) | Network slice management | |
EP3522088A1 (en) | Securing blockchain access through a gateway | |
CN111290865A (en) | Service calling method and device, electronic equipment and storage medium | |
US8683545B2 (en) | Federating policies from multiple policy providers | |
US9294867B2 (en) | Provision of services over a common delivery platform such as a mobile telephony network | |
GB2422218A (en) | A system for providing services | |
CN105049252A (en) | Method and device for managing configuration information | |
US11928605B2 (en) | Techniques for cyber-attack event log fabrication | |
US20240171525A1 (en) | Systems and methods for intelligent application grouping | |
US11461288B2 (en) | Systems and methods for database management system (DBMS) discovery | |
US20060161616A1 (en) | Provision of services over a common delivery platform such as a mobile telephony network | |
CN104348848A (en) | Method, terminal equipment and server for managing pictures | |
US11303606B1 (en) | Hashing name resolution requests according to an identified routing policy | |
CN109117152B (en) | Service generation system and method | |
Dugyala et al. | Implementation of SCADA Through Cloud Based IoT Devices-Initial Design Steps | |
CN113254227B (en) | Method and system for remote method call across data centers | |
CN113821743B (en) | Dubbo service tracing method and device | |
CN103561113A (en) | Web Service interface generating method and device | |
EP1681832A1 (en) | Provision of services over a common delivery platform such as a mobile telephony network | |
CN115065720B (en) | Method and device for automatically adapting multiple external registries to service grid Istio | |
CN111045928A (en) | Interface data testing method, device, terminal and storage medium | |
CN110401709A (en) | Processing method, device and the storage medium of session in a kind of instant messaging application | |
US20060190539A1 (en) | Provision of services over a common delivery platform such as a mobile telephony network | |
CN106156048A (en) | Method and apparatus and communication system that short URL services are provided | |
CN105681084A (en) | Method and system for creating SNMP monitoring agent daemon |
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 |