当前位置: 首页 > news >正文

东莞公司网站自助建站系统源码

东莞公司网站,自助建站系统源码,合肥seo推广培训班,上海英文网站建设接上一篇#xff1a;SpringBoot入门到精通_第5篇 _SpringBoot Actuator监控 https://blog.csdn.net/weixin_40816738/article/details/101097428 文章目录一、SpringBoot 配置管理1. 配置管理3种方式1.1. 以.properties为后缀名1.2. 以.yml/.yaml为后缀名(建议使用)2. Spring … 接上一篇SpringBoot入门到精通_第5篇 _SpringBoot Actuator监控 https://blog.csdn.net/weixin_40816738/article/details/101097428 文章目录一、SpringBoot 配置管理1. 配置管理3种方式1.1. 以.properties为后缀名1.2. 以.yml/.yaml为后缀名(建议使用)2. Spring Boot配置管理17种姿势2.1. 配置文件2.2. 环境变量2.3. 启动项目访问3. 启动项目第2种形式4. 外部配置文件_优先级5. 命令行参数5.1. idea中配置5.2. 命令行配置启动6. 必知必会 Profile6.1 如何实现不同环境配置6.2 以.properties形式采用多配置文件实现7. 最佳实战总结一、SpringBoot 配置管理 1. 配置管理3种方式 支持的配置格式 1.1. 以.properties为后缀名 #springboot全局配置文件 management.endpoint.health.show-detailsalways #激活所有的actuator端点 #management.endpoints.web.exposure.include* #激活指定端点 management.endpoints.web.exposure.includemetrics,health #info 显示应用信息 #格式info.xy key values 形式 info.app.namespring-boot-demo info.authoractuator info.emailgblfyemail.com1.2. 以.yml/.yaml为后缀名(建议使用) #Yet Anther Markup Language(.yml/.yaml)JSON子集 #激活指定端点 management:endpoint:health:show-details: alwaysendpoints:web:exposure:include: metrics,health #info 显示应用信息 #格式info.xy key values 形式 info:app-name: spring-boot-demoauthor: actuatoremail: gblfyemail.com2. Spring Boot配置管理17种姿势 配置管理常用方式 2.1. 配置文件 2.2. 环境变量 2.3. 启动项目访问 http://localhost:8080/actuator/health3. 启动项目第2种形式 构建跳过单元测试 mvn clean install -DskipTests启动项目带参数 java -jar spring-boot-actuator-0.0.1-SNAPSHOT.jar --SOME_ENValways4. 外部配置文件_优先级 新建一个test文件夹做演示把构建后的jar包和appilication.yml文件复制到test目录中 将${SOME_ENV}参数修改为nerver启动项目验证 java -jar spring-boot-actuator-0.0.1-SNAPSHOT.jar5. 发现/actuator/health端点不显示详情了 说明SpringBoot可以读取jar相同目录下的配置文件并且这个配置文件比jar里面配置文件的优先级更高 5. 命令行参数 5.1. idea中配置 比如想改变tomcat启动时端口号又不想写到配置文件中 验证 http://localhost:8082/actuator/health5.2. 命令行配置启动 java -jar spring-boot-actuator-0.0.1-SNAPSHOT.jar --server.port80826. 必知必会 Profile 6.1 如何实现不同环境配置 .yml配置文件采用3段形式 公共配置 --- 开发环境配置 --- 生产环境配置 ---默认激活环境配置添加设置如下 spring:profiles:active: dev举个栗子 #所有环境公用的配置属性 #Yet Anther Markup Language(.yml/.yaml)JSON子集 #激活指定端点 management:endpoint:health:show-details: ${SOME_ENV}endpoints:web:exposure:include: * #info 显示应用信息 #格式info.xy key values 形式 info:app-name: spring-boot-demoauthor: actuatoremail: gblfyemail.com spring:profiles:active: dev --- #profiley的专用属性也就是某个环境下的专用属性 #开发环境 spring:profiles: dev server:tomcat:max-threads: 500max-connections: 800 --- #profiley的专用属性也就是某个环境下的专用属性 #生产环境 spring:profiles: prod server:tomcat:max-threads: 300max-connections: 1000 调用端点查看配置是是否生效 http://localhost:8080/actuator/configprops 6.2 以.properties形式采用多配置文件实现 一个环境一个配置文件如下图所示有一个公共的配置文件一个开发环境的配置文件一个生产环境的配置文件 默认激活环境设置如下 #spring.profiles.active环境 spring.profiles.activeprodapplication.properties #springboot全局配置文件 #actuator监控 management.endpoint.health.show-detailsalways #激活所有的actuator端点 management.endpoints.web.exposure.include*#info 显示应用信息 #格式info.xy key values 形式 info.app-namespringboot-actuator info.authorgblfy info.emailgblfyemail.com#spring.profiles.active环境 spring.profiles.activeprodapplication-dev.properties server.tomcat.max-threads300 server.tomcat.max-connections800application-prod.properties server.tomcat.max-threads500 server.tomcat.max-connections1000查看配置端点 http://localhost:8080/actuator/configprops 7. 最佳实战总结 把公共的配置抽取出来放在共有的配置文件中把各个环境独有的配置信息写到独有的配置文件中 Gitlab下载地址https://gitlab.com/gb-heima/empowerment zip包下载 https://gitlab.com/gb-heima/empowerment/-/archive/master/empowerment-master.zip 下一篇 SpringBoot入门到精通_第7篇 _必知必会总结 https://blog.csdn.net/weixin_40816738/article/details/98472265
http://www.pierceye.com/news/516347/

相关文章:

  • 计算机网站维护建设深圳外网站建设
  • 贵州公明建设投资咨询有限公司官方网站小说网站开发对影成三人小说
  • 软件分享网站不一样的婚恋网站怎么做
  • 如何维护给做网站的客户公司变更名称和经营范围
  • 网站建设维护php建站最好的公司排名
  • 济南1951年建站wordpress 描述
  • 政务网站建设信息嵊州网站制作
  • 我的网站突然找不到网页了seo是啥意思
  • 黑河做网站的公司平面设计现在怎么样
  • 银川网站建站中国建设银行人力资源网站
  • 建设部考试中心网站用自己的ip怎么查看dw8建设的网站
  • 九江网站建设九江商标设计网页
  • 网站建设资格预审公告附近广告设计与制作门店电话
  • 百度权重站长工具网页制作工具哪些好用
  • 关键词整站优化公司网站店招用什么软件做的
  • 租车网站模版广州市网站建设 骏域
  • 关闭网站怎么不保存我做的更改人工智能专业
  • ui中有哪些做的好看的网站简单logo设计
  • 深圳大型网站设计公司校园 网站建设 知乎
  • 西部数码网站流量怎么充优化网站界面的工具
  • 街区网站建设东阳市住房和城乡建设局网站
  • 怎样建设网站是什么网站代码制作软件
  • 成华区微信网站建设计公司加盟
  • 找个男做那个视频网站好高端网站建设公司
  • 做网站 毕业设计广东手机网页制作
  • 沈阳口碑最好的男科医院seo排名优化什么意思
  • 光谷做网站推广价格手机网站 教程
  • 泉州做网站多少钱关键词排名快照优化
  • 威海网站建设费用网站不能调用样式
  • 网站链接建设及引流营销世界500强企业中国有几家