In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
First of all, the Eureka registry needs to understand that all nodes in Eureka are equal, there is no concept of roles in ZK, even if one node dies, it will not affect the normal operation of other nodes. To understand the springcloud architecture, please add: three, six, two, four, seven, two, 59
By default, if Eureka Server does not receive the heartbeat of a microservice instance within a certain period of time (default is 90 seconds), Eureka Server will remove the instance. However, when the network partition failure occurs, the micro-service and Eureka Server can not communicate normally, and the micro-service itself is running normally, so the micro-service should not be removed at this time, so the self-protection mechanism is introduced.
Self-protection mode is a kind of security protection measure against abnormal fluctuations of the network. The use of self-protection mode can make the Eureka cluster run more robust and stable.
The working mechanism of the self-protection mechanism is that if more than 85% of the client nodes do not have a normal heartbeat within 15 minutes, then Eureka believes that there is a network failure between the client and the registry, and Eureka Server automatically enters the self-protection mechanism. The following situations will occur:
1. Eureka Server no longer removes services from the registration list that should expire because they have not received a heartbeat for a long time.
2. Eureka Server can still accept registration and query requests for new services, but it will not be synchronized to other nodes to ensure that the current node is still available.
3. When the network is stable, the new registration information of the current Eureka Server will be synchronized to other nodes.
Therefore, Eureka Server can well deal with the situation that some nodes are lost due to network failure, unlike ZK, if half of the cases are unavailable, the whole cluster will become paralyzed.
Self-protection switch
Eureka self-protection mechanism, by configuring eureka.server.enable-self-preservation to true / false disable self-protection mechanism, default on state, it is recommended to open this configuration in the production environment.
Development environment configuration
If you want to automatically remove service failures in the development environment, you only need to modify the following configuration.
1. The registry shuts down the self-protection mechanism and modifies the time for checking for failed services.
Eureka: server: enable-self-preservation:false eviction-interval-timer-in-ms:3000
2. Microservice modification shortens the heartbeat time of the service.
Lease-expiration-duration-in-seconds:10 lease-renewal-interval-in-seconds:3
The above configuration is recommended to use the default time configuration in the production environment.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.