hystrix-turbine 監控的使用


 

1.   概述

Demo地址:http://git.oschina.net/zhou666/spring-cloud-7simple/tree/master/cloud-hystrix-turbine

hystrix-turbine集成了hystrix看板和 turbine,用來監控實現了hystrix的工程項目:

 

每一個監控項目的具體解釋:

 

原本的hystrix看板只能監控一台服務器上的服務調用情況,使用了turbine后就可以監控多台服務器的情況。Turbine原理如下:

 

2.   主要配置文件

  <dependency>

      <groupId>org.springframework.boot</groupId>

      <artifactId>spring-boot-starter-web</artifactId>

  </dependency>

  <dependency>

      <groupId>org.springframework.boot</groupId>

      <artifactId>spring-boot-starter-actuator</artifactId>

  </dependency>

  <dependency>

      <groupId>org.springframework.cloud</groupId>

      <artifactId>spring-cloud-starter-hystrix</artifactId>

  </dependency>

  <dependency>

      <groupId>org.springframework.cloud</groupId>

      <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>

  </dependency>

  <dependency>

      <groupId>org.springframework.cloud</groupId>

      <artifactId>spring-cloud-starter-turbine</artifactId>   

  </dependency>

配置文件:

eureka:

  instance:

    leaseRenewalIntervalInSeconds: 10 #心跳間隔

  client:

    registerWithEureka: true #注冊本工程為服務

    fetchRegistry: true

    serviceUrl:

      defaultZone: http://localhost:8761/eureka/ #注冊服務器地址

turbine:

  aggregator:

    clusterConfig: CLOUD-SIMPLE-SERVICE  #turbine監控的服務名稱,可以多個

  appConfig: cloud-simple-service  #turbine監控的服務,可以有多個

  clusterNameExpression: metadata['cluster']

 

3.   啟動與調試

啟動應用輸入http://localhost:8989/hystrix會看到hystrix面板,在這個面板里的監控url輸入,http://localhost:8989/turbine.stream??cluster=CLOUD-SIMPLE-SERVICE,其中cluster對應配置文件中clusterConfig中的名稱。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM