(前提,你这个项目已经搭建好了可以在注册中心注册成功了)
1、添加引用
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>
2、启动项就加上
@EnableTurbine
@EnableHystrixDashboard
3、application ,turbine.appConfig 跟上你服务提供者 的名称,还有监控对象白名单
turbine.appConfig=EUREKA-CLIENT,EUREKA-CLIENT2
turbine.clusterNameExpression=new String("default")
hystrix.dashboard.proxy-stream-allow-list=localhost
4、访问http://localhost:7031/hystrix,(7031就是你这个熔断集群 监控项目的端口)
在地址栏填上
http://localhost:7031/turbine.stream?cluster=default
最后点击按钮就行了