- 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
- 配置
server:
port: 8000
spring:
security:
user:
name: admin
password: admin
- 被监控的服务端也要配置上监控中心的账号密码
boot:
admin:
client:
url: http://localhost:8000
username: admin
password: admin
instance:
prefer-ip: true
service-url: http://localhost:8088