【问题标题】:what is the property management.health.redis.enabled and how to use it?什么是属性 management.health.redis.enabled 以及如何使用它?
【发布时间】:2019-02-08 03:03:59
【问题描述】:

在我们的一个 application.yml 中看到这个属性,这个属性是什么,它的值是 true ,这是什么意思?如果它的值为true,如何使用它?

【问题讨论】:

    标签: spring spring-boot caching redis


    【解决方案1】:

    表示开启Redis健康检查。

    management.health.redis.enabled=true # Whether to enable Redis health check.
    

    这里true表示开启redis健康检查,false表示未开启。

    使用非常简单,如果要启用redis健康检查,只需将management.health.redis.enabled设置为true,禁用即可。

    看到这个:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties

    【讨论】:

    • 如果我们启用会发生什么?如果启用,如何检查 redis 运行状况?如果他们的终点?
    • 通过访问 url localhost:8080/health 来检查 redis 运行状况,你会得到这个响应,并且在那个 redis 中也存在 {"status":"UP","diskSpace":{"status": "UP","total":499046809600,"free":266940710912,"threshold":10485760},"redis":{"status":"UP"}}
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-17
    • 2013-11-07
    • 1970-01-01
    • 1970-01-01
    • 2022-01-10
    • 2015-03-13
    相关资源
    最近更新 更多