Hystrix 监控可视化

返回目录

https://blog.csdn.net/BW_Bear/article/details/88746646

源码位置:

微服务注册管理:

https://github.com/zhaowei-zhang/CloudTest/tree/master/使用Hystrix实现容错/microservice-discovery-eureka

生产者:

https://github.com/zhaowei-zhang/CloudTest/tree/master/使用Hystrix实现容错/microservice-provider-user

Hystrix Dashboard项目:

https://github.com/zhaowei-zhang/CloudTest/tree/master/使用Hystrix实现容错/hystrix-dashboard

Turbine项目:

https://github.com/zhaowei-zhang/CloudTest/tree/master/使用Hystrix实现容错/hystrix-turbine

使用Hystrix Dashboard 可视化监控数据

1.新建可视化监控项目,加依赖

<!--hystrix 可视化监控 依赖-->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
    <version>RELEASE</version>
</dependency>

2.启动类增加注解

在这里插入图片描述

3.修改配置文件

在这里插入图片描述

4.启动调接口,开监控页

在这里插入图片描述
打开新项目的可视化监控地址/hystrix
在这里插入图片描述

5.测试

在这里插入图片描述
当然要中文的话直接用谷歌网页翻译就好了,哈哈

使用Turbine 监控多个微服务

1.新建Turbine项目

2.加依赖

<!--hystrix 依赖-->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
    <version>RELEASE</version>
</dependency>

<!--Eureka client 依赖-->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

不要忘了cloud

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Edgware.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

3.修改配置文件

server:
  port: 9106
spring:
  application:
    name: hystrixturbine
eureka:
  client:
    service-url:
      defaultZone: http://localhost:9100/eureka/
  instance:
    prefer-ip-address: true  #表示将注解的IP注册到Eureka Server
turbine:
  app-config: MICROSERVICE-CONSUMER-MOVIE-1,MICROSERVICE-CONSUMER-MOVIE-2
  cluster-name-expression: "'default'"

4.启动生产者and消费者们

消费者们如下
MICROSERVICE-CONSUMER-MOVIE-1
MICROSERVICE-CONSUMER-MOVIE-2

5.启动Turbine项目

6.启动Hystrix Dashboard

7.测试

在这里插入图片描述

在这里插入图片描述

返回目录

https://blog.csdn.net/BW_Bear/article/details/88746646

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值