Spring Cloud学习--容错机制(Hystrix DashBoard之数据监控)
2017-10-01 20:36
543 查看
本文目录:
一使用Actuator监控
二 使用Hystrix DashBoard监控
因我使用火狐浏览器,每次访问就是下载hystrix.stream文件。这个问题还没解决,望各位大神支支招。
1.创建一个基本的spring boot 工程,添加spring-cloud-starter-hystrix-dashboard依赖。
2.启动类上添加@EnableHystrixDashboard 注解
4.配置文件:
3.启动项目,访问http://localhost:2001/hystrix 这是Hystrix DashBoard监控首页。
在url中输入http://localhost:8777/hystrix.stream ,点击Monitor Stream 出现如图界面,数量指标如图所示:
综上,实现了利用Hystrix DashBoard对单个实例的信息监控。
一使用Actuator监控
二 使用Hystrix DashBoard监控
一、使用Actuator监控
除了实现容错功能,Hystrix还提供了近乎实时的监控。断路器的状态也会暴露在Actuator提供的/health端点中,只需为项目(该项目可见http://blog.csdn.net/u012482647/article/details/78148447)添加spring-boot-actuator,重启项目,先访问http://localhost:8777/getString 再访问http://localhost:8777/hystrix.stream ,即可看到实时的监控数据。因我使用火狐浏览器,每次访问就是下载hystrix.stream文件。这个问题还没解决,望各位大神支支招。
二 、使用Hystrix DashBoard监控
Actuator 能看到的是一大堆数据,而使用Hystrix DashBoard(仪表盘),使得监控数据图形化、可视化。Hystrix仪表板可以显示每个断路器(被@HystrixCommand注解的方法)的状态。步骤如下:1.创建一个基本的spring boot 工程,添加spring-cloud-starter-hystrix-dashboard依赖。
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> </dependency>
2.启动类上添加@EnableHystrixDashboard 注解
@EnableHystrixDashboard @SpringBootApplication public class SpringCloudHystrixDashboardApplication { public static void main(String[] args) { SpringApplication.run(SpringCloudHystrixDashboardApplication.class, args); } }
4.配置文件:
spring.application.name=hystrix-Dashboard server.port=2001
3.启动项目,访问http://localhost:2001/hystrix 这是Hystrix DashBoard监控首页。
在url中输入http://localhost:8777/hystrix.stream ,点击Monitor Stream 出现如图界面,数量指标如图所示:
综上,实现了利用Hystrix DashBoard对单个实例的信息监控。
相关文章推荐
- Spring Cloud学习--容错机制(Hystrix之Turbine集群监控)
- Spring Cloud学习--容错机制(Hystrix之服务降级)
- spring cloud-添加Hystrix Dashboard监控到系统中
- Spring Cloud(五)断路器监控(Hystrix Dashboard)
- Spring Cloud 入门教程(八): 断路器指标数据监控Hystrix Dashboard 和 Turbine
- spring cloud学习笔记2(负载均衡ribbon,服务容错保护Hystrix)
- 服务容错保护断路器Hystrix之三:断路器监控(Hystrix Dashboard)
- Spring Cloud——断路器监控Hystrix Dashboard&Turbine
- SpringCloud 学习 | 第八篇: 断路器监控使用(Hystrix Dashboard)
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- Spring Cloud Hystrix监控数据聚合(十)
- 一步步学习微软InfoPath2010和SP2010--第十二章节--管理和监控InfoPath Form Services(IPFS)(6)--使用Fiddler监控数据连接Postback
- Spring Cloud架构教程 (十四)服务容错保护(Hystrix服务降级)【Dalston版】
- 我的OpenCV学习笔记(一):OpneCV中的数据共享机制
- Scrapy 入门学习笔记(3) -- 使用 Item 类转换传输数据以及ItemLoader 机制解析
- Spring Cloud架构教程 (一)Hystrix监控面板
- SpringCloud 教程 (五) 断路器监控(Hystrix Dashboard)
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- 一步步学习微软InfoPath2010和SP2010--第十二章节--管理和监控InfoPath Form Services(IPFS)(6)--使用Fiddler监控数据连接Postback