3.1 Eureka self-protection

Source: Internet
Author: User

Fault symptom:

 

Down: Indicates deprecation (disconnection.

Cause:

In a word, a microservice is unavailable at a certain time, and Eureka will not immediately clean up and save the information of the microservice.

 

What is a self-protection model?

By default, if eurekaserver does not receive the heartbeat of a microservice instance within a certain period of time, eurekaserver will log off the instance (90 s by default ).

However, when a network partition failure occurs, the microservice and eurekaserver cannot communicate normally, and the above behavior may become very dangerous-because the microservice itself is actually healthy,

This microservice should not be logged out. Eureka uses the "self-protection mode" to solve this problem-when the eurekaserver node loses too many clients in a short period of time (possibly

If a network partition fault occurs, the node enters the self-protection mode. Once you enter this mode, eurekaserver will protect the information in the service registry and will not delete it.

Data in the Service Registry (that is, no microservice will be logged out ). After a network fault is restored, the EUREKA server node automatically exits the self-protection mode.

In self-protection mode, the EUREKA server protects the information in the service registry and no longer cancels any service instances. When the heartbeat count it receives is restored to a threshold value above,

The Eureka server node automatically exits the self-protection mode. Its design philosophy is to retain incorrect service registration information without blindly logging out any potentially healthy service instances.

One sentence: It's better to die than to survive.

In summary, the self-protection mode is a security protection measure to cope with network exceptions. Its architecture philosophy is to retain all microservices at the same time (Healthy microservices and unhealthy

And do not blindly log off any healthy microservice. The self-protection mode can make the Eureka cluster more robust and stable.


In spring cloud, you can use Eureka. server. Enable-self-preservation = false to disable the self-protection mode. Do not disable the self-protection mechanism.

3.1 Eureka self-protection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.