从Unauthorized 401错误学习Spring Boot的Actuator
之前用Spring Boot都是别人搭好的框架,然后自己在里面写就行了。对原理、细节上都怎么涉及,毕竟需求都做不完。但是昨天一个访问RESTful接口的401问题搞了我2个小时。网上找的很多用:
managements.security.enabled=false
并且添加一个actxxx包的方法对我也不管用,因为项目里面已经配置了这个。但是我还是遇到了401的这个问题。不死心继续搜,然后加入了这个配置就好了:
security.ignored=/**
解决这个问题居然花了我两个小时,还是到处去找,不懂Spring Boot框架的原理,比如安全方面的,除了问题两眼一抹黑。
目标:弄清Spring Boot整体框架和框架中每个小块的基本知识。
Features
Create stand-alone Spring applications
Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
Provide opinionated 'starter' dependencies to simplify your build configuration
Automatically configure Spring and 3rd party libraries whenever possible
Provide production-ready features such as metrics, health checks and externalized configuration
Absolutely no code generation and no requirement for XML configuration
真的是打扰了,内容好像挺多的。
第四部分:Spring Boot Actuator: 为生产环境准备的特性
Actuator: 执行器,驱动器。当你把应用发布到生产环境的时候,Spring Boot提供了一些额外的特性来帮助你监控和管理应用。你通过选择HTTP endpoints或者JMX来管理和监控你的应用。
审计,健康和度量收集可以自动地加入到应用中。
V. Spring Boot Actuator: Production-ready features
49. Enabling Production-ready Features
50. Endpoints
50.1. Enabling Endpoints
50.2. Exposing Endpoints
50.3. Securing HTTP Endpoints
50.4. Configuring Endpoints
50.5. Hypermedia for Actuator Web Endpoints
50.6. Actuator Web Endpoint Paths
50.7. CORS Support
50.8. Implementing Custom Endpoints
50.8.1. Receiving Input
Input type conversion
50.8.2. Custom Web Endpoints
Web Endpoint Request Predicates
Path
HTTP method
Consumes
Produces
Web Endpoint Response Status
Web Endpoint Range Requests
Web Endpoint Security
50.8.3. Servlet endpoints
50.8.4. Controller endpoints
50.9. Health Information
50.9.1. Auto-configured HealthIndicators
50.9.2. Writing Custom HealthIndicators
50.9.3. Reactive Health Indicators
50.9.4. Auto-configured ReactiveHealthIndicators
50.10. Application Information
50.10.1. Auto-configured InfoContributors
50.10.2. Custom Application Information
50.10.3. Git Commit Information
50.10.4. Build Information
50.10.5. Writing Custom InfoContributors
51. Monitoring and Management over HTTP
51.1. Customizing the Management Endpoint Paths
51.2. Customizing the Management Server Port
51.3. Configuring Management-specific SSL
51.4. Customizing the Management Server Address
51.5. Disabling HTTP Endpoints
52. Monitoring and Management over JMX
52.1. Customizing MBean Names
52.2. Disabling JMX Endpoints
52.3. Using Jolokia for JMX over HTTP
52.3.1. Customizing Jolokia
52.3.2. Disabling Jolokia
53. Loggers
53.1. Configure a Logger
54. Metrics
54.1. Getting started
54.2. Supported monitoring systems
54.2.1. Atlas
54.2.2. Datadog
54.2.3. Ganglia
54.2.4. Graphite
54.2.5. Influx
54.2.6. JMX
54.2.7. New Relic
54.2.8. Prometheus
54.2.9. SignalFx
54.2.10. Simple
54.2.11. StatsD
54.2.12. Wavefront
54.3. Supported Metrics
54.3.1. Spring MVC Metrics
54.3.2. Spring WebFlux Metrics
54.3.3. RestTemplate Metrics
54.3.4. Cache Metrics
54.3.5. DataSource Metrics
54.3.6. RabbitMQ Metrics
54.4. Registering custom metrics
54.5. Customizing individual metrics
54.5.1. Per-meter properties
54.6. Metrics endpoint
55. Auditing
56. HTTP Tracing
56.1. Custom HTTP tracing
57. Process Monitoring
57.1. Extending Configuration
57.2. Programmatically
58. Cloud Foundry Support
58.1. Disabling Extended Cloud Foundry Actuator Support
58.2. Cloud Foundry Self-signed Certificates
58.3. Custom context path
59. What to Read Next
VI. Deploying Spring Boot Applications
60. Deploying to the Cloud
60.1. Cloud Foundry
60.1.1. Binding to Services
60.2. Heroku
60.3. OpenShift
60.4. Amazon Web Services (AWS)
60.4.1. AWS Elastic Beanstalk
Using the Tomcat Platform
Using the Java SE Platform
60.4.2. Summary
60.5. Boxfuse and Amazon Web Services
60.6. Google Cloud
61. Installing Spring Boot Applications
61.1. Supported Operating Systems
61.2. Unix/Linux Services
61.2.1. Installation as an init.d Service (System V)
Securing an init.d Service
61.2.2. Installation as a systemd Service
61.2.3. Customizing the Startup Script
Customizing the Start Script when It Is Written
Customizing a Script When It Runs
61.3. Microsoft Windows Services
62. What to Read Next
从Unauthorized 401错误学习Spring Boot的Actuator的更多相关文章
- Spring Boot学习——Spring Boot简介
最近工作中需要使用到Spring Boot,但是以前工作中没有用到过Spring Boot,所以需要学习下Spring Boot.本系列笔记是笔者学习Spring Boot的笔记,有错误和不足之处,请 ...
- 学习Spring Boot:(一)入门
微服务 现在微服务越来越火了,Spring Boot热度蹭蹭直升,自学下. 微服务其实是服务化思路的一种最佳实践方向,遵循SOA(面向服务的架构)的思路,各个企业在服务化治理上面的道路已经走得很远了, ...
- 学习Spring Boot:(二十六)使用 RabbitMQ 消息队列
前言 前面学习了 RabbitMQ 基础,现在主要记录下学习 Spring Boot 整合 RabbitMQ ,调用它的 API ,以及中间使用的相关功能的记录. 相关的可以去我的博客/RabbitM ...
- 学习Spring Boot:(二十五)使用 Redis 实现数据缓存
前言 由于 Ehcache 存在于单个 java 程序的进程中,无法满足多个程序分布式的情况,需要将多个服务器的缓存集中起来进行管理,需要一个缓存的寄存器,这里使用的是 Redis. 正文 当应用程序 ...
- 使用Eclipse开发学习 Spring Boot 教程的内容小结
spring-tool-suite使用教程,并创建spring配置文件 Spring Boot基础教程1-Spring Tool Suite工具的安装 Spring Boot基础教程2-RESTful ...
- 学习 Spring Boot 知识看这一篇就够了
从2016年因为工作原因开始研究 Spring Boot ,先后写了很多关于 Spring Boot 的文章,发表在技术社区.我的博客和我的公号内.粗略的统计了一下总共的文章加起来大概有六十多篇了,其 ...
- Spring Boot整合actuator实现监控管理
Spring Boot使用actuator监控管理 1.在pom文件中导入相关的依赖 <dependency> <groupId>org.springframework.boo ...
- 学习Spring Boot:(十三)配置 Shiro 权限认证
经过前面学习 Apache Shiro ,现在结合 Spring Boot 使用在项目里,进行相关配置. 正文 添加依赖 在 pom.xml 文件中添加 shiro-spring 的依赖: <d ...
- 学习 Spring Boot:(二十九)Spring Boot Junit 单元测试
前言 JUnit 是一个回归测试框架,被开发者用于实施对应用程序的单元测试,加快程序编制速度,同时提高编码的质量. JUnit 测试框架具有以下重要特性: 测试工具 测试套件 测试运行器 测试分类 了 ...
随机推荐
- android 一步一步教你集成tinker(热修复)
这几天闲着没事,就看了下现在比较火的热修复,确实有了热修复就解决了android native的一个很尴尬问题,之前比起h5,android在用户体验上是有优势,但是过于复杂的版本更新,使用户烦不胜烦 ...
- java与C++之间进行SOCKET通讯要点简要解析
原文链接: http://blog.csdn.net/hslinux/article/details/6214594 java与C++之间进行SOCKET通讯要点简要解析 hslinux 0.篇外语 ...
- Oracle in和exists效率问题分析
--------------------------in和exists效率问题------------- 单说in和exsist,in的效率较差.关于EXISTS与IN的区别:EXISTS检查是否有结 ...
- 深度学习attention 机制了解
Attention是一种用于提升基于RNN(LSTM或GRU)的Encoder + Decoder模型的效果的的机制(Mechanism),一般称为Attention Mechanism.Attent ...
- UI测试后生成测试报告,利用shell脚本上传svn
ui测试后生成测试报告,把报告保存在某一个固定路径 shell脚本把这个报告上传 #!/bin/bash -ile #svn下载文件 #svn checkout http://svn.xxx.com/ ...
- java后台list集合传值到前台,再取值的几种方法
1.在jsp页面中嵌套 java代码: 首先jsp页面中导入java的工具类 <%@ page language="java" import="java.util. ...
- php的opcode缓存
前言:由php的运行机制决定,其实php在运行阶段我们也是可以进行缓存的从而提高程序运行效率,这就是我们常说的opcode缓存.1.简述php的运行机制(因为本文是写opcode缓存的所以这里只是简要 ...
- OAuth 2.0介绍
简介 OAuth是一个关于授权(authorization)的开放网络标准,在全世界得到广泛应用,目前的版本是2.0版. 一.应用场景 为了理解OAuth的适用场合,让我举一个假设的例子. 有一个&q ...
- Unity GPU Instancing的使用尝试
似乎是在Unity5.4中开始支持GPU Instacing,但如果要比较好的使用推荐用unity5.6版本,因为这几个版本一直在改. 这里测试也是使用unity5.6.2进行测试 在5.6的版本里, ...
- Git 工具 - 凭证存储
凭证存储 如果你使用的是 SSH 方式连接远端,并且设置了一个没有口令的密钥,这样就可以在不输入用户名和密码的情况下安全地传输数据. 然而,这对 HTTP 协议来说是不可能的 —— 每一个连接都是需要 ...