SpringCloud (IV). Fuse monitoring Hystrix Dashboard and Turbine

    Hystrix-Dashboard is a monitoring Hystrix state of a tool that can show information fuse time, response speed, can only display information about an application, if you want to see the entire system data for multiple services, you need to use tools Turbine .

   (A) Configuration Hystrix-Dashboard (transformation on the basis of a fuse)

    1. Add dependence 

<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.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

   2. Profiles

   Add @EnableHystrixDashboard and @EnableCircuitBreaker comment on 3. Start class

   4. Enter http: // localhost: 9015 / hystrix, it will show the following interface:

   

  

  

    The meaning of the text: View cluster using the default address format of the first item, check the specified cluster use the second format parameter specifies the name of cluster cluster, and the third is a separate application, type  http: // localhost: 9015 /hystrix.stream , click Monitor Stream, will continue to display Loading, when the Customer initiates a request to the interface, you will see the following figure:

   

 

  (B) Configuration Turbine

      1. Add dependence    

<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-turbine</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-turbine</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-dashboard</artifactId>
</dependency>

    2. modify the configuration file

spring.application.name=hystrix-dashboard-turbine
server.port=8001
turbine.appConfig=node01,node02
turbine.aggregator.clusterConfig= default
turbine.clusterNameExpression= new String("default")
eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/

among them

Guess you like

Origin www.cnblogs.com/hs5201314tx/p/11520784.html