如何解决Eureka Server不踢出已关停的节点的问题?
server端:
eureka.server.enable-self-preservation (设为false,关闭自我保护主要)
eureka.server.eviction-interval-timer-in-ms 清理间隔(单位毫秒,默认是60*1000)
client端:
eureka.client.healthcheck.enabled = true 开启健康检查(需要spring-boot-starter-actuator依赖)
eureka.instance.lease-renewal-interval-in-seconds =10 租期更新时间间隔(默认30秒)
eureka.instance.lease-expiration-duration-in-seconds =30 租期到期时间(默认90秒)
示例:
服务器端配置:
eureka:
server:
enableSelfPreservation: false
evictionIntervalTimerInMs: 4000
客户端配置:
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
leaseExpirationDurationInSeconds: 30
注意:
更改Eureka更新频率将打破服务器的自我保护功能
https://github.com/spring-cloud/spring-cloud-netflix/issues/373
==============================
QQ群:143522604
欢迎和大家一起学习、交流、提升!
==============================