目录
[服务端 server](#服务端 server)
基本操作流程:
服务端 server
0.创建一个springboot项目
1.导入依赖
XML
<!--添加spring web依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--监控-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>2.5.4</version>
</dependency>
2.添加配置信息
在application.yml配置文件中添加配置信息,端口号自己设定,注意不要冲突了
XML
server:
port: 1823
3.在启动类添加注解

4.运行
运行该启动类,在浏览器访问(端口号写自己设定的) http://localhost:1823

客户端client
1.添加依赖
在一个springboot项目中添加两个必要的依赖
XML
<!--添加spring web依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--监控-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.5.4</version>
</dependency>
2.添加配置信息
在application.yml配置文件中添加配置信息,端口号自己设定,注意不要冲突了
XML
server:
port: 8080
spring:
boot:
admin:
client:
url: http://localhost:1823
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: "*"
3.运行
运行该启动类
可以在http://localhost:1823页面看到


学习视频链接:实用开发篇-133-SpringBootAdmin_哔哩哔哩_bilibili
