nacos springcloud2 动态修改配置导致eureka注册中心服务实例下线问题解决
·
异常描述:
2021-10-13 17:35:37.515 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.netflix.discovery.DiscoveryClient - Getting all instance registry info from the eureka server
2021-10-13 17:35:37.524 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.netflix.discovery.DiscoveryClient - The response status is 200
2021-10-13 17:35:37.525 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.netflix.discovery.DiscoveryClient - Starting heartbeat executor: renew interval is: 10
2021-10-13 17:35:37.526 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.netflix.discovery.InstanceInfoReplicator - InstanceInfoReplicator onDemand update allowed rate per min is 5
2021-10-13 17:35:37.526 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.netflix.discovery.DiscoveryClient - Discovery Client initialized at timestamp 1634117737526 with initial instances count: 33
2021-10-13 17:35:37.528 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] WARN com.netflix.discovery.DiscoveryClient - Saw local status change event StatusChangeEvent [timestamp=1634117737528, current=DOWN, previous=STARTING]
2021-10-13 17:35:37.529 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] WARN com.netflix.discovery.DiscoveryClient - Saw local status change event StatusChangeEvent [timestamp=1634117737529, current=UP, previous=DOWN]
2021-10-13 17:35:37.529 [DiscoveryClient-InstanceInfoReplicator-0] WARN com.netflix.discovery.DiscoveryClient - Saw local status change event StatusChangeEvent [timestamp=1634117737529, current=DOWN, previous=UP]
2021-10-13 17:35:37.530 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.alibaba.nacos.client.config.impl.CacheData - [fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] [notify-ok] dataId=bop-fms-account-info.yml, group=fms-account-info, md5=9ed36740a83f637e2a1d77f44a4d3762, listener=com.alibaba.cloud.nacos.refresh.NacosContextRefresher$1@688a3ce9
2021-10-13 17:35:37.530 [DiscoveryClient-InstanceInfoReplicator-0] WARN com.netflix.discovery.InstanceInfoReplicator - Ignoring onDemand update due to rate limiter
2021-10-13 17:35:37.530 [com.alibaba.nacos.client.Worker.longPolling.fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] INFO com.alibaba.nacos.client.config.impl.CacheData - [fixed-10.22.7.81_8848-2f11f02e-9115-4d5e-bc9c-31681a04c715] [notify-listener] time cost=4068ms in ClientWorker, dataId=bop-fms-account-info.yml, group=fms-account-info, md5=9ed36740a83f637e2a1d77f44a4d3762, listener=com.alibaba.cloud.nacos.refresh.NacosContextRefresher$1@688a3ce9
2021-10-13 17:35:37.530 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_BOP-FMS-ACCOUNT-INFO/hamlet2.bop.xxx.com:bop-fms-account-info:8846: registering service...
2021-10-13 17:35:37.536 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_BOP-FMS-ACCOUNT-INFO/hamlet2.bop.xxx.com:bop-fms-account-info:8846 - registration status: 204
关键错误:
WARN com.netflix.discovery.InstanceInfoReplicator - Ignoring onDemand update due to rate limiter
解决方案:
引入jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
yml配置
eureka:
client:
healthcheck:
enabled: true # 当使用nacos配置中心时,必须设置为true,不然nacos动态修改配置时会出现eureka服务实例下线的问题
#监控配置
management:
health:
defaults:
enabled: false #禁用所有组件健康检查
springcloud 和配置中心一起使用时踩到的一个坑
使用refreshScope.refresh导致Eureka服务下线
Spring Cloud Eureka服务注册
更多推荐
所有评论(0)