Spring - Spring Boot - Actuator Web 访问开启
1. 概述
- 打开 Spring Boot Actuator 的 Web 访问
2. 场景
- 之前看 Spring 的时候, 曾经想了解当时的配置
- 后来发现, 确实有这么个工具
- 刚开始发现, 除了 actuator, 别的也看不了什么
3. 环境
os
- win10
jdk
- 1.8
ide
- ida 2018.1
spring
- spring boot
- 2.0.4 release
- 组件
- thymeleaf
- starter-web
- devtool
- starter-test
- actuator
- spring boot
browser
- firefox
- 70.0
- firefox
ref
- spring boot in action
4. 问题
参考书
ref
- spring boot in action
书上说
- 书上列了一堆 url
- 感觉可以看很多事
- 书上列了一堆 url
问题
- 我试了一圈, 就 3 个 url 能用
- \actuator
- \health
- \info
- 我试了一圈, 就 3 个 url 能用
但是书上给我的感觉, 好像都是配上就好了
- 也不知道为啥
- 又要开始找开关
5. 解决
尝试找 官方文档
找到了 api
看到了 清一色的 Yes
- 我陷入了沉思
- 为啥我就脸黑老是
- 我陷入了沉思
再往下看
发现了另一个表格
- 发现 yes 的都是 jmx
- 而 web 那块, 又都是 清一色的 no
好了, 确认是配置没开
- 那到底怎么打开呢
6. 开关
配置
management.endpoints.web.exposure.include=*
重启
结果
- 管理 url 都可以访问了
7. 其他
actuator 的访问方式
- jmx
- web
enable 和 expose
概述
- 这俩概念, 我一开始搞混了
enable
- 解释
- 开启
- 开启, 是 jmx 和 web 访问的前提
- 开启
- 解释
expose
- 解释
- 暴露
- 需要开启
- 只有暴露对应方式, 才可以访问
- 暴露
- exclude 和 include
- exclude
- 排除特定的 url
- include
- 开启特定的 url
- exclude
- 解释
配置
默认配置
# 结合官方文档上面的表格, jmx 确实全开, web 确实只开了 info 和 health
management.endpoints.jmx.exposure.exclude=*
management.endpoints.jmx.exposure.include=*
management.endpoints.web.exposure.exclude=*
management.endpoints.web.exposure.include=info, health
配置
- 思路
- 文档上解释的, 是 exclude 优先
- 但是实际上看起来, 是 后面的配置, 会覆盖前面的配置
- 具体的配置, 我也不细说了
- 思路
ps
ref
其他
- 感觉这玩意, 功能还很多, 以后可以仔细学学
Spring - Spring Boot - Actuator Web 访问开启的更多相关文章
- 使用 Spring Boot Actuator 构建 RESTful Web 应用
Spring Boot Actuator 是 Spring Boot 的一个子项目.通过它,可以很轻易地为应用提供多种生产级服务.本教程中,你将通过构建一个应用来学习如何添加这些服务. 1. 你需要构 ...
- SpringBoot实战(十)之使用Spring Boot Actuator构建RESTful Web服务
一.导入依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http ...
- Spring Boot Actuator未授权访问
当我们发现某一个网页的logo是一篇叶子或者报错信息如下图所示的话,就可以尝试Spring Boot Actuator未授权访问. /dump - 显示线程转储(包括堆栈跟踪) /autoconfig ...
- springboot(十九):使用Spring Boot Actuator监控应用
微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题? ...
- spring boot actuator专题
spring-boot-starter-actuator模块的实现对于实施微服务的中小团队来说,可以有效地减少监控系统在采集应用指标时的开发量.当然,它也并不是万能的,有时候我们也需要对其做一些简单的 ...
- (转)Spring Boot (十九):使用 Spring Boot Actuator 监控应用
http://www.ityouknow.com/springboot/2018/02/06/spring-boot-actuator.html 微服务的特点决定了功能模块的部署是分布式的,大部分功能 ...
- 朱晔和你聊Spring系列S1E7:简单好用的Spring Boot Actuator
阅读PDF版本 本文会来看一下Spring Boot Actuator提供给我们的监控端点Endpoint.健康检查Health和打点指标Metrics等所谓的Production-ready(生产环 ...
- Spring Boot Actuator监控应用
微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题? ...
- spring Boot(十九):使用Spring Boot Actuator监控应用
spring Boot(十九):使用Spring Boot Actuator监控应用 微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台 ...
随机推荐
- 记录 Docker 的学习过程 (网络篇之跨主机互通)
下面从node3上操作node3# docker run -d -p 8500:8500 --name consul progrium/consul -server -bootstrap node3# ...
- K3/cloud执行计划插件示例
public class AutoCheckInventory : IScheduleService { /// <summary> /// 实际运行的Run 方法 ...
- jsp中引用的jstl 和fmt标签-详解
JSTL 核心标签库标签共有13个,功能上分为4类: 1.表达式控制标签:out.set.remove.catch 2.流程控制标签:if.choose.when.otherwise 3.循环标签:f ...
- Linux环境C语言斐波拉切数列(1,1,2,3,5,8,13,.........)实现
斐波那契数列(Fibonacci sequence),又称黄金分割数列.因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子数列”,指的是这样一 ...
- vs code使用指南
https://blog.csdn.net/weixin_45601379/article/details/100550421
- 使用PHP链接MySQL
一.使用PHP查询MySQL数据库: 1.通过PHP来访问MySQL的步骤是: 连接到MySQL 选择操作的数据库 创建查询的字段 执行查询的语句 检索出结果并在网页上显示 断开与MySQL的连接 我 ...
- python面试的100题(15)
41.super函数的具体用法和场景 为了调用父类(超类)的一个方法,可以使用 super() 函数,比如: class A: def spam(self): print('A.spam') clas ...
- 浅析State-Thread
State-Thread(以下简称st),是一个由C语言编写的小巧.简洁却高效的开源协程库.这个库基于单线程运作.不强制占用用户线程,给予了开发者最大程度的轻量级和较低的侵入性.本篇文章中,网易云信音 ...
- 【Python】循环的拓展
- Linux oracle安装 内核参数讲解
在安装Oracle的时候需要调整linux的内核参数,但是各参数代表什么含义呢,下面做详细解析. Linux安装文档中给出的最小值: fs.aio-max-nr = 1048576 fs.file-m ...