springboot 2.0 spring boot admin 配置1

一、spring boot admin server端

1、pom.xml



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.8.RELEASE
         
    
    com.urthink.upfs
    spring-boot-admin-server
    0.0.1-SNAPSHOT
    spring-boot-admin-server
    spring-boot-admin-server project for Spring Boot

    
        1.8
        2.0.4
        Finchley.SR2
    

    

        
            org.springframework.boot
            spring-boot-starter-web
        

        
            de.codecentric
            spring-boot-admin-starter-server
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                de.codecentric
                spring-boot-admin-dependencies
                ${spring-boot-admin.version}
                pom
                import
            
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    


2、application.yml

server:
  port: 8080

spring:
  application:
    name: sba-server

3、SpringBootAdminServerApplication .java

package com.urthink.upfs.springbootadminserver;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableAdminServer
public class SpringBootAdminServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootAdminServerApplication.class, args);
    }

}

二、spring boot admin client端

1、pom.xml



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.8.RELEASE
         
    
    com.urthink.upfs
    spring-boot-admin-client
    0.0.1-SNAPSHOT
    spring-boot-admin-client
    spring-boot-admin-client project for Spring Boot

    
        1.8
        2.0.4
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        

        
            org.springframework.boot
            spring-boot-starter-actuator
        

        
            de.codecentric
            spring-boot-admin-starter-client
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                de.codecentric
                spring-boot-admin-dependencies
                ${spring-boot-admin.version}
                pom
                import
            
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    


2、application.yml

server:
  port: 8081

spring:
  application:
    name: sba-client
  boot:
    admin:
      client:
        url: http://localhost:8080
        #username: username #sba-server配置的用户名
        #password: password #sba-server配置的密码

# 开启监控接口
management:
  endpoints:
    web:
      exposure:
        include: "*"

3、SpringBootAdminClientApplication.java

package com.urthink.upfs.springbootadminclient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootAdminClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootAdminClientApplication.class, args);
    }

}

三、访问http://localhost:8080

1.这个可以配置带登录页的

springboot 2.0 spring boot admin 配置1_第1张图片

2. 点击空白处springboot 2.0 spring boot admin 配置1_第2张图片

3.

springboot 2.0 spring boot admin 配置1_第3张图片

 

springboot 2.0 spring boot admin 配置2,登录配置,连接eureka,监控spring cloud client
https://blog.csdn.net/haveqing/article/details/86545761

参考:

官方文档
http://codecentric.github.io/spring-boot-admin/current/

Spring Boot Admin 详解(Spring Boot 2.0,基于 Eureka 的实现)
https://blog.csdn.net/hubo_88/article/details/80671192
SpringBoot2.x搭建SpringBootAdmin2.x
https://www.cnblogs.com/anxminise/p/9795787.html
SpringCloud2.0入门4-springboot-admin监控
https://www.cnblogs.com/woshimrf/p/springcloud2-admin.html

 

你可能感兴趣的:(springboot)