1、启动基础工程

1.1、启动【服务中心】集群,工程名称:springcloud-eureka-server

1.2、启动【服务提供者】集群,工程名称:springcloud-eureka-client

1.3、启动【服务消费者】,工程名称:springcloud-eureka-ribbon

1.4、启动【服务消费者】,工程名称:springcloud-eureka-feign

1.5、启动【断路器仪表看板】,工程名称:springcloud-eureka-hystrix-dashboard

2、创建【断路器集群监控】,即 Eureka Turbine

2.1、新建 Spring Boot 工程,工程名称:springcloud-eureka-turbine

2.2、工程 pom.xml 文件添加如下依赖:

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-actuator</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-web</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>org.springframework.cloud</groupId>
  11. <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  12. </dependency>
  13. <dependency>
  14. <groupId>org.springframework.cloud</groupId>
  15. <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
  16. </dependency>

2.3、在工程启动类中,添加注解 @EnableTurbine

  1. package com.miniooc.eurekaturbine;
  2.  
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.cloud.netflix.turbine.EnableTurbine;
  6.  
  7. /**
  8. * EurekaTurbineApplication
  9. *
  10. * @author 宋陆
  11. * @version 1.0.0
  12. */
  13. @EnableTurbine
  14. @SpringBootApplication
  15. public class EurekaTurbineApplication {
  16.  
  17. public static void main(String[] args) {
  18. SpringApplication.run(EurekaTurbineApplication.class, args);
  19. }
  20.  
  21. }

2.4、新建工程配置文件 application.yml ,配置内容:

  1. server:
  2. port: 52640
  3.  
  4. spring:
  5. application:
  6. name: eureka-turbine
  7.  
  8. eureka:
  9. instance:
  10. hostname: localhost
  11. # 表示eureka client间隔多久去拉取服务注册信息,默认为30秒,如果要迅速获取服务注册状态,可以缩小该值
  12. lease-renewal-interval-in-seconds: 5
  13. # 表示eureka server至上一次收到client的心跳之后,等待下一次心跳的超时时间,在这个时间内若没收到下一次心跳,则将移除该instance。
  14. # 默认为90秒
  15. # 如果该值太大,则很可能将流量转发过去的时候,该instance已经不存活了。
  16. # 如果该值设置太小了,则instance则很可能因为临时的网络抖动而被摘除掉。
  17. # 该值至少应该大于 leaseRenewalIntervalInSeconds
  18. lease-expiration-duration-in-seconds: 10
  19. client:
  20. serviceUrl:
  21. defaultZone: http://localhost:9527/eureka/,http://localhost:9528/eureka/,http://localhost:9529/eureka/
  22.  
  23. turbine:
  24. app-config: eureka-discovery-ribbon, eureka-discovery-feign
  25. aggregator:
  26. cluster-config: default
  27. cluster-name-expression: new String("default")
  28. #更改turbine连接的默认uri ,默认为actuator/hystrix.stream
  29. instanceUrlSuffix: hystrix.stream

2.5、启动【断路器集群监控】工程

2.6、打开浏览器,访问 http://localhost:52630/hystrix

2.7、监控地址输入 http://localhost:52640/turbine.stream 来监控 springcloud-eureka-turbine 服务,点击【Monitor Stream】按钮,开启断路器指标看板

如果出现 Loading... 状态,只要请求一下 http://localhost:52610/ribbonInfo,http://localhost:52620/feignInfo,就可以看到数据指标了。

至此,我们简单实现了【断路器集群监控】,即同时监控了springcloud-eureka-ribbon, springcloud-eureka-feign两个服务

