1.多个环境的配置文件

在application.yml 中配置需要调用的配置文件

spring:
profiles:
active: dev

运行方式的,先运行application.yml 再根据active指定的配置文件,进行覆盖。

linux中启动程序指定配置文件

java -jar springbootdemo.jar -- spring.profiles.active=dev

2.运行状态监控Actuator

pom中引入依赖

<!--运行状态监控-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

在application.yml文件中配置

management:
endpoints:
web:
exposure:
include: "*"
server:
port: 10111
servlet:
context-path: /
ssl:
enabled: false
endpoint:
health:
show-details: always

访问方式:http://localhost:10111/actuator/health

访问结果:

{"status":"UP","details":{"db":{"status":"UP","details":{"database":"MySQL","hello":1}},"diskSpace":{"status":"UP","details":{"total":463330078720,"free":113779286016,"threshold":10485760}}}}

最新文章

  1. mysql字符串处理例子
  2. 反射 + 抽象工厂模式切换DB数据源(附Demo)
  3. Hire Me, Microsoft China
  4. Android下使用Properties文件保存程序设置
  5. Android开发学习之路-自定义ListView(继承BaseAdapter)
  6. jquery.validate.js的remote用法
  7. Gulp 自动化的项目构建工具
  8. Angular.js之内置过滤器学习笔记
  9. Django REST framework+Vue 打造生鲜超市(九)
  10. bzoj1071[SCOI2007]组队
  11. windows上react-native run-android时Exception in thread &quot;main&quot; java.lang.IllegalArgumentException: MALFORMED报错
  12. Activity的介绍
  13. 1.编写一个shell脚本
  14. Vue随笔记录
  15. Java四种引用
  16. 网络基础&#160;Windows控制台下Ftp使用简介
  17. net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting head
  18. (C/C++学习笔记)附页: C/C++各数据类型的相关说明
  19. iOS VideoToolBox decoder解码失败(-12909和-12911)问题解决
  20. jQuery插件开发的五种形态小结

热门文章

  1. svn Previous operation has not finished; run &#39;cleanup&#39; if it was interrupted
  2. laravel5.5开发composer扩展包
  3. 《1024伐木累》-小白篇之丽jie(结束篇)-总章节六
  4. Jenkins拾遗--第五篇-git插件填坑
  5. uiautomator+cucumber实现移动app自动化测试
  6. 数据库——mysql内置功能(11)
  7. rownum浅谈(一)
  8. django orderby
  9. iPhone新建项目不能全屏
  10. 【linux】如何解决VMWare上linux虚拟机连不上外网的问题?