Eureka is an open source Service registration and Discovery product from Netflix that provides complete implementations of Service Registry and Service Discovery. It is also one of the most important and core components of the springcloud architecture.
Service center The service center, also known as the registry, manages various service functions, such as service registration, discovery, fusing, load, and downgrade, such as the functions of the Dubbo Admin background.
How will the service center call relationship change? Draw some diagrams to help understand
Project A calls project B
Item A is normally called to request item B
After the service center, any service can not be directly removed, all need to call through the service center
Project A calls project B, and project B calls project C
At this point, the invoked step is two-step: first, project A first requests the project B server from the service center, and then Project B requests the project C service from the service center.
The above project is just two or three simple call each other, but if the project is more than 20 to 30, when we distributed the project by the end of 15 to reach 20, draw a picture to describe the relationship between calls between dozens of projects are all lines, any one of the project changes, will be involved in several projects following the restart, Cumbersome and error-prone. You do not need to pay attention to the IP address of the project you call through the service center. It is composed of several servers. Each time you directly go to the service center to get the service that can be used to call.
Since various services are registered in the service center, there are many advanced features to do. For example, several services provide the same service to balance the load. Monitor the success rate of server calls to make fuses and remove failure points from the service list; Monitor service invocation times to set different weights for different servers, and so on.
Eureka Eureka is a REST-based service used in the AWS cloud for load balancing and failover of middle-tier servers.
Spring Cloud encapsulates the Eureka module developed by Netflix for service registration and discovery. Eureka adopts the C-S design architecture. Eureka Server serves as the Server for the service registry function. It is the service registry. Other microservices in the system use Eureka’s clients to connect to Eureka Server and maintain heartbeat connections. In this way, the maintenance personnel of the system can monitor the normal operation of each micro-service in the system through Eureka Server. Some other modules in Spring Cloud, such as Zuul, can use Eureka Server to discover other microservices in the system and perform related logic.
Eureka consists of two components: Eureka server and Eureka client. The Eureka server serves as the service registry server. The Eureka client is a Java client designed to simplify interactions with servers, act as a polling load balancer, and provide failover support for services. Netflix uses a separate client in its production environment that provides weighted load balancing based on traffic, resource utilization, and error status.
Here’s a picture:
The diagram above briefly describes the basic architecture of Eureka, consisting of three roles:
1. Eureka Server provides service registration and discovery
2. Service Provider registers its Service with Eureka, so that Service consumers can find it
The Consumer obtains the list of registered services from Eureka and is able to consume the services
The technical architecture diagram is as follows: