二、Spring Boot基础

【学习Spring Boot基础,创建Spring Boot项目,讲解Spring Boot的配置,是学习Spring Cloud Alibaba的必知必会.

Spring Boot基础

快速创建应用  https://www.cnblogs.com/my-program-life/p/11592838.html

Spring Boot基础知识  https://www.cnblogs.com/my-program-life/p/11958428.html

补充知识: Spring Boot Actuator监控

pom.xml

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

 

监控指示器HealthIndicators

 常用端点

所有端点情况 https://docs.spring.io/spring-boot/docs/2.0.0.M3/reference/htmlsingle/#production-ready-endpoints

健康检查

/health 
作用:健康检查
status取值情况
UP:正常
DOWN :遇到了问题,不正常
OUT_OF_SERVICE:资源未在使用,或者不该去使用
UNKNOWN: 未知

显示health端点的详情

application.properties

# 显示health端点的详情
management.endpoint.health.show-details=always

 info信息

 配置

# 描述应用
info.app-name=spring-boot-demo
info.author=czy
info.email=XXXXX@com

激活所有的actuator端点

# 激活所有的actuator端点
management.endpoints.web.exposure.include=*

激活actuator指定端点 

# 激活actuator个别端点
management.endpoints.web.exposure.include=metrics,health

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值