Eureka自我保护模式

Server Self Preservation Mode

Self Preservation Mode
Eureka servers will enter self preservation mode if they detect that a larger than expected number of registered clients have terminated their connections in an ungraceful way, and are pending eviction at the same time. This is done to ensure catastrophic network events do not wipe out eureka registry data, and having this be propagated downstream to all clients.

超过预期的大量已注册的客户端以一种不优雅的方式终止了自己的连接,Eureka servers将会剔除失效节点。此时,Eureka servers将会进入自我保护模式。进入自我保护模式是为了确保网络问题不会影响Eureka注册表中的数据,从而可以将数据传播到下游所有服务节点。

To better understand self preservation, it help to first understand how does eureka clients ‘end’ their registration lifecycle. The eureka protocol requires clients to execute an explicit unregister action when they are permanently going away. For example, in the provided java client, this is done in the shutdown() method. any clients that fails 3 consecutive heartbeat renewals is considered to have an unclean termination, and will be evicted by the background eviction process. It is when > 15% of the current registry is in this later state, that self preservation will be enabled.

理解eureka clients如何终结他们的注册生命周期,可以辅助理解自我保护模式。Eureka协议要求所有的客户端在离开服务注册时候需要显示执行注销行为。比如在Eureka 的Java Client 中需要显示执行shutdown()方。任何连续三次续约失败的节点将会被考虑异常终结,并且将会被后台程序进行失效清除。如果失效规模达到当前注册规模的0.15以上,自我保护模式将会被激活。

When in self preservation mode, eureka servers will stop eviction of all instances until either:
the number of heartbeat renewals it sees is back above the expected threshold, or
self preservation is disabled (see below)
Self preservation is enabled by default, and the default threshold for enabling self preservation is > 15% of the current registry size.

当进入自我保护模式,Eureka servers 将会停止清除所有失效节点,直到一下两种行为中的一个发生才会重新恢复:

1. 续约的心跳数,又恢复到期待的阙值上。
2. 自我保护模式被禁用

自我保护模式,默认是开启的,默认的自我保护阙值是注册表的0.15

How to configure self preservation threshold
The self preservation config is defined here. To change self preservation threshold in the example, set the property: eureka.renewalPercentThreshold=[0.0, 1.0].

配置自我保护阙值:使用eureka.renewalPercentThreshold=[0.0, 1.0]

How to disable self preservation
The self preservation config is defined here. To disable self preservation in the example, set the property: eureka.enableSelfPreservation=false.

禁用自我保护阙值:eureka.enableSelfPreservation=false

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值