7

Spring Cloud Consul 注册丢失

 2 years ago
source link: https://www.v2ex.com/t/789934
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

Spring Cloud Consul 注册丢失

  jimmyismagic · 1 天前 · 357 次点击

项目采用 consul 作为注册中心, 服务跑了一段时间后,某些服务就从注册中心消失,无法被其他服务访问,但服务本身还是正常的,内部直接 /actuator/health 返回的也是 UP

消失基本都是在服务接收到大量外部连接的时候。

该怎么排查这个问题,目前没有日志看到服务注册断开。

4 条回复    2021-07-17 07:35:56 +08:00

tms

tms   1 天前

看 consul 的健康检查日志

fkdog

fkdog   1 天前

info 里没记录那就临时切到 debug 级别看 warning 和 debug 信息.

th00000

th00000   1 天前

线上跑了好久了 没出过你这个问题, Consul 如果健康检查通过应该不会出现摘掉服务的情况
你访问 health check api 没问题的时间不代表 Consul 访问的时候没问题
服务流量大的时候 health check api 可能来不及响应
你应当先查服务的监控, 看当时 CPU 占用是怎样的, JVM 是怎样的, GC 有没有问题, 有没有 STW 时间过长, 超过了 health check 的 timeout

xuanbg

xuanbg   19 小时 11 分钟前

应该是你的健康检查某些时候没有响应造成的。我遇到过的是邮件服务的健康检查超时造成服务间歇性下线,后来在配置里面把邮件的健康检查 disable 就好了。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK