从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 测试框架具有以下重要特性: 测试工具 测试套件 测试运行器 测试分类 了 ...
随机推荐
- 第一篇:初识ASP.NET控件开发_第三节:“生死有序”的控件生命周期
一.Page本质是一个Control 我们首先要澄清的第一个概念是页面类Page本质是一个控件类,它派生于TemplateControl类,而TemplateControl派生自Control类.既然 ...
- tomcat jvm 参数优化
1. 内存设置 常见配置汇总 堆设置 -Xms:初始堆大小 -Xmx:最大堆大小 -XX:NewSize=n:设置年轻代大小 -XX:NewRatio=n:设置年轻代和年老代的比值.如:为3,表示年轻 ...
- 中控考勤机SDK使用中员工姓名的处理( c# )
公司使用的考勤机是中控的指纹考勤机,但是中控的型号乱七八糟,通过程序读出来的型号和实际标的型号不一致. 另外,提供的开发包的C#版本的Demo中调用 axCZKEM1.ReadAllUserID(iM ...
- eclipse创建activiti6 项目demo
1 新建maven 项目 2 修改 pom 文件,完整内容如下 <?xml version="1.0" encoding="UTF-8"?> < ...
- django shortcuts 详解
django中为了方便web的开发.定义了许多有用的shortcut .由于shortcut带来的方便用文字描述是有点苍白的.所以在这里打算用一些例子来说明 一.一个hello world 的例子: ...
- go环境变量配置 (GOROOT和GOPATH)
GOROOT就是go的安装路径在~/.bash_profile中添加下面语句: GOROOT=/usr/local/go export GOROOT 当然, 要执行go命令和go工具, 就要配置go的 ...
- ${HADOOP_CONF_DIR:-$HADOOP_PREFIX/$DEFAULT_CONF_DIR}
在hadoop-config.sh中,有如下语句:${HADOOP_CONF_DIR:-$HADOOP_PREFIX/$DEFAULT_CONF_DIR} ...
- logstash 的 配置文件
[root@--- etc]# cat test_front_console.conf input { beats { type => beats port => } } filter { ...
- SpringBoot不使用模板引擎直接返回html
一.在resource目录下面建立文件夹,里面方静态页面. 路径:src\main\resources\static\page\index.html 访问:http://localhost:8080/ ...
- css遮罩层
父元素:position:fixed; 让子元素居中对齐:position:absolute;top:0;bottom:0;left:0;right:0;margin:auto; <style& ...