SpringCloud (二) Eureka

table of Contents

1. Introduction

2. Composition

Three, function

EureKa-service 

EureKa-client

Fourth, the cluster

 


Learning reference
Brief description: https://blog.csdn.net/CSDN_HELIU/article/details/93967504

Details: https://blog.csdn.net/qwe86314/article/details/94552801

 

1. Introduction

Eureka is a (service discovery) framework developed by neflix, which respects the REST specification and implements the main functions of service discovery and registration.

2. Composition

EureKa is composed of EureKa-service and EureKa-client

Three, function

EureKa-service 

Service registration When the
service provider starts, it will register information with the Eureka Server through the Eureka Client, and the Eureka Server will store the service information to form a registry

Provide registry
service consumers will get the latest registry from Eureka Server if the Eureka Client does not cache the registry when calling the service

Synchronization status
Eureka Server synchronizes the current client status of Eureka Client through registration, heartbeat mechanism.

Heartbeat mechanism

Send a heartbeat every 30 seconds, if there is no reply within 90 seconds, the client's registration information will be removed

Self-protection mechanism

If multiple heartbeat mechanism removal is triggered in a short period of time (85% failure rate within 15 minutes), the mechanism is activated.
1 Eureka will no longer remove from the registration list services that should expire because they have not received a heartbeat for a long time.
2 Eureka still Able to accept new service registration and query requests, but will not be synchronized to other nodes (that is, to ensure that the current node is still available)
3 When the network is stable, the new registration information of the current instance will be synchronized to other nodes

 

EureKa-client

Cache access

When the service is hung up, the cache stored in the client itself will be called to access the client

Load balancing

ribbon load balancing strategy, add annotation @LoadBalanced when using it, commonly used random and polling strategy

The bottom layer of the specific strategy: https://blog.csdn.net/dkbnull/article/details/89506462

 

Fourth, the cluster

Configure multiple servers, and there will be a timing synchronization between them. If there is a problem, you can call other servers

There are shortcomings and synchronization is not timely.
At the same time, client load balancing will also select the best server according to the strategy

 

 

Guess you like

Origin blog.csdn.net/qq_37203082/article/details/112796382