從Unauthorized 401錯誤學習Spring Boot的Actuator

 

以前用Spring Boot都是別人搭好的框架,而後本身在裏面寫就好了。對原理、細節上都怎麼涉及,畢竟需求都作不完。可是昨天一個訪問RESTful接口的401問題搞了我2個小時。網上找的不少用:安全

1 managements.security.enabled=false

而且添加一個actxxx包的方法對我也無論用,由於項目裏面已經配置了這個。可是我仍是遇到了401的這個問題。不死心繼續搜,而後加入了這個配置就行了:app

1 security.ignored=/**

解決這個問題竟然花了我兩個小時,仍是處處去找,不懂Spring Boot框架的原理,好比安全方面的,除了問題兩眼一抹黑。框架

目標:弄清Spring Boot總體框架和框架中每一個小塊的基本知識。ide

Features

  • Create stand-alone Spring applicationsui

  • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)spa

  • Provide opinionated 'starter' dependencies to simplify your build configurationcode

  • Automatically configure Spring and 3rd party libraries whenever possibleorm

  • Provide production-ready features such as metrics, health checks and externalized configurationblog

  • 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 features49. Enabling Production-ready Features50. Endpoints50.1. Enabling Endpoints50.2. Exposing Endpoints50.3. Securing HTTP Endpoints50.4. Configuring Endpoints50.5. Hypermedia for Actuator Web Endpoints50.6. Actuator Web Endpoint Paths50.7. CORS Support50.8. Implementing Custom Endpoints50.8.1. Receiving InputInput type conversion50.8.2. Custom Web EndpointsWeb Endpoint Request PredicatesPathHTTP methodConsumesProducesWeb Endpoint Response StatusWeb Endpoint Range RequestsWeb Endpoint Security50.8.3. Servlet endpoints50.8.4. Controller endpoints50.9. Health Information50.9.1. Auto-configured HealthIndicators50.9.2. Writing Custom HealthIndicators50.9.3. Reactive Health Indicators50.9.4. Auto-configured ReactiveHealthIndicators50.10. Application Information50.10.1. Auto-configured InfoContributors50.10.2. Custom Application Information50.10.3. Git Commit Information50.10.4. Build Information50.10.5. Writing Custom InfoContributors51. Monitoring and Management over HTTP51.1. Customizing the Management Endpoint Paths51.2. Customizing the Management Server Port51.3. Configuring Management-specific SSL51.4. Customizing the Management Server Address51.5. Disabling HTTP Endpoints52. Monitoring and Management over JMX52.1. Customizing MBean Names52.2. Disabling JMX Endpoints52.3. Using Jolokia for JMX over HTTP52.3.1. Customizing Jolokia52.3.2. Disabling Jolokia53. Loggers53.1. Configure a Logger54. Metrics54.1. Getting started54.2. Supported monitoring systems54.2.1. Atlas54.2.2. Datadog54.2.3. Ganglia54.2.4. Graphite54.2.5. Influx54.2.6. JMX54.2.7. New Relic54.2.8. Prometheus54.2.9. SignalFx54.2.10. Simple54.2.11. StatsD54.2.12. Wavefront54.3. Supported Metrics54.3.1. Spring MVC Metrics54.3.2. Spring WebFlux Metrics54.3.3. RestTemplate Metrics54.3.4. Cache Metrics54.3.5. DataSource Metrics54.3.6. RabbitMQ Metrics54.4. Registering custom metrics54.5. Customizing individual metrics54.5.1. Per-meter properties54.6. Metrics endpoint55. Auditing56. HTTP Tracing56.1. Custom HTTP tracing57. Process Monitoring57.1. Extending Configuration57.2. Programmatically58. Cloud Foundry Support58.1. Disabling Extended Cloud Foundry Actuator Support58.2. Cloud Foundry Self-signed Certificates58.3. Custom context path59. What to Read NextVI. Deploying Spring Boot Applications60. Deploying to the Cloud60.1. Cloud Foundry60.1.1. Binding to Services60.2. Heroku60.3. OpenShift60.4. Amazon Web Services (AWS)60.4.1. AWS Elastic BeanstalkUsing the Tomcat PlatformUsing the Java SE Platform60.4.2. Summary60.5. Boxfuse and Amazon Web Services60.6. Google Cloud61. Installing Spring Boot Applications61.1. Supported Operating Systems61.2. Unix/Linux Services61.2.1. Installation as an init.d Service (System V)Securing an init.d Service61.2.2. Installation as a systemd Service61.2.3. Customizing the Startup ScriptCustomizing the Start Script when It Is WrittenCustomizing a Script When It Runs61.3. Microsoft Windows Services62. What to Read Next

相關文章
相關標籤/搜索