记一次springboot服务注册的问题
使用的consul注册中心,服务可以在注册中看到已注册,但是健康状态是x,检查程序日志又无任何报错提示,通过http://IP:端口/actuator/health 发现
{"status":"DOWN"}
最终排查到status:down的原因是因为redis检测状态是down,导致服务整体健康down
排查此类问题可以在application或者bootstrap配置文件中开启健康状态详情配置代码如下
management.endpoint.health.show-details=always
如果未配置健康详情,只会返回整体健康状态,不会具体返回由什么原因导致status:down

浙公网安备 33010602011771号