spring cloud 注册发现原理

以下内容仅自己观点,忘大神指点:

1. 服务提供者 和 注册中心的关联关系

服务提供者----心跳---->注册中心   

eureka.instance.lease-renewal-interval-in-seconds=30  (设置心跳时间)

eureka.instance.lease-expiration-duration-in-seconds=90  (如果注册中心90s还未收到心跳,将服务剔除)

注册中的自我保护

如果15min内收到85%的 服务失效即心跳停止,那么注册中心将开启自我保护,不再剔除服务提供者。

ps:  eureka.server.enable-self-preservation=false 这个很重要,该服务将关闭自我保护,当只要心跳停止,即将该服务剔除。

微信:zmjyyg (一对一讲解)

posted @ 2018-08-22 10:09  James-Y-G-Yin  阅读(677)  评论(0编辑  收藏  举报