SpringCloud2.0 Turbine 断路器集群监控 基础教程(九)的更多相关文章

  1. 改造断路器集群监控Hystrix Turbine实现自动注册消费者、实时监控多个服务

    在上一篇文章中,我们搭建了Hystrix Dashoard,对指定接口进行监控.但是只能对一个接口进行监听,功能比较局限: Turbine:汇总系统内多个服务的数据并显示到 Hystrix Dashb ...

  2. Spring Cloud :断路器集群监控(Turbine)

    一. 简介      上一篇文章我们已经实现了对单个服务实例的监控,当然在实际应用中,单个实例的监控数据没有多大的价值,我们更需要的是一个集群系统的监控信息,这时我们就需要引入Turbine.Turb ...

  3. Turbine——Hystrix集群监控

    上一篇文章讲述了如何利用Hystrix Dashboard去监控断路器的Hystrix command.当我们有很多个服务的时候,这就需要聚合所有服务的Hystrix Dashboard的数据了.这就 ...

  4. Redis3.0.7 cluster/集群 安装配置教程

    1.前言 环境:CentOS-6.7-i386-LiveDVD 安装的CentOs系统 节点: 6个节点,3个主节点.3个从节点(由于redis默认需要3个主节点,如果想每个主节点有一个从节点,这是最 ...

  5. Spring Cloud项目之断路器集群监控Hystrix Dashboard

    微服务(Microservices Architecture)是一种架构风格,一个大型复杂软件应用由一个或多个微服务组成.系统中的各个微服务可被独立部署,各个微服务之间是松耦合的.每个微服务仅关注于完 ...

  6. Spring Cloud第八篇 | Hystrix集群监控Turbine

    ​ 本文是Spring Cloud专栏的第八篇文章,了解前七篇文章内容有助于更好的理解本文: Spring Cloud第一篇 | Spring Cloud前言及其常用组件介绍概览 Spring Clo ...

  7. 断路器Hystrix与Turbine集群监控-Spring Cloud学习第三天(非原创)

    文章大纲 一.Hystrix基础介绍二.断路器Hystrix简单使用三.自定义Hystrix请求命令四.Hystrix的服务降级与异常处理五.Hystrix的请求缓存与请求合并六.Hystrix仪表盘 ...

  8. 服务容错保护断路器Hystrix之四:断路器监控(Hystrix Dashboard)-turbine集群监控

    turbine 英[ˈtɜ:baɪn] n. 汽轮机; 涡轮机; 透平机; OK,上文我们看了一个监控单体应用的例子,在实际应用中,我们要监控的应用往往是一个集群,这个时候我们就得采取Turbine集 ...

  9. Spring Cloud Hystrix Dashboard熔断器-Turbine集群监控(六)

    序言 上一篇说啦hystrix的使用方法与配置还有工作流程及为何存在,我去,上一篇这么屌,去看看吧,没这么屌的话,我贴的有官方文档,好好仔细看看 hystrix除啦基本的熔断器功能之外,还可以对接口的 ...

随机推荐

  1. centos7.3部署memcached服务

    我们需要下载libevent和memcached这两个压缩包进行安装,可使用以下百度网盘链接进行下载 链接:https://pan.baidu.com/s/1vehZ5odzXFKwNjWT9_W0T ...

  2. [LeetCode] 682. Baseball Game 棒球游戏

    You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 ...

  3. 高级UI-Path和PathMeasure

    Path是一个工具类,用来记录线条的轨迹路径,然后通过绘制轨迹路径,可以得到各种各样的图案,而PathMeasure是用来对Path进行测量的工具,再Path的运用中,运用最多的就是贝塞尔曲线,也是本 ...

  4. csu 1987: 绚丽的手链

    1987: 绚丽的手链 Submit Page   Summary   Time Limit: 6 Sec     Memory Limit: 512 Mb     Submitted: 13     ...

  5. appium怎么按下系统按键?如按下返回键、home键等等

    ava_client3.0版本以后使用pressKeyCode方法,之前的版本使用sendKeyEvent方法 1. 返回:driver.pressKeyCode(AndroidKeyCode.BAC ...

  6. .Net 配置 swagger 使用nginx反向代理后请求带端口号导致无法正常访问---解决方法

    1 webconfig中 appsetting 中增加配置 <appSettings> <add key="aspnet:UseHostHeaderForRequestUr ...

  7. leetocode 207 课程表

    解题思路: 本题可约化为:课程安排图是否是 有向无环图(DAG).即课程间规定了前置条件,但不能构成任何环路,否则课程前置条件将不成立. 思路是通过 拓扑排序 判断此课程安排图是否是 有向无环图(DA ...

  8. [C语言] 关于计算多边形面积的一点问题

    [一道练习题] 面基 时间限制:1000ms   内存限制:65536kb 通过率:107/134 (79.85%)    正确率:107/319 (33.54%) 题目描述 按顺时针或逆时针顺序输入 ...

  9. BugkuCTF~Misc~WriteUp

    1.签到 get flag: Qftm{You should sign in} 2.这是一张单纯的图片 查看图片十六进制 提去特殊字符串进行解码 get flag: key{you are right ...

  10. Python使用RMF聚类分析客户价值

    投资机构或电商企业等积累的客户交易数据繁杂.需要根据用户的以往消费记录分析出不同用户群体的特征与价值,再针对不同群体提供不同的营销策略. 用户分析指标 根据美国数据库营销研究所Arthur Hughe ...