1. 概述

  1. 打开 Spring Boot Actuator 的 Web 访问

2. 场景

  1. 之前看 Spring 的时候, 曾经想了解当时的配置
  2. 后来发现, 确实有这么个工具
  3. 刚开始发现, 除了 actuator, 别的也看不了什么

3. 环境

  1. os

    1. win10
  2. jdk

    1. 1.8
  3. ide

    1. ida 2018.1
  4. spring

    1. spring boot

      1. 2.0.4 release
    2. 组件
      1. thymeleaf
      2. starter-web
      3. devtool
      4. starter-test
      5. actuator
  5. browser

    1. firefox

      1. 70.0
  6. ref

    1. spring boot in action

4. 问题

  1. 参考书

    1. ref

      1. spring boot in action
    2. 书上说

      1. 书上列了一堆 url

        1. 感觉可以看很多事
  2. 问题

    1. 我试了一圈, 就 3 个 url 能用

      1. \actuator
      2. \health
      3. \info
  3. 但是书上给我的感觉, 好像都是配上就好了

    1. 也不知道为啥
    2. 又要开始找开关

5. 解决

  1. 尝试找 官方文档

    1. 找到了 api

      1. ref

        1. Spring Boot Actuator: Production-ready features
    2. 看到了 清一色的 Yes

      1. 我陷入了沉思

        1. 为啥我就脸黑老是
  2. 再往下看

    1. 发现了另一个表格

      1. 发现 yes 的都是 jmx
      2. 而 web 那块, 又都是 清一色的 no
    2. 好了, 确认是配置没开

      1. 那到底怎么打开呢

6. 开关

  1. 配置

    management.endpoints.web.exposure.include=*
  2. 重启

  3. 结果

    1. 管理 url 都可以访问了

7. 其他

  1. actuator 的访问方式

    1. jmx
    2. web
  2. enable 和 expose

    1. 概述

      1. 这俩概念, 我一开始搞混了
    2. enable

      1. 解释

        1. 开启

          1. 开启, 是 jmx 和 web 访问的前提
    3. expose

      1. 解释

        1. 暴露

          1. 需要开启
          2. 只有暴露对应方式, 才可以访问
      2. exclude 和 include
        1. exclude

          1. 排除特定的 url
        2. include
          1. 开启特定的 url
  3. 配置

    1. 默认配置

      # 结合官方文档上面的表格, 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
    2. 配置

      1. 思路

        1. 文档上解释的, 是 exclude 优先
        2. 但是实际上看起来, 是 后面的配置, 会覆盖前面的配置
      2. 具体的配置, 我也不细说了

ps

  1. ref

    1. Spring Boot & Actuator
  2. 其他

    1. 感觉这玩意, 功能还很多, 以后可以仔细学学

Spring - Spring Boot - Actuator Web 访问开启的更多相关文章

  1. 使用 Spring Boot Actuator 构建 RESTful Web 应用

    Spring Boot Actuator 是 Spring Boot 的一个子项目.通过它,可以很轻易地为应用提供多种生产级服务.本教程中,你将通过构建一个应用来学习如何添加这些服务. 1. 你需要构 ...

  2. SpringBoot实战(十)之使用Spring Boot Actuator构建RESTful Web服务

    一.导入依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http ...

  3. Spring Boot Actuator未授权访问

    当我们发现某一个网页的logo是一篇叶子或者报错信息如下图所示的话,就可以尝试Spring Boot Actuator未授权访问. /dump - 显示线程转储(包括堆栈跟踪) /autoconfig ...

  4. springboot(十九):使用Spring Boot Actuator监控应用

    微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题? ...

  5. spring boot actuator专题

    spring-boot-starter-actuator模块的实现对于实施微服务的中小团队来说,可以有效地减少监控系统在采集应用指标时的开发量.当然,它也并不是万能的,有时候我们也需要对其做一些简单的 ...

  6. (转)Spring Boot (十九):使用 Spring Boot Actuator 监控应用

    http://www.ityouknow.com/springboot/2018/02/06/spring-boot-actuator.html 微服务的特点决定了功能模块的部署是分布式的,大部分功能 ...

  7. 朱晔和你聊Spring系列S1E7:简单好用的Spring Boot Actuator

    阅读PDF版本 本文会来看一下Spring Boot Actuator提供给我们的监控端点Endpoint.健康检查Health和打点指标Metrics等所谓的Production-ready(生产环 ...

  8. Spring Boot Actuator监控应用

    微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题? ...

  9. spring Boot(十九):使用Spring Boot Actuator监控应用

    spring Boot(十九):使用Spring Boot Actuator监控应用 微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台 ...

随机推荐

  1. LED Holiday Light -holiday Light Inspection Implementation Recommendations

    China LED Holiday Light Factory & Ninghai County Haohua Electronic Appliance Co., Ltd. pointed o ...

  2. wso2 使用配置

    1.下载wso2 https://docs.wso2.com 2.配置 https://172.10.0.59:9443/publisher https://172.10.0.59:9443/carb ...

  3. jave的安装

    1.此电脑-属性-高级系统设置-环境变量2.点下面那个 新建-  JAVA_HOME3. 双击PATH变量,新建一个参数 4.新建CLASSPATH环境变量

  4. Python RSA

    # -*- coding: utf-8 -*- from Crypto import Random from Crypto.Hash import SHA from Crypto.Cipher imp ...

  5. 浅析State-Thread

    State-Thread(以下简称st),是一个由C语言编写的小巧.简洁却高效的开源协程库.这个库基于单线程运作.不强制占用用户线程,给予了开发者最大程度的轻量级和较低的侵入性.本篇文章中,网易云信音 ...

  6. 【HTML】iframe嵌套界面自适应,可高度自由收缩

    最近在做网页时需要使iframe高度自适应,以提高用户体验,网上找了挺多都很复杂,最后找到了这个 HTML: <div class="main_page"> <i ...

  7. K3修改字段名

    在K3的BOS中,自定义字段之后我们往往会修改字段名,便于记忆和理解,但是修改字段名之后,只是数据库中的字段名被修改了,BOS中的字段标识并没有被修改,可以通过以下语句将标识和字段名改成一致. sel ...

  8. layer iframe 设置关闭按钮 和刷新和弹出框设置

    layer弹出层的关闭问题   就是在执行添加或修改的时候,需要将数据提交到后台进行处理,这时候添加成功之后最理想的状态是关闭弹出层并且刷新列表的数据信息,之前一直想实现这样,可一直没有成功,今天决定 ...

  9. Apache NIFI

    Add a.password file to chrome. Settings -> Advanced -> Security -> Manage Certificates -> ...

  10. 搭建Hexo实现个人网站详细教程

    全网最全小白搭建Hexo+Gitee/Coding/Github 全网最全小白搭建Hexo+Gitee/Coding/Github 本站内容已全部转移到https://www.myyuns.ltd,具 ...