美文网首页
spring-boot-starter-actuator 健康监

spring-boot-starter-actuator 健康监

作者: 帮我的鸵鸟盖个章 | 来源:发表于2021-02-23 18:21 被阅读0次

spring-boot-starter-actuator 健康监控配置及使用

背景: 项目为dubbo服务,现在需要给项目一个域名提供公网使用,运维设置必须接入健康监控,其余不清楚。

步骤:1. 引入依赖; 2. 配置propertis文件

需要引入的依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

properties配置文件

# 健康检查
management.context-path=/actuator
# 不进行安全检查。运维设置默认检查
management.security.enabled=false
# 不进行redis检查。运维设置默认检查
management.health.redis.enabled=false
# 不进行MongoDB检查。运维设置默认检查
management.health.mongo.enabled=false
# 不进行elasticsearch检查。运维设置默认检查
management.health.elasticsearch.enabled=false

# 允许程序与内置端点的交互
management.endpoints.web.exposure.include=env,beans

启动项目,附上两张效果图

访问:/actuator/health

health.png

访问:/actuator/beans

beans.png

参考:

Spring Boot 2.0官方文档之 Actuator

相关文章

网友评论

      本文标题:spring-boot-starter-actuator 健康监

      本文链接:https://www.haomeiwen.com/subject/hfkdfltx.html