开发框架 springBoot
2024-10-21 06:11:34
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}}}}
最新文章
- mysql字符串处理例子
- 反射 + 抽象工厂模式切换DB数据源(附Demo)
- Hire Me, Microsoft China
- Android下使用Properties文件保存程序设置
- Android开发学习之路-自定义ListView(继承BaseAdapter)
- jquery.validate.js的remote用法
- Gulp 自动化的项目构建工具
- Angular.js之内置过滤器学习笔记
- Django REST framework+Vue 打造生鲜超市(九)
- bzoj1071[SCOI2007]组队
- windows上react-native run-android时Exception in thread ";main"; java.lang.IllegalArgumentException: MALFORMED报错
- Activity的介绍
- 1.编写一个shell脚本
- Vue随笔记录
- Java四种引用
- 网络基础&#160;Windows控制台下Ftp使用简介
- net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting head
- (C/C++学习笔记)附页: C/C++各数据类型的相关说明
- iOS VideoToolBox decoder解码失败(-12909和-12911)问题解决
- jQuery插件开发的五种形态小结
热门文章
- svn Previous operation has not finished; run &#39;cleanup&#39; if it was interrupted
- laravel5.5开发composer扩展包
- 《1024伐木累》-小白篇之丽jie(结束篇)-总章节六
- Jenkins拾遗--第五篇-git插件填坑
- uiautomator+cucumber实现移动app自动化测试
- 数据库——mysql内置功能(11)
- rownum浅谈(一)
- django orderby
- iPhone新建项目不能全屏
- 【linux】如何解决VMWare上linux虚拟机连不上外网的问题?