CN109710424A - A kind of implementation method of distributed application services - Google Patents
A kind of implementation method of distributed application services Download PDFInfo
- Publication number
- CN109710424A CN109710424A CN201811551523.XA CN201811551523A CN109710424A CN 109710424 A CN109710424 A CN 109710424A CN 201811551523 A CN201811551523 A CN 201811551523A CN 109710424 A CN109710424 A CN 109710424A
- Authority
- CN
- China
- Prior art keywords
- service
- isp
- consumer
- addressable
- service consumer
- 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 21
- 230000006870 function Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 241001269238 Data Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The present invention relates to a kind of implementation methods of distributed application services.Service consumer initiates service subscription request, and the metadata information for obtaining all ISPs of service subscription is stored in local storage unit;The interface called as needed, service consumer generate an agent object;Service consumer searches all matched ISPs according to the interface name for the service to be accessed and version number in local storage unit, and filters out all addressable ISPs of the service consumer;Addressable ISP is judged whether there is, if it is present returning to the metadata information of an ISP in addressable ISP, remote service call request is initiated to ISP by the agent object.The present invention locally passes through load-balancing algorithm in service consumer and calculates some the specific ISP called every time, had both improved the performance of service call, and had also avoided Single Point of Faliure occur.
Description
Technical field
The present invention relates to distributed application technique field, specifically a kind of implementation method of distributed application services.
Background technique
With popularizing for all trades and professions informatization, in rapid technological improvements such as micro services, big data, artificial intelligence
Under background, in face of large complicated business scenario, traditional software architecture fault-tolerant ability is poor and is difficult to carry high concurrent situation
Under access pressure, hardware server operating pressure is also increasing.Therefore the O&M of monomer software architecture and single server
Mode has been not suitable with following technology trends, needs transformation and evolution in terms of distributed, serviceization.
In the framework of some traditional distributed application services, load balancing can be disposed on an independent server
Each call of device application, application service all can go bearing on balance server by the load balancer on access server
It carries.When the access number for occurring servicing in same amount of time is larger, the server for disposing load balancer is easy to appear
Situations such as delay machine, causes entire Distributed Application unavailable.
Under micro services application system, a demand that multiple applications are disposed in a physical machine is had, and previous distribution
Formula, which is applied, goes unique identification one service, the in addition use of some port numbers and environmental variance with the interface name of IP address and service
Limitation, a port can only be occupied by an application, and after a port is occupied by an application, another application is to make
When with this port, port of dishing out in the application occupies abnormal.Cause previous distributed application services be unable to satisfy it is such in incognito
Business deployment requirements.
Summary of the invention
Aiming at the defects existing in the prior art, the technical problem to be solved in the present invention is to provide a kind of distributions
The implementation method of formula application service.
Present invention technical solution used for the above purpose is: a kind of implementation method of distributed application services,
The following steps are included:
Service consumer initiates service subscription request, obtains the metadata information of all ISPs of service subscription,
And it is stored in the local storage unit of service consumer;
The interface called as needed, service consumer generate an agent object before calling remote service;
Service consumer searches all according to the interface name for the service to be accessed and version number in local storage unit
The ISP matched, and according to the routing rule of service, filter out all addressable ISPs of the service consumer;
Addressable ISP is judged whether there is, if it is present according to load-balancing algorithm addressable
The metadata information that an ISP is returned in ISP passes through the agency according to the metadata information of return
Object initiates remote service call request to ISP;Otherwise, the warning message without addressable ISP is issued,
And terminate this remote service calling.
After initiating remote service invocation step to ISP, further includes:
Whether overtime judge to call;
If it is, issuing remote service calls the prompt information of time-out, and terminate this remote service calling;
Otherwise, call result is returned, and terminates this remote service calling.
The routing rule according to service filters out all addressable ISPs of the service consumer, specifically
Are as follows:
In routing rule, client passes through the application name of service consumer, IP address and the IP address of ISP
And port numbers, limitation service consumer can initiate the ISP of remote service calling;If the service consumer is certain
The limitation object of a ISP, then filter out the ISP;If the service consumer is that some service provides
Person's does not limit object, then the ISP is the addressable ISP of the service consumer.
The present invention has the following advantages and beneficial effects:
1, this invention takes the modes of client load equilibrium, and the equal plan of different loads can be chosen by being each served by
Slightly, some the specific ISP called every time is calculated by load-balancing algorithm using local in service consumer,
Both the performance for having improved service call also avoids Single Point of Faliure occur.
2, the present invention increases by the permission isolation of linux system account and the occupancy detection of port numbers and certainly, and leads to
It crosses IP address, service port number and Service name three to go to uniquely determine a service, realizing can be a system account lower part
Affix one's name to an application.Using multiple linux system accounts, it can be achieved that disposing multiple Distributed Applications in a physical machine.
Detailed description of the invention
Fig. 1 is Distributed Application general frame figure of the invention;
Fig. 2 is configuration center architecture diagram of the invention;
Fig. 3 is flow chart of the method for the present invention.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and embodiments.
The framework of DAS (Distributed Application Service, distributed application services) can be divided into three portions
Point: registration configuration center (hearken-das-registry), service consumer (hearken-das-consumer), service mentions
Donor (hearken-das-provider).Relationship between three is as shown in Figure 1.
" ISP " can scan the related note in class when starting, obtain the metadata of the service of itself offer, will
Service registration is to " registration configuration center ".When " service consumer " starting, it can also scan relevant note and extract relevant clothes
Business subscription information initiates service subscription request to " registration configuration center ", and " registration configuration center " will be needed for the service consumer
Service metadata push go back, " service consumer " takes the metadata of these services, so that it may need to call long-range clothes
When business, the far call of service is directly initiated to " ISP "." registration configuration center " is having " ISP "
When initiating service registration request, it can detect whether that " service consumer " has had subscribed certain services therein, if
There are such service, the information of the ISP can be also pushed to by " registration configuration center " has subscribed disappearing for the service
Fei Zhe.When consumer needs to call service, if " ISP " of the service called can be supplied to consumer there are multiple
The policing algorithm of three kinds of load balancing goes to call these services, forms client load balanced mode.These three algorithm policy packets
It includes: random choice method, polling method, the randomized based on weight.Service selects one of them according to these three strategies when calling
ISP calls directly.
Randomized: one is randomly choosed from the supplier for the service list of being called.
Polling method: it is successively called according to the supplier's list for the service of being called.
Randomized based on weight: weight is set for each service corresponding " supplier ", to be called according to weight
One is selected in supplier's list of service, when the weighted value of all " ISPs " all when then randomly choose one.
The more big probability arrived at random of weighted value is bigger, and (weighted value is integer of 1 to 10,5) default-weight is all.
In order to guarantee that the high availability of " registration configuration center ", overall architecture are a cluster.Architecture diagram such as Fig. 2 institute
Show.Master indicates a host node in this cluster, is responsible for for the registration information of service being synchronized to other each slave sections
Point on.Slave indicates the slave node of this cluster, and registration can be provided for " ISP " and " service consumer " and is ordered
The function of readding, when have new information on services can notify in time master node carry out synchronizing information.Application is indicated
" ISP " or " service consumer " application.When part slave node is unavailable, the function of configuration center is not interfered with
Energy.If master node is unavailable, one can be elected from other slave nodes and is used as master node.Each
Slave node can be individually for " ISP " and " service consumer " and provide the function of registration service and subscription service.
When some node in this cluster is unavailable, " service consumer " and " ISP " below the node connects automatically
It is connected to other available nodes up, guarantees the normal operation of program.
When service consumer needs to call some remote service, the agency of the service interface can be returned first, adjusted
When the used time service interface method, agency will record the method and parameter of the interface of this calling, and pass through after being serialized
One long connection communication passes it to some " supplier " of the service.If it is by the way of synchronization call, at this time
Thread enters blocked state.After " ISP " receives call request, then the method and parameter of interface that will need to call
After carrying out unserializing, using the reflection mechanism of Java, the calling of specific method is locally completed, and return after result is serialized
It is back to " service consumer ", " consumer " obtains result again for its unserializing, takes specific far call as a result, disappearing at this time
The person of expense wakes up the thread of obstruction, completes a PRC process.Concrete implementation process is as shown in Figure 3.Wherein, metadata is for retouching
The data for stating data, to the descriptive information of data and information resources.The IP address of " ISP ", port are indicated herein
Number, interface name, the information such as version number.
In order to facilitate the cluster management of Distributed Application, application performance monitoring center can also be arranged in the present invention, in real time
The operating status of each server in monitoring cluster, including cpu busy percentage, the occupancy of memory and network traffic conditions etc.,
Guarantee that every server is run with good state, server is avoided to fall into overburden and idle state.In Distributed Application ring
Under border, each application is that " ISP " is also " service consumer ", a service call often occurs and has relied on other very
Multiple services.Therefore we have monitored the calling link of each service, provide the calling duration serviced each time, when average response
It is long, the related datas such as interface name and used agreement of average minute clock call number and each service call.When out
When an existing service call overlong time influences normal use, it is which that maintenance personnel can find out in time according to the data that appeal is called
Duration bottleneck is called caused by one or more service nodes.
Claims (3)
1. a kind of implementation method of distributed application services, which comprises the following steps:
Service consumer initiates service subscription request, obtains the metadata information of all ISPs of service subscription, and deposit
Enter in the local storage unit of service consumer;
The interface called as needed, service consumer generate an agent object before calling remote service;
Service consumer is searched all matched according to the interface name for the service to be accessed and version number in local storage unit
ISP, and according to the routing rule of service, filter out all addressable ISPs of the service consumer;
Addressable ISP is judged whether there is, if it is present according to load-balancing algorithm in addressable service
The metadata information that an ISP is returned in supplier passes through the agent object according to the metadata information of return
Remote service call request is initiated to ISP;Otherwise, the warning message without addressable ISP is issued, and is tied
Shu Benci remote service is called.
2. a kind of implementation method of distributed application services according to claim 1, which is characterized in that provided to service
After person initiates remote service invocation step, further includes:
Whether overtime judge to call;
If it is, issuing remote service calls the prompt information of time-out, and terminate this remote service calling;
Otherwise, call result is returned, and terminates this remote service calling.
3. a kind of implementation method of distributed application services according to claim 1, which is characterized in that described according to service
Routing rule, filter out all addressable ISPs of the service consumer, specifically:
In routing rule, client passes through the application name of service consumer, IP address and the IP address of ISP and end
Slogan, limitation service consumer can initiate the ISP of remote service calling;If the service consumer is some clothes
The limitation object of business supplier, then filter out the ISP;If the service consumer is some ISP
Object is not limited, then the ISP is the addressable ISP of the service consumer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811551523.XA CN109710424A (en) | 2018-12-18 | 2018-12-18 | A kind of implementation method of distributed application services |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811551523.XA CN109710424A (en) | 2018-12-18 | 2018-12-18 | A kind of implementation method of distributed application services |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109710424A true CN109710424A (en) | 2019-05-03 |
Family
ID=66255887
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811551523.XA Pending CN109710424A (en) | 2018-12-18 | 2018-12-18 | A kind of implementation method of distributed application services |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710424A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112367376A (en) * | 2020-10-28 | 2021-02-12 | 常州微亿智造科技有限公司 | Method for realizing mutual communication framework between micro services under industrial Internet of things |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103986748A (en) * | 2014-04-22 | 2014-08-13 | 世纪禾光科技发展(北京)有限公司 | Method and device for achieving servitization |
CN107205020A (en) * | 2017-05-05 | 2017-09-26 | 国网福建省电力有限公司 | Service load balancing method and system under Service-Oriented Architecture Based |
WO2017185961A1 (en) * | 2016-04-26 | 2017-11-02 | 中兴通讯股份有限公司 | Method and apparatus for processing service discovery |
CN107888551A (en) * | 2016-09-30 | 2018-04-06 | 北京神州泰岳软件股份有限公司 | A kind of remote service calling method, device and system |
-
2018
- 2018-12-18 CN CN201811551523.XA patent/CN109710424A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103986748A (en) * | 2014-04-22 | 2014-08-13 | 世纪禾光科技发展(北京)有限公司 | Method and device for achieving servitization |
WO2017185961A1 (en) * | 2016-04-26 | 2017-11-02 | 中兴通讯股份有限公司 | Method and apparatus for processing service discovery |
CN107888551A (en) * | 2016-09-30 | 2018-04-06 | 北京神州泰岳软件股份有限公司 | A kind of remote service calling method, device and system |
CN107205020A (en) * | 2017-05-05 | 2017-09-26 | 国网福建省电力有限公司 | Service load balancing method and system under Service-Oriented Architecture Based |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112367376A (en) * | 2020-10-28 | 2021-02-12 | 常州微亿智造科技有限公司 | Method for realizing mutual communication framework between micro services under industrial Internet of things |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3832578A1 (en) | Electronic invoice identifier allocation method, and electronic ticket generating method, device and system | |
TWI755417B (en) | Computing task allocation method, execution method of stream computing task, control server, stream computing center server cluster, stream computing system and remote multi-active system | |
CN111338773B (en) | Distributed timing task scheduling method, scheduling system and server cluster | |
CN103581276B (en) | Cluster management device, system, service customer end and correlation method | |
US10013271B2 (en) | Management system and method for controlling management system | |
CN111901422B (en) | Method, system and device for managing nodes in cluster | |
CN103067293A (en) | Method and system for multiplex and connection management of a load balancer | |
CN105991694B (en) | A kind of method and apparatus realizing Distributed Services and calling | |
CN110928662B (en) | Distributed timing task scheduler facing micro-service architecture | |
CN110554927A (en) | Micro-service calling method based on block chain | |
CN105208047A (en) | Online and off line methods of distributed system server, and server | |
CN109783151B (en) | Method and device for rule change | |
CN115001956B (en) | Method, device, equipment and storage medium for running server cluster | |
CN112631680B (en) | Micro-service container scheduling system, method, device and computer equipment | |
CN106681861A (en) | New environment isolation configuration data management method and system | |
CN111427670A (en) | Task scheduling method and system | |
CN109697078B (en) | Repairing method of non-high-availability component, big data cluster and container service platform | |
CN114301972A (en) | Block chain link point hierarchical deployment method and system based on cloud edge cooperation | |
US20240250918A1 (en) | Node for running container group, and container group management system and method | |
CN106789308A (en) | The GIS service device and its control method of a kind of micro services framework automatically retractable | |
CN109710424A (en) | A kind of implementation method of distributed application services | |
CN114338684A (en) | Energy management system and method | |
CN113867915A (en) | Task scheduling method, electronic device and storage medium | |
CN111274022A (en) | Server resource allocation method and system | |
CN112911008A (en) | Cloud computing container online and offline method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190503 |