admin监控
1.入門admin-server
- 依賴
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-dependencies</artifactId>
<version>${spring-boot-admin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-
开启配置和
@EnableAdminServer
-
配置文件
server:
port: 10086
spring:
application:
name: admin-server
eureka:
client:
service-url:
defaultZone: http://peer2:8761/eureka
management:
endpoints:
web:
exposure:
include: '*' # 暴露所有的监控端点 # 如果一个服务需要被监控 那么就要讲自身的一些情况(一些信息接口)暴露出去
2.入門admin-client
- 依賴
<!-- 暴露自身检查端点 endPoints 一个依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
-
配置
management: endpoints: web: exposure: include: '*'