spring boot admin 是一款spring 家族的项目可视化监控工具,这篇文章照本宣科,跟着官网跑一下 springbootadmin
体验 spring boot admin从 官网开始
sba github: https://github.com/codecentric/spring-boot-admin

此处选择 2.0.4
然后跟着 官方教程走,
A.服务端(其实就是一个 spring boot 项目)
1.pom
de.codecentric
spring-boot-admin-starter-server
2.0.4
2.启动类
@SpringBootApplication // spring 启动注解 @EnableAdminServer public class Application { public static void main(String[] args) { SpringApplication.run( Application.class , args ); } }
B.客户端
1.pom
de.codecentric
spring-boot-admin-starter-client
2.0.4
org.springframework.boot
spring-boot-starter-security
2.application.yml配置
management: endpoints: web: exposure: include: '*' spring: boot: admin: client: url: http://127.0.0.1:7777 # 此处填写 服务端地址
url 那里填写 服务端 地址,比如说我这里的服务端是 本地的 7777 端口,那么这里就写 http://127.0.0.1:7777
3.SecurityPermitAllConfig配置
@Configuration public class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().anyRequest().permitAll() .and().csrf().disable(); } }
然后启动服务端…
直接访问 http://127.0.0.1:7777…
再启动客户端…
就会再服务端上面的页面上看见已被监控的项目
点击 Wallboard 然后点击项目,就会出现监控面板
上面信息很全,不一一介绍,有兴趣的自行百度~


发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/227313.html原文链接:https://javaforall.net
