Spring Cloud  Hystrix DashBoard 

Hystrix DashBoard 监控仪表盘用来监测请求访问量

1.监控系统配置

pom.xml

<!-- dashboard 客户端 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>

application.yml

spring:
application:
name: hystrix-dashboard
server:
port: 8010

Application.java

@EnableHystrixDashboard
@SpringBootApplication
public class HystrixDashboardApplication { public static void main(String[] args) {
SpringApplication.run(HystrixDashboardApplication.class, args);
} }

@EnableHystrixDashboard 开启仪表盘功能

访问: http://localhost:8010/hystrix

仪表盘

2.被监控服务配置

pom.xml

<!-- 系统健康监控工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

每个需要被监控的项目都要加,且是使用熔断机制的项目

application.yml

spring:
application:
name: hystrix-client server:
port: 8091 feign:
hystrix:
enabled: true management:
endpoints:
web:
exposure:
include: "*" # 暴露endpoints节点 2.x版本需要手动开启

management.endpoints 管理端点, 2.x版本需要手动开启

监控页面输入: http://localhost:8091/actuator/hystrix.stream

仪表盘

访问被监听的服务可以看到

监控页面

或者被监控的项目采用如下配置

@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}

监控页面输入: http://localhost:8091/hystrix.stream 进行监控

3.集群监控配置

创建spring-boot项目并添加依赖

pom.xml

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>

application.xml

spring:
application:
name: turbine-client server:
port: 8020 turbine:
app-config: hystrix-client
aggregator:
cluster-config: default
cluster-name-expression: new String("default")
combine-host-port: true

app-config 被监控集群的服务名称

Application.java

@EnableTurbine
@SpringBootApplication
public class TurbineClientApplication { public static void main(String[] args) {
SpringApplication.run(TurbineClientApplication.class, args);
} }

监控页面输入: http://localhost:8020/turbine.stream

监控页面

Spring Cloud 2-Hystrix DashBoard仪表盘(五)的更多相关文章

  1. spring cloud图形化dashboard是如何实现指标的收集展示的

    spring cloud图形化dashboard是如何实现指标的收集展示的 1.dashboard图形化界面入口 http://localhost:10000/hystrix.stream 说明:端口 ...

  2. Spring Cloud中Hystrix、Ribbon及Feign的熔断关系是什么?

    导读 今天和大家聊一聊在Spring Cloud微服务框架实践中,比较核心但是又很容易把人搞得稀里糊涂的一个问题,那就是在Spring Cloud中Hystrix.Ribbon以及Feign它们三者之 ...

  3. Spring Cloud中Hystrix 线程隔离导致ThreadLocal数据丢失问题分析

    最近spring boot项目中由于使用了spring cloud 的hystrix 导致了threadLocal中数据丢失,其实具体也没有使用hystrix,但是显示的把他打开了,导致了此问题. 导 ...

  4. Spring Cloud(三) --- hystrix

    Hystrix 说到Hystrix就得先说一下产生的背景等等,那就是雪崩效应. 在微服务中肯定存在多个服务层之间的调用,基础服务的故障可能会导致级联故障,进而造成整个系统不可用的情况,这种现象被称为服 ...

  5. Spring Cloud 之 Hystrix.

    一.概述  在微服务架构中,我们将系统拆分成了很多服务单元,各单元的应用间通过服务注册与订阅的方式互相依赖.由于每个单元都在不同的进程中运行,依赖通过远程调用的方式执行,这样就有可能因为网络原因或是依 ...

  6. 从零开始学spring cloud(十一) -------- hystrix监控

    一.官方文档阅读 服务启动后,可以通过/health和hystrix.stream查看效果,实际上,访问上述两个地址,会出现404,这是因为spring boot版本的问题, 我在这里使用的sprin ...

  7. 6、Spring Cloud -熔断器Hystrix

    6.1.什么是Hystrix 在分布式系统中.服务与服务之间的依赖错综复杂,一种不可避免的情况就是某些服务 出现故障,导致依赖于它们的其他服务出现远程调度的线程阻塞.   Hystrix是Netfli ...

  8. Spring Cloud 学习--Hystrix应用

    上一篇介绍了Hystrix基本功能和单独使用的方式,今天继续学习如何将Hystrix融入SpringCloud组件中去. 在Ribbon上使用熔断器 在 pom.xml 文件中引入 hystrix 的 ...

  9. 笔记:Spring Cloud Feign Hystrix 配置

    在 Spring Cloud Feign 中,除了引入了用户客户端负载均衡的 Spring Cloud Ribbon 之外,还引入了服务保护与容错的工具 Hystrix,默认情况下,Spring Cl ...

随机推荐

  1. django捡破烂

      一 Django的model form组件 这是一个神奇的组件,通过名字我们可以看出来,这个组件的功能就是把model和form组合起来,先来一个简单的例子来看一下这个东西怎么用:比如我们的数据库 ...

  2. HTTP 1.1状态代码及其含义说明

    100  Continue  初始的请求已经接受,客户应当继续发送请求的其余部分.(HTTP 1.1新)   101  Switching Protocols  服务器将遵从客户的请求转换到另外一种协 ...

  3. 初识Haskell 四:函数function之二 常见函数

    对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows,关于函数的部分太长了,分开写. 常用的对 ...

  4. 菜鸟学IT之四则运算升级版

     菜鸟学IT之四则运算升级版 本次作业要求来自:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE1/homework/2213 团队代码github远程仓库的 ...

  5. 一次jdk1.7升级jdk1.8后导致redis运行时blocked_clients过多问题解决

    公司有个采集项目,因为请求量较大,添加了redis集群,并且升级了原有的jdk1.7到jdk1.8版本,之后问题就出来了. 1.程序运行一段时间就自动停止,必须重启才能再次运行. 2.redis连接监 ...

  6. [ffmpeg] 滤波

    ffmpeg中有很多已经实现好的滤波器,这些滤波器的实现位于libavfilter目录之下,用户需要进行滤波时,就是是调用这些滤波器来实现的.ffmpeg对于调用滤波器有一整套的调用机制. 基本结构 ...

  7. mpvue——仿QQ【一】

    前言 原生仿QQ https://github.com/wangyang0210/Imitate-QQ-For-Mini-Program 这个是当时学习小程序时,模仿的一个demo,只不过是纯页面没啥 ...

  8. [leetcode] 5.Longest Palindromic Substring-1

    开始觉得挺简单的 写完发现这个时间超限了: class Solution: def longestPalindrome(self, s: str) -> str: # longest palin ...

  9. CF1157B-Long Number题解

    原题地址 题目大意:有一个\(n\)位数,其中的数字只有\(1\)~\(9\),不包括\(0\),每个\(1\)~\(9\)的数字有一个映射,映射也在\(1\)~\(9\)中,现在我们可以对这个\(n ...

  10. ECharts将折线变平滑和去掉点的属性

    eries : [ { name:'your name', symbol:'none', //这句就是去掉点的 smooth:true, //这句就是让曲线变平滑的 type:'line', stac ...