一、介绍
二、步骤
(1)依赖
<dependencies>
<dependency>
<groupId>cn.qqqking.springcloud</groupId>
<artifactId>microservice-cloud-02-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--hystrix 与 dashboard-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
</dependencies>
(2)端口配置
server:
port: 9001
(3)启动类
@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboard_9001 {
public static void main(String[] args) {
SpringApplication.run(HystrixDashboard_9001.class,args);
}
}
(4)被监控生产者
management:
endpoints:
web:
exposure:
include: hystrix.stream