springboot admin configuration

@Configuration
@EnableAutoConfiguration
@EnableAdminServer

 1. Use idea to create a new springboot project, and modify pom.xml to add admin dependencies

 

 

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server</artifactId>
            <version>1.5.6</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server-ui</artifactId>
            <version>1.5.6</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>1.5.6</version>
        </dependency>

 

 

 Note: The high version of springboot may not be supported, so a stable version can be used

 

 2. Modify the springboot startup configuration file application.properties/ application.yml file and add the configuration (where the port can be used by yourself

 configuration)

 

  

server.port=8081
management.security.enabled=false
spring.boot.admin.url=http://localhost:8081/

 

 

3. Add the startup admin annotation to the startup class

@Configuration
@EnableAutoConfiguration
@EnableAdminServer

 

 4. Start the function, if the display is as follows, it means success, then copy the address under the picture and enter it in the browser, then the admin configuration information can be displayed

   

 

  Browser input, springboot-admin displays the result:

 

 

 

 

 

 

 

 

 

Source address: https://gitee.com/chui0704/springboot.git

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326000444&siteId=291194637