Background generated by self-protection mechanism
By default, Eureka Server within a certain time (default 90 seconds) does not receive a service instance is sent to the micro heartbeat, Eureka Server removes this instance, but if the network is the cause, Eureka Client and not between Eureka Server communications, micro service itself is running at this time should not remove the micro-services, so have self-protection mechanism
officer declared address: https: //github.com/Netflix/eureka/wiki/Understanding-Eureka-Peer- to-Peer-Communication
official said that
the working mechanism of self-protection mechanism is that if more than 85% within 15 minutes of client nodes do not have a normal heartbeat, the Eureka is considered the client and the registry of a network failure, Eureka Server automatically enter the self-protection mechanism
Bring self-protection mechanisms
Eureka Server no longer be removed because for a long time and should not receive heartbeat expired registration service from the list.
Eureka Server will still be able to accept registration and query requests for new services, but will not be synchronized to the other nodes to ensure that the current node is still available.
solution
- Close the development process of self-protection mechanism
eureka:
server:
enable-self-preservation: false
- Circuit breakers
use of load balancing, when a set number of seconds after the request over the next handover request a registration service, for example, Ribbon + Hystrix breaker and load balancing configuration