- pom文件引入client的起步依赖和web的起步依赖
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
- 在工程的配置文件application.yml中配置应用名和端口信息,以及向server注册的地址为http://localhost:8800,最后暴露自己的actuator的所有端口信息
spring:
application:
name: client
boot:
admin:
client:
url: http://192.168.2.9:8800
instance:
service-url: http://192.168.2.9:${server.port}
server:
port: 8768
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
- 启动 server 和 client 后在 server 内查看信息
: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in
评论