改進spring boot新增監控
阿新 • • 發佈:2018-11-12
伺服器端
- 在啟動類上新增
@EnableAdminServer
@SpringBootApplication
- 在pom.xml上新增
<dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server</artifactId> <version>1.5.7</version> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server-ui</artifactId> <version>1.5.7</version> </dependency>
客戶端
- 在application.properties中新增
spring.boot.admin.url=http://localhost:8080
spring.application.name=spring-boot-admin-client
#禁用安全控制
management.security.enabled=false
2.在pom.xml
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.7</version>
</dependency>