当 Redis 宕机时,服务健康检查 API 返回 503。
{
"status": "DOWN",
"details": {
"diskSpace": {
"status": "UP",
"details": {
"total": 250790436864,
"free": 95412813824,
"threshold": 10485760
}
},
"db": {
"status": "UP",
"details": {
"database": "PostgreSQL",
"hello": 1
}
},
"refreshScope": {
"status": "UP"
},
"redis": {
"status": "DOWN",
"details": {
"error": "org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379"
}
}
}
}
实际上,即使Redis宕机,服务仍然可用。
服务状态能否不受Redis状态的影响?我还需要在健康检查API中查看Redis的详细信息。