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 文件添加如下依赖:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>

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

package com.miniooc.eurekaturbine;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.turbine.EnableTurbine; /**
* EurekaTurbineApplication
*
* @author 宋陆
* @version 1.0.0
*/
@EnableTurbine
@SpringBootApplication
public class EurekaTurbineApplication { public static void main(String[] args) {
SpringApplication.run(EurekaTurbineApplication.class, args);
} }

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

server:
port: 52640 spring:
application:
name: eureka-turbine eureka:
instance:
hostname: localhost
# 表示eureka client间隔多久去拉取服务注册信息,默认为30秒,如果要迅速获取服务注册状态,可以缩小该值
lease-renewal-interval-in-seconds: 5
# 表示eureka server至上一次收到client的心跳之后,等待下一次心跳的超时时间,在这个时间内若没收到下一次心跳,则将移除该instance。
# 默认为90秒
# 如果该值太大,则很可能将流量转发过去的时候,该instance已经不存活了。
# 如果该值设置太小了,则instance则很可能因为临时的网络抖动而被摘除掉。
# 该值至少应该大于 leaseRenewalIntervalInSeconds
lease-expiration-duration-in-seconds: 10
client:
serviceUrl:
defaultZone: http://localhost:9527/eureka/,http://localhost:9528/eureka/,http://localhost:9529/eureka/ turbine:
app-config: eureka-discovery-ribbon, eureka-discovery-feign
aggregator:
cluster-config: default
cluster-name-expression: new String("default")
#更改turbine连接的默认uri ,默认为actuator/hystrix.stream
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. redis如何实现主从数据的同步

    Redis的主从同步机制可以确保redis的master和slave之间的数据同步.按照同步内容的多少可以分为全同步和部分同步:按照同步的时机可以分为slave刚启动时的初始化同步和正常运行过程中的数 ...

  2. 自动化运维工具之SaltStack简介与安装

    1.SaltStack简介 官方网址:http://www.saltstack.com官方文档:http://docs.saltstack.comGitHub:https:github.com/sal ...

  3. jquery trigger使用方法

    jquery trigger使用方法比方说写了下面点击事件 采用trigger 要触发他<pre> $('.biaoqian_ula').on('click',function () { ...

  4. ubuntu16.04+cuda9.0_cudnn7.5+tensorflow-gpu==1.12.0

    1.查找可用的tensorflow源,该命令运行后终端会输出所有可用的源 anaconda search -t conda tensorflow 2.这里name是上一步中输出源的tensorflow ...

  5. 原生js监听input值发生变化

    原生JS中可以使用oninput,onpropertychange,onchange oninput,onpropertychange,onchange的用法 1) onchange 触发事件必须满足 ...

  6. bzoj 4500 矩阵 题解

    题意: 有一个 $ n * m $ 的矩阵,初始每个格子的权值都为 $ 0 $,可以对矩阵执行两种操作: 选择一行,该行每个格子的权值加1或减1. 选择一列,该列每个格子的权值加1或减1. 现在有 $ ...

  7. Json 文件读写以及和IniFile 转换

    JSON 文件是越来越受欢迎了,以前程序配置文件用Ini,Ini 简练,简单.方便,但是也有不少缺点,比如,没有 JSON 直观,无法存储复杂点的数据类型. 于是乎,我封装了一个TJsonFile 的 ...

  8. python大道——博客目录

      python基础 第一章 计算机基础 计算机基础 第二章 python基础语法 python入门 第三章 基础数据类型和文件操作 整型.布尔.字符串 列表.字典.集合 公共功能.小数据池 hash ...

  9. django下创建多个app,如何设置每个app的urls

    1.创建第二个app 假设我们项目P下面已经有了一个默认的app,名字是app1.现在我想创建第二个app,名字时app2. 进入pychram下的Terminal中,运行命令: python man ...

  10. Linux命令sort和uniq 的基本使用

    uniq 123.txt  去除连续重复uniq -u 123.txt  保留唯一uniq -c 123.txt  去重并计算出现的个数sort -n 123.txt | uniq -c 排序后去重s ...