spring-boot-actuator

来源:互联网 发布:eos m5 评价相机知乎 编辑:程序博客网 时间:2024/06/05 03:59

开启 actuator 并且为 actuator url 命令 添加 认证。

在pom.xml中添加这些个依赖:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency>


application.properties 增加配置如下:

server.port = 8080# 禁止 应用的 securitysecurity.basic.enabled=false#security.basic.path=/adminsecurity.user.name=rootsecurity.user.password=123# health powerendpoints.health.sensitive = false#启用shutdownendpoints.shutdown.enabled=true# management url : e.g. [/env, /dump, ...] refer to document for more detailsmanagement.port = 8081# /env ==> /manage/env#management.contextPath=/manage# security = 安全management.security.enabled = truemanagement.security.role=ADMIN

拿去玩吧。


http://www.jianshu.com/p/b0b40038bb93点击打开链接


http://rensanning.iteye.com/blog/2363526点击打开链接


http://blog.csdn.net/clementad/article/details/52045495点击打开链接


http://www.cnblogs.com/lobo/p/5657684.html点击打开链接