安装admin server

首先,需要设置您的服务器。要做到这一点,只需设置一个简单的Spring Boot项目(使用start.spring.io来开始一个例子是个不错的选择)。

  1. 添加相关依赖

pom.xml

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

2.在你的配置中添加@EnableAdminServer

@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class SpringBootAdminApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootAdminApplication.class, args);
    }
}

如果您想通过部署在servlet容器中的部署来安装Spring Boot Admin服务器,请查看spring-boot-admin-sample-war

results matching ""

    No results matching ""