Hystrix_Dashboard 无法连接问题

Hystrix_Dashboard

Dashboard 仪表盘,一个服务熔断的实时监控工具,可直观的看到hystrix Command的请求响应,请求成功率

主要操作:

  • 一个HystrixDashboard客户端

    • 设置端口为9001

    • 添加依赖文本

      • hystrix-dashboard

      • <dependency>
        			<groupId>org.springframework.cloud</groupId>
        			<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
        		</dependency>
        
    • 在启动类开启服务

      • @EnableHystrixDashboard
  • 被监控的服务端

    • 设置端口8001

    • 添加依赖文本actuator

    • <dependency>
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-starter-actuator</artifactId>
              </dependency>
      
    • 如果使用的是2.x比较新的版本,需要在hystrix的消费端配置监控,在启动类添加bean

    • @Bean
         public ServletRegistrationBean hystrixMetricsStreamServlet() {
             ServletRegistrationBean registrationBean = new ServletRegistrationBean(new HystrixMetricsStreamServlet());
             registrationBean.addUrlMappings("/actuator/hystrix.stream");//访问该页面就是监控页面
             return registrationBean;
         }
      
  • 测试

    • 开启界面
    • Localhost:9001/hystrix
    • image-20201012191731501
    • 有三种不同的监控方式
      • 单体Hystrix消费者
        • 通过http://hystrix-app:port/hystrix.stream开启,实现对具体某个服务实例的监控
      • 默认集群监控
        • 通过 http://turbine-hostname:port/turbine.stream开启,实现对默认集群的监控
      • 自定集群监控
        • http://turbine-hostname:port/turbine.stream?cluster=[clusterName] ,实现对clusterName集群的监控
    • 可以先访问一下provider
    • 查看hystrix流
    • http://localhost:8001/actuator/hystrix.stream
    • image-20201018001351015
    • 把这一段复制过去
    • 设置名字就可以监控了
  • image-20201018001441414

  • image-20201012192223287

  • 遇到失败,连接失败问题一直没解决

  • 解决时间:2020年10月18日 00点15分

  • 问题原因,版本选择过高

  • 检查版本

  • <parent>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-parent</artifactId>
       <version>2.1.17.RELEASE</version>
       <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <properties>
    		<java.version>1.8</java.version>
    		<spring-cloud.version>Greenwich.SR6</spring-cloud.version>
    	</properties>
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值