项目中需要监控各个微服务节点的健康状态,找到了spring boot admin这个全家桶监控工具,它其实是Vue.js美化过的Spring Boot Actuator,官方的解释是:
codecentric’s Spring Boot Admin is a community project to manage and monitor your Spring Boot ? applications. The applications register with our Spring Boot Admin Client (via HTTP) or are discovered using Spring Cloud ? (e.g. Eureka, Consul). The UI is just a Vue.js application on top of the Spring Boot Actuator endpoints.
最新的版本是2.1.2,这里是官方文档。
个人觉得官方文档并不是十分的友好,推荐这个详细搭建的步骤供大家参考:
https://juejin.im/post/5c34bcfdf265da615b71a3a8
运行成功后服务节点一直显示为DOWN,访问 http://127.0.0.1:8081/actuator/health返回
可以看出redis 宕机了,但其实我项目本身没有使用redis。
在显示DOWN的客户端添加如下配置(忽略redis的健康检查):
spring:
profiles:
active: dev
management:
health:
redis:
enabled: false
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: "*"
server:
port: 8081
再次访问:http://127.0.0.1:8081/actuator/health
这里要注意一下,只要其中一个监控内容为DOWN,则该节点的总体状态就为DOWN。
更多推荐
Spring boot admin 节点状态一直为DOWN的排查(忽略某一个节点的健康检查)
发布评论