spring cloud turbine

 

参考博客:http://www.ityouknow.com/springcloud/2017/05/18/hystrix-dashboard-turbine.html

 

spring boot版本:2.0.3.RELEASE

 

pom.xml

<dependency>            
  <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-turbine</artifactId> </dependency> <!-- hystrix --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependency> <!-- Hystrix-dashboard熔断器监控工具 --> <dependency>   <groupId>org.springframework.cloud</groupId>   <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId> </dependency> <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-test</artifactId>   <scope>test</scope> </dependency>

 

application.yml

spring:
  application:
    name: spring-cloud-turbine-wly
server:
  port: 8082
turbine:
  # 被监控服务的spring.application.name
  app-config: spring-cloud-consumer
  aggregator:
    cluster-config: default
  cluster-name-expression: new String("default")
  instanceUrlSuffix: hystrix.stream
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8765/eureka

 

启动类

package com.wang.turbine;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;

@SpringBootApplication
@EnableHystrixDashboard
@EnableTurbine
public class TurbineApplication {

    public static void main(String[] args) {
        SpringApplication.run(TurbineApplication.class, args);
    }
}

 

访问服务

http://localhost:8082/hystrix

输入http://localhost:8082/turbine.stream,点击monitor stream,如下图

 

效果

测试项目代码

eureka:https://gitee.com/wlyfree/eurekaserver

provider:https://gitee.com/wlyfree/eurekaprovider(可以不下)

consumer:https://gitee.com/wlyfree/eurekaconsumer

turbine:https://gitee.com/wlyfree/turbine

使用

下载后依次启动eureka、provider、consumer、turbine即可~

转载于:https://www.cnblogs.com/douJiangYouTiao888/p/9252799.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值