当前位置:网站首页>Eureka service registration and discovery
Eureka service registration and discovery
2022-06-22 22:15:00 【Miaoshiansen likes fish】
One 、 The registry of microservices
The registry can be said to be in the microservice architecture “ Mail list ”, It records the mapping relationship between service and service address . In a distributed architecture , The service will register here , When a service needs to call other services , You will find the service address here , To call .
1.1 The main role of the registry
Service registry ( Hereinafter referred to as the registry ) Is a very important component of microservice architecture , It mainly plays the role of coordinator in the microservice architecture . The registry generally includes the following functions :
1、 Service discovery :
- Service registration / Anti registration : Save information about service providers and service callers
- Service subscription / Unsubscribe : The service caller subscribes to the service provider's information , It's better to have the function of real-time push
- Service routing ( Optional ): Have the ability to screen integrated service providers
2、 Service configuration :
- Configure subscription : Service providers and service callers subscribe to microservice related configurations
- Configure distribution : Actively push configuration to service providers and service callers
3、 Service health testing
- Check the health status of the service provider
1.2 Common registries
Zookeeper
Zookeeper Is a distributed services framework , yes Apache Hadoop A subproject of , It is mainly used to solve some data management problems often encountered in distributed applications , Such as : Unified naming service 、 State synchronization service 、 Cluster management 、 Management of distributed application configuration items . Simply speaking Zookeeper = file system + Monitoring notification mechanism .
Eureka
Eureka Is in Java Language , be based on RESTful API Developed service registration and discovery components ,SpringCloud Netflix Important components in .
Consul
Consul By HashiCorp be based on Go Service publishing and registration software supporting distributed and highly available services in multiple data centers developed by language , use Raft Algorithm guarantees service consistency , And support health examination
Nacos
Nacos It is a dynamic service discovery that is easier to build cloud native applications 、 Configuration management and service management platform . Simply speaking Nacos It's the registry + A combination of configuration centers , Provide an easy to use feature set , Help us to solve the problems of service registration and discovery that microservice development must involve , Service configuration , Service management, etc .Nacos still SpringCloud Alibaba One of the components , Responsible for service registration and discovery .
| Component name | Language | CAP | Consistency algorithm | Service health check | Exposed interface |
|---|---|---|---|---|---|
| Eureka | Java | AP | nothing | With support | HTTP |
| Consul | Go | CP | Raft | Support | HTTP/DNS |
| Zookeeper | Java | CP | Paxos | Support | client |
| Nacos | Java | AP | Raft | Support | HTTP |
Two 、Eureka Overview
2.1 Eureka Basic knowledge of
Eureka yes Netflix Developed service discovery framework ,SpringCloud Integrate it into your own subproject spring-cloud-netflix in , Realization SpringCloud Service discovery capabilities for .
The picture above briefly describes Eureka Basic architecture , from 3 The characters make up :
1、Eureka Server
- Provide service registration and discovery
2、Service Provider
- service provider
- Register your services with Eureka, So that service consumers can find
3、Service Consumer
- Service consumer
- from Eureka Get the list of registered services , To be able to consume Services
2.2 Eureka Interaction process and principle of

Figure is from Eureka Official architecture , It gives a general description Eureka Working process of cluster . There are many components in the diagram , Explain it. :
- Application Service Equivalent to a service provider ,Application Client Equivalent to serving consumers
- Make Remote Call, It can be simply understood as calling RESTful API
- us-east-1c、us-east-1d Are all zone, They all belong to us-east-1 This region
About zone and region You can see this article for an introduction to :eureka In depth explanation of zoning
It can be seen from the picture that ,Eureka There are two components :Eureka Server and Eureka Client, Their functions are as follows :
- Eureka Client It's a Java client , Used to simplify and Eureka Server Interaction ;
- Eureka Server The ability to provide service discovery , When each microservice starts , Will pass Eureka Client towards Eureka Server Register your own information ( For example, network information ),Eureka Server Will store information about the service
- After the micro service is started , Periodically Eureka Server Send a heartbeat ( Default period 30 second ) To renew your information . If Eureka Server The heartbeat of a microservice node is not received within a certain period of time ,Eureka Server The microservice node will be unregistered ( Default 90 second )
- Every Eureka Server It's also Eureka Client, Multiple Eureka Server Complete the synchronization of service registry through replication
- Eureka Client Will cache Eureka Server Information in . Even if all Eureka Server All nodes are down , Service consumers can still find service providers using cached information .
Sum up ,Eureka By heartbeat detection 、 Mechanisms such as health checks and client caching , Improved system flexibility 、 Scalability and availability .
边栏推荐
- 【象棋人生】01 人生如棋
- Can the characteristics of different network structures be compared? Ant & meituan & NTU & Ali proposed a cross architecture self supervised video representation learning method CaCl, performance SOTA
- June 25 PMI certification examination site epidemic prevention requirements and examination room arrangement
- [mavros] mavros startup Guide
- Lesson 029: Documents: a task? After class test questions and answers
- 2022年朝阳区科技创新课之“产品创新与成果转化”训练营活动圆满结束
- NIO复制文件调用getChannel方法 transferFrom()
- For an unforgettable memory: special topic of Sun Jian
- 【路径规划】第一周: 大杂烩
- [Li mu] how to read papers [intensive reading of papers]
猜你喜欢

Microsoft edge browser will support network speed measurement, built-in calculator and unit conversion tool

Redis core technology and practice: learning summary directory

SPA项目开发之首页导航+左侧菜单

校园跑腿管理端APP—陕西格创

(duc/ddc) digital up mixing / quadrature down mixing principle and MATLAB simulation

Capital and share increase of avita technology under Chang'an is settled: Ningde times will hold about 24%!

Research hotspot - Official publicity! The release time of JCR zoning and impact factors will be determined in 2022!

The necessary materials for the soft test have been released. All the soft test materials for the whole subject have been prepared for you!

300. longest increasing subsequence ●●

Crud+ form verification for spa project development
随机推荐
Lesson 023 and 024: recursion: these little bunnies, Hanoi Tower after class test questions and answers
IDC publie le rapport sur la gouvernance des données en Chine
PMP Exam admission ticket problems and precautions in June, which must be read by candidates
勒索病毒横行下设备该如何进行加密防护
Niuke's height in the 52nd monthly race B (thinking problem simulation problem)
June 25 PMI certification examination site epidemic prevention requirements and examination room arrangement
Lesson 020: functions: embedded functions and closures | after class test questions and answers
(duc/ddc) digital up mixing / quadrature down mixing principle and MATLAB simulation
Jerry's plug-in 4m flash to view the processing method with a size of only 1m on the PC [chapter]
Jerry's problem of opening the near end of four channel call [chapter]
IDC發布中國數據治理報告 億信華辰第一
Linux安装Mysql(包成功!!)
[geometric vision] 4.2 piecewise linear transformation
【路径规划】第一周: 路径规划 开源代码汇总(ROS) 版本
RapidEye快鸟、SPOT卫星遥感影像数据
大不列颠泰迪熊加入PUBG 手游
CYCA少儿形体礼仪 深圳市培训成果考核圆满落幕
What is a data asset? How should data asset management be implemented?
[Li mu] how to read papers [intensive reading of papers]
Query es page subscript exceeds 10000