当前位置: 移动技术网 > IT编程>开发语言>Java > Spring boot admin 节点状态一直为DOWN的排查

Spring boot admin 节点状态一直为DOWN的排查

2019年01月21日  | 移动技术网IT编程  | 我要评论

爱啦网,副校长救落水儿童,青年人网

项目中需要监控各个微服务节点的健康状态,找到了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.

最新的版本是,这里是。

它有两种使用方式,一种是客户端主动连接服务端,另一种是基于spring cloud discovery(eureka、consul、zookeeper等),因为项目里已经集成了eureka,所以采用第二种方式搭建。

个人觉得官方文档并不是十分的友好,推荐这个详细搭建的步骤供大家参考:

运行成功后有一个服务节点一直显示为down,访问http://127.0.0.1/actuator/health返回

{"status":"down"}

其他节点正常。

在显示down的客户端添加如下配置:

management:
  endpoints:
    web:
      exposure:
        include: "*" #暴露所有节点
    health:
      sensitive: false #关闭过滤敏感信息
  endpoint:
    health:
      show-details: always  #显示详细信息

再次访问访问http://127.0.0.1/actuator/health,返回:

{
  "status":"down",
  "diskspace":{
    "status":"down",
    "total":16579448832,
    "free":20480,
    "threshold":10485760
  },
  "db":{
    "status":"up",
    "database":"h2",
    "biz":1
  }

原来是磁盘空间不足,处理后所有监控节点都为up正常状态。(黄色的有本地启动的instance,可忽略)

image

这里要注意一下,只要其中一个监控内容为down,则该节点的总体状态就为down

参考链接:

https://github.com/forezp/springcloudlearning/tree/master/sc-f-boot-admin-cloud

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网