Spring Cloud 2-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仪表盘(五)的更多相关文章
- spring cloud图形化dashboard是如何实现指标的收集展示的
spring cloud图形化dashboard是如何实现指标的收集展示的 1.dashboard图形化界面入口 http://localhost:10000/hystrix.stream 说明:端口 ...
- Spring Cloud中Hystrix、Ribbon及Feign的熔断关系是什么?
导读 今天和大家聊一聊在Spring Cloud微服务框架实践中,比较核心但是又很容易把人搞得稀里糊涂的一个问题,那就是在Spring Cloud中Hystrix.Ribbon以及Feign它们三者之 ...
- Spring Cloud中Hystrix 线程隔离导致ThreadLocal数据丢失问题分析
最近spring boot项目中由于使用了spring cloud 的hystrix 导致了threadLocal中数据丢失,其实具体也没有使用hystrix,但是显示的把他打开了,导致了此问题. 导 ...
- Spring Cloud(三) --- hystrix
Hystrix 说到Hystrix就得先说一下产生的背景等等,那就是雪崩效应. 在微服务中肯定存在多个服务层之间的调用,基础服务的故障可能会导致级联故障,进而造成整个系统不可用的情况,这种现象被称为服 ...
- Spring Cloud 之 Hystrix.
一.概述 在微服务架构中,我们将系统拆分成了很多服务单元,各单元的应用间通过服务注册与订阅的方式互相依赖.由于每个单元都在不同的进程中运行,依赖通过远程调用的方式执行,这样就有可能因为网络原因或是依 ...
- 从零开始学spring cloud(十一) -------- hystrix监控
一.官方文档阅读 服务启动后,可以通过/health和hystrix.stream查看效果,实际上,访问上述两个地址,会出现404,这是因为spring boot版本的问题, 我在这里使用的sprin ...
- 6、Spring Cloud -熔断器Hystrix
6.1.什么是Hystrix 在分布式系统中.服务与服务之间的依赖错综复杂,一种不可避免的情况就是某些服务 出现故障,导致依赖于它们的其他服务出现远程调度的线程阻塞. Hystrix是Netfli ...
- Spring Cloud 学习--Hystrix应用
上一篇介绍了Hystrix基本功能和单独使用的方式,今天继续学习如何将Hystrix融入SpringCloud组件中去. 在Ribbon上使用熔断器 在 pom.xml 文件中引入 hystrix 的 ...
- 笔记:Spring Cloud Feign Hystrix 配置
在 Spring Cloud Feign 中,除了引入了用户客户端负载均衡的 Spring Cloud Ribbon 之外,还引入了服务保护与容错的工具 Hystrix,默认情况下,Spring Cl ...
随机推荐
- openstack第六章:dashboard
第六篇horizon— Web管理界面 一.horizon 介绍: 理解 horizon Horizon 为 Openstack 提供一个 WEB 前端的管理界面 (UI 服务 )通过 ...
- VSCode python 遇到的问题:vscode can't open file '<unprintable file name>': [Errno 2] No such file or directory
代码很简单,就两行: import pandas as pd import netCDF4 as nc dataset = nc.Dataset('20150101.nc') 环境:在VSCode中左 ...
- 队列(FIFO)—循环队列、队列的链式存储
1 队列的定义 队列是只允许在一端(队尾)进行插入操作,而在另一端(队头)进行删除操作的线性表. 2 队列的特点 1)先进先出是队列最大的特点,是应用中非常常见的模型,例如排队: 2)队列也属于线性表 ...
- ERP常见问题总结处理
1. ERP系统的重量录入组件设计不合理易导致录入错误 如下图所示: 修正方法: 1. 更正数据 使用SQL语句更正数据,已经生产完成,作为单据重新录入比较麻烦 UPDATE e_wms_materi ...
- 【HTML】行内-块级-行块级
行内元素 相邻元素可以在一行显示直到一行排不下才进行换行. 不可设置宽高,宽度随内容变化. padding和margin的设置中,水平方向(padding-left...)有效果,垂直方向无效果. 块 ...
- Python——pyqt5——各框架编程
一.日期时间(dateTimeEdit/dateEdit) setDateTime:设置日期(含时间) QDateTime.currentDateTime():当前日期(含时间) setDate:设置 ...
- xml 解析参考文档
https://www.cnblogs.com/a1656344531/archive/2012/11/28/2792863.html
- 如何使用django操作数据库,向原有表中添加新的字段信息并建立一个多对多的关系?
(注:本人用的pycharm开发工具) 1.在你要添加新字段的app的 models.py 文件中添加需要新增的字段(book表新增authors字段并和author建立多对多关系,author表新增 ...
- springboot全局捕获异常
捕获 捕获原理,使用AOP技术,采用异常通知. 1.捕获返回json格式 2.捕获返回页面 步骤: 1.@ControllerAdvice(pasePackage="") 注释异常 ...
- Educational Codeforces Round 63 (Rated for Div. 2) D. Beautiful Array 分类讨论连续递推dp
题意:给出一个 数列 和一个x 可以对数列一个连续的部分 每个数乘以x 问该序列可以达到的最大连续序列和是多少 思路: 不是所有区间题目都是线段树!!!!!! 这题其实是一个很简单的dp 使用的是分 ...