• 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即可~

  • 相关阅读:
    Flexbox兼容性
    响应式布局(Responsive Layout)/流式布局(Fluid Layout)/自适应布局(Adaptive)
    Flex布局之box-flex
    Flex布局(伸缩盒布局)
    input美化问题
    用纯css改变下拉列表select框的默认样式
    超越icon font
    CSS居中之美
    php中yaf框架的服务器配置
    MySQL优化
  • 原文地址:https://www.cnblogs.com/douJiangYouTiao888/p/9252799.html
Copyright © 2020-2023  润新知