SpringCloud of Eureka self-protection mechanism

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
Here Insert Picture Description
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

  1. Close the development process of self-protection mechanism
eureka:
  server:
    enable-self-preservation: false
  1. 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
Published 14 original articles · won praise 78 · views 10000 +

Guess you like

Origin blog.csdn.net/LynneZoe/article/details/103948